diff --git a/js/background.js b/js/background.js index dfe5adc..9462edb 100644 --- a/js/background.js +++ b/js/background.js @@ -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) { diff --git a/js/content.js b/js/content.js index 34429c7..6de2d9e 100644 --- a/js/content.js +++ b/js/content.js @@ -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); @@ -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({ diff --git a/js/options.js b/js/options.js index 69e437f..4316d12 100644 --- a/js/options.js +++ b/js/options.js @@ -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", @@ -19,13 +19,23 @@ function save_options() { } +function addOption(key,keyName){ + $("", { + value: key, + html: keyName + }).appendTo("#hotkey"); +} + function populate_options(){ + //Alphabets for (i = 65 ; i <= 90 ; ++i){ - $("", { - value: i, - html: String.fromCharCode(i) - }).appendTo("#hotkey"); + addOption(i, String.fromCharCode(i)); } + + //Space key + addOption(32,"Space"); + addOption(190," . "); + restore_options(); } diff --git a/manifest.json b/manifest.json index 7e34017..470fcf0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "Avro Keyboard", - "version": "1.4", + "version": "1.5", "manifest_version": 2, "description": "Official Avro Keyboard for Google Chrome", "background": { diff --git a/options.html b/options.html index d585dbc..fd5f8c9 100644 --- a/options.html +++ b/options.html @@ -15,7 +15,7 @@