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){ + $("