Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue "Can not be switched on" on Chrome 33 and newer. #5

Merged
merged 3 commits into from
Jul 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
=============================================================================
*/
/*global jQuery, chrome, console, document, window, localStorage */
chrome.extension.onRequest.addListener(
chrome.runtime.onMessage.addListener(
function (request, sender, sendResponse) {
'use strict';

switch(request.method) {
case 'handleStatus':
if (!!request.status) {
Expand Down
8 changes: 4 additions & 4 deletions js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
/*global jQuery, chrome, console, document, window, noty, localStorage */
(function ($) {
'use strict';

function sendStatus(bangla) {
chrome.extension.sendRequest({method: 'handleStatus', status: bangla});
chrome.runtime.sendMessage({method: 'handleStatus', status: bangla});
}

var selector = 'textarea, input[type=text]';
$.noConflict();

chrome.extension.sendRequest({method: 'hotKey'}, function(response) {
chrome.runtime.sendMessage({method: 'hotKey'}, function(response) {
$(function () {
var callback = function (isBangla) {
sendStatus(isBangla);
Expand All @@ -54,7 +54,7 @@

if(typeof localStorage.AvroKeyboard === 'undefined') {
localStorage.AvroKeyboard = true;
chrome.extension.sendRequest({method: 'popupCount'}, function(response) {
chrome.runtime.sendMessage({method: 'popupCount'}, function(response) {
if (response.popupCount <= 3) {
$(window).load(function(){
noty({
Expand Down
20 changes: 15 additions & 5 deletions js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function save_options() {
var select = document.getElementById("hotkey");
var hotkey = select.children[select.selectedIndex].value;
localStorage["hotkey"] = hotkey;

noty({
text: "Setting Saved",
layout: "top",
Expand All @@ -19,13 +19,23 @@ function save_options() {

}

function addOption(key,keyName){
$("<option/>", {
value: key,
html: keyName
}).appendTo("#hotkey");
}

function populate_options(){
//Alphabets
for (i = 65 ; i <= 90 ; ++i){
$("<option/>", {
value: i,
html: String.fromCharCode(i)
}).appendTo("#hotkey");
addOption(i, String.fromCharCode(i));
}

//Space key
addOption(32,"Space");
addOption(190," . ");

restore_options();
}

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Avro Keyboard",
"version": "1.4",
"version": "1.5",
"manifest_version": 2,
"description": "Official Avro Keyboard for Google Chrome",
"background": {
Expand Down
2 changes: 1 addition & 1 deletion options.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1 id="optionTitle">Avro Keyboard Options</h1>
<div id="shortcutSettingDiv" style="margin: 0px 0px 5px 0px">
<h4 id="shorcutSetting">Hotkey for switching language</h4>
<div id="hot-key-setting">
<label for="hotkey">Cntrl +</label>
<label for="hotkey">Ctrl +</label>
<select id="hotkey"></select>
</div>
<div id="error-info"></div>
Expand Down