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

Side by Side Diff: popup.js

Issue 8616119: Use require() properly instead of importing all symbols of a module (Closed)
Patch Set: Created Oct. 22, 2012, 8:48 a.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') | no next file » | 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 = ["require", "isWhitelisted", "extractHostFromURL", "refreshIconAnd ContextMenu"];
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 Filter = require("filterClasses").Filter;
7 var FilterStorage = require("filterStorage").FilterStorage;
8
6 var tab = null; 9 var tab = null;
7 10
8 function init() 11 function init()
9 { 12 {
10 // Attach event listeners 13 // Attach event listeners
11 $("#enabled").click(toggleEnabled); 14 $("#enabled").click(toggleEnabled);
12 $("#clickHideButton").click(activateClickHide); 15 $("#clickHideButton").click(activateClickHide);
13 $("#cancelButton").click(cancelClickHide); 16 $("#cancelButton").click(cancelClickHide);
14 17
15 // Ask content script whether clickhide is active. If so, show cancel button. 18 // Ask content script whether clickhide is active. If so, show cancel button.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 document.getElementById("clickHideInactiveStuff").style.display = "none"; 96 document.getElementById("clickHideInactiveStuff").style.display = "none";
94 document.getElementById("clickHideActiveStuff").style.display = "inherit"; 97 document.getElementById("clickHideActiveStuff").style.display = "inherit";
95 } 98 }
96 99
97 function clickHideInactiveStuff() 100 function clickHideInactiveStuff()
98 { 101 {
99 document.getElementById("enabledCheckboxAndLabel").style.display = "block"; 102 document.getElementById("enabledCheckboxAndLabel").style.display = "block";
100 document.getElementById("clickHideActiveStuff").style.display = "none"; 103 document.getElementById("clickHideActiveStuff").style.display = "none";
101 document.getElementById("clickHideInactiveStuff").style.display = "inherit"; 104 document.getElementById("clickHideInactiveStuff").style.display = "inherit";
102 } 105 }
OLDNEW
« no previous file with comments | « options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld