Permalink
Browse files

new manifest updates

  • Loading branch information...
1 parent f849de7 commit a814ec65655bd35149b1b8cbc6a955fa643ef89a @mrshu mrshu committed Nov 12, 2012
View
0 .gitignore 100644 → 100755
File mode changed.
View
0 LICENSE 100644 → 100755
File mode changed.
View
0 Makefile 100644 → 100755
File mode changed.
View
0 build/chrome-zeroclick-latest.crx 100644 → 100755
File mode changed.
View
0 build/chrome_zeroclickinfo_latest.crx 100644 → 100755
File mode changed.
View
0 css/bing.css 100644 → 100755
File mode changed.
View
0 css/google.css 100644 → 100755
File mode changed.
View
0 html/background.html 100644 → 100755
File mode changed.
View
56 html/options.html 100644 → 100755
@@ -17,59 +17,9 @@
<!DOCTYPE html>
<html>
<head><title>DuckDuckGo for Chrome - Options</title></head>
-<script type="text/javascript">
+<script type="text/javascript" src="../js/options.js"></script>
-// Saves options to localStorage.
-function save_options() {
- var dev = document.getElementById("dev").checked;
- localStorage["dev"] = dev;
- var meanings = document.getElementById("meanings").checked;
- localStorage["meanings"] = meanings;
- var zeroclickinfo = document.getElementById("zeroclickinfo").checked;
- localStorage["zeroclickinfo"] = zeroclickinfo;
-
- if (dev)
- console.log(localStorage);
-
- // Update status to let user know options were saved.
- var status = document.getElementById("status");
- status.innerHTML = "Options Saved.";
- setTimeout(function() {
- status.innerHTML = "";
- }, 750);
-
- chrome.extension.sendMessage({'options': localStorage}, function(response){
- console.log(response);
- });
-}
-
-// Restores select box state to saved value from localStorage.
-function restore_options() {
- var dev = localStorage["dev"];
- if (dev === 'true') {
- document.getElementById("dev").checked = true;
- } else {
- document.getElementById("dev").checked = false;
- }
-
- var meanings = localStorage["meanings"];
- if (meanings === 'true') {
- document.getElementById("meanings").checked = true;
- } else {
- document.getElementById("meanings").checked = false;
- }
-
- var zeroclickinfo = localStorage["zeroclickinfo"];
- if (zeroclickinfo === 'true' || zeroclickinfo == undefined) {
- document.getElementById("zeroclickinfo").checked = true;
- } else {
- document.getElementById("zeroclickinfo").checked = false;
- }
-}
-
-</script>
-
-<body onload="restore_options()">
+<body>
Developer mode:
<input type="checkbox" id="dev" ></input>
@@ -82,7 +32,7 @@
<br>
-<button onclick="save_options()">Save</button>
+<button>Save</button>
<div id="status"> </div>
</body>
</html>
View
0 html/popup.html 100644 → 100755
File mode changed.
View
0 img/icon_128.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 img/icon_16.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 img/icon_48.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 js/background.js 100644 → 100755
@@ -18,7 +18,7 @@
function Background()
{
$this = this;
- chrome.extension.onRequest.addListener(function(request, sender, callback){
+ chrome.extension.onMessage.addListener(function(request, sender, callback){
console.log(request);
if(request.query)
$this.query(request.query, callback);
@@ -62,3 +62,5 @@ Background.prototype.query = function(query, callback)
req.send(null);
}
+
+var background = new Background();
View
0 js/bing.js 100644 → 100755
File mode changed.
View
0 js/common.js 100644 → 100755
File mode changed.
View
0 js/google.js 100644 → 100755
File mode changed.
View
0 js/jquery.js 100644 → 100755
File mode changed.
View
5 manifest.json 100644 → 100755
@@ -7,6 +7,7 @@
"48": "img/icon_48.png",
"128": "img/icon_128.png"
},
+ "manifest_version": 2,
"browser_action": {
"default_icon": "img/icon_16.png",
"popup": "html/popup.html"
@@ -410,7 +411,9 @@
}
],
"options_page": "html/options.html",
- "background_page": "html/background.html",
+ "background": {
+ "scripts": ["js/background.js"]
+ },
"permissions": [
"https://chrome.duckduckgo.com/*"
]

0 comments on commit a814ec6

Please sign in to comment.