Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: popup.js

Issue 8403145: First attempt at creating a first-run page (Closed)
Patch Set: Now with two sets of Share buttons Created Sept. 28, 2012, 8:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « options.js ('k') | skin/checkmark.png » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var backgroundPage = chrome.extension.getBackgroundPage(); 1 var backgroundPage = chrome.extension.getBackgroundPage();
2 var imports = ["FilterStorage", "Filter", "isWhitelisted", "extractHostFromURL", "refreshIconAndContextMenu"]; 2 var imports = ["FilterStorage", "Filter", "isWhitelisted", "extractHostFromURL", "refreshIconAndContextMenu"];
3 for (var i = 0; i < imports.length; i++) 3 for (var i = 0; i < imports.length; i++)
4 window[imports[i]] = backgroundPage[imports[i]]; 4 window[imports[i]] = backgroundPage[imports[i]];
5 5
6 var tab = null; 6 var tab = null;
7 7
8 function init() 8 function init()
9 { 9 {
10 // Fill in i18n strings
11 loadI18nStrings();
12
13 // Attach event listeners 10 // Attach event listeners
14 $("#enabled").click(toggleEnabled); 11 $("#enabled").click(toggleEnabled);
15 $("#clickHideButton").click(activateClickHide); 12 $("#clickHideButton").click(activateClickHide);
16 $("#cancelButton").click(cancelClickHide); 13 $("#cancelButton").click(cancelClickHide);
17 14
18 // Ask content script whether clickhide is active. If so, show cancel button. 15 // Ask content script whether clickhide is active. If so, show cancel button.
19 // If that isn't the case, ask background.html whether it has cached filters. If so, 16 // If that isn't the case, ask background.html whether it has cached filters. If so,
20 // ask the user whether she wants those filters. 17 // ask the user whether she wants those filters.
21 // Otherwise, we are in default state. 18 // Otherwise, we are in default state.
22 chrome.windows.getCurrent(function(w) 19 chrome.windows.getCurrent(function(w)
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 document.getElementById("clickHideInactiveStuff").style.display = "none"; 93 document.getElementById("clickHideInactiveStuff").style.display = "none";
97 document.getElementById("clickHideActiveStuff").style.display = "inherit"; 94 document.getElementById("clickHideActiveStuff").style.display = "inherit";
98 } 95 }
99 96
100 function clickHideInactiveStuff() 97 function clickHideInactiveStuff()
101 { 98 {
102 document.getElementById("enabledCheckboxAndLabel").style.display = "block"; 99 document.getElementById("enabledCheckboxAndLabel").style.display = "block";
103 document.getElementById("clickHideActiveStuff").style.display = "none"; 100 document.getElementById("clickHideActiveStuff").style.display = "none";
104 document.getElementById("clickHideInactiveStuff").style.display = "inherit"; 101 document.getElementById("clickHideInactiveStuff").style.display = "inherit";
105 } 102 }
OLDNEW
« no previous file with comments | « options.js ('k') | skin/checkmark.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld