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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « options.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: popup.js
===================================================================
--- a/popup.js
+++ b/popup.js
@@ -1,13 +1,16 @@
var backgroundPage = chrome.extension.getBackgroundPage();
-var imports = ["FilterStorage", "Filter", "isWhitelisted", "extractHostFromURL", "refreshIconAndContextMenu"];
+var imports = ["require", "isWhitelisted", "extractHostFromURL", "refreshIconAndContextMenu"];
for (var i = 0; i < imports.length; i++)
window[imports[i]] = backgroundPage[imports[i]];
+var Filter = require("filterClasses").Filter;
+var FilterStorage = require("filterStorage").FilterStorage;
+
var tab = null;
function init()
{
// Attach event listeners
$("#enabled").click(toggleEnabled);
$("#clickHideButton").click(activateClickHide);
$("#cancelButton").click(cancelClickHide);
« no previous file with comments | « options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld