Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
torifat committed Dec 29, 2011
0 parents commit 653d08a
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 0 deletions.
22 changes: 22 additions & 0 deletions background.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>Background Page</title>
<script>
chrome.extension.onRequest.addListener(
function (request, sender, sendResponse) {
'use strict';
if (!!request.status) {
chrome.pageAction.setIcon({tabId: sender.tab.id, path: 'icon-16.png'});
} else {
chrome.pageAction.setIcon({tabId: sender.tab.id, path: 'icon-16-dim.png'});
}
chrome.pageAction.show(sender.tab.id);
sendResponse({});
}
);
</script>
</head>
<body>
</body>
</html>
Binary file added icon-16-dim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions js/avro-1.1-beta.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions js/content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
=============================================================================
*****************************************************************************
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is Avro Keyboard for Google Chrome
The Initial Developer of the Original Code is
Rifat Nabi <to.rifat@gmail.com>
Copyright (C) OmicronLab (http://www.omicronlab.com). All Rights Reserved.
Contributor(s): ______________________________________.
*****************************************************************************
=============================================================================
*/
/*global jQuery, chrome, console */
function sendStatus(bangla) {
'use strict';
chrome.extension.sendRequest({status: bangla}, function (response) {
if (response) {
console.log('Avro Switched');
}
});
}

jQuery.noConflict();
jQuery(function () {
'use strict';
jQuery('textarea, input[type=text]').avro({'bangla': false}, function (isBangla) {
sendStatus(isBangla);
});

jQuery('textarea, input[type=text]').on('blur', function () {
sendStatus(false);
});
});
4 changes: 4 additions & 0 deletions js/jquery-1.7.1.min.js

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "Avro Keyboard",
"version": "1.0",
"description": "Official Avro Keyboard for Google Chrome",
"background_page": "background.html",
"page_action" : {
"default_icon" : "icon-16-dim.png",
"default_title" : "There's a 'sandwich' in this page!"
},
"permissions": ["tabs", "http://*/*", "https://*/*" ],
"icons" : {
"16" : "icon-16.png",
"48" : "icon.png"
},
"content_scripts" : [
{
"matches" : [
"http://*/*",
"https://*/*"
],
"js" : ["js/jquery-1.7.1.min.js", "js/avro-1.1-beta.min.js", "js/content.js"],
"run_at" : "document_end",
"all_frames" : true
}
]
}

0 comments on commit 653d08a

Please sign in to comment.