| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |