Skip to content

Commit

Permalink
Merge pull request #5 from SohanChy/master
Browse files Browse the repository at this point in the history
Fix issue "Can not be switched on" on Chrome 33 and newer.
  • Loading branch information
torifat authored Jul 25, 2016
2 parents 385930a + 9854834 commit 5470459
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
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

0 comments on commit 5470459

Please sign in to comment.