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

Unified Diff: popup.js

Issue 29374674: Issue 4864 - Start using ESLint for adblockpluschrome (Closed)
Patch Set: Use var for ext declarations again Created Feb. 8, 2017, 9:02 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
« options.js ('K') | « options.js ('k') | qunit/.eslintrc.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: popup.js
diff --git a/popup.js b/popup.js
index cce3937f49c4c09551b26a582d0437c86dfa258f..f31d31aabbd87b88bbad7732584d676f09f1e6dd 100644
--- a/popup.js
+++ b/popup.js
@@ -36,7 +36,9 @@ function onLoad()
// Mark page as 'local' or 'nohtml' to hide non-relevant elements
if (!page || (page.url.protocol != "http:" &&
page.url.protocol != "https:"))
+ {
document.body.classList.add("local");
+ }
else if (!require("filterComposer").isPageReady(page))
{
document.body.classList.add("nohtml");
@@ -49,10 +51,10 @@ function onLoad()
);
}
- // Ask content script whether clickhide is active. If so, show cancel button.
- // If that isn't the case, ask background.html whether it has cached filters. If so,
- // ask the user whether she wants those filters.
- // Otherwise, we are in default state.
+ // Ask content script whether clickhide is active. If so, show
+ // cancel button. If that isn't the case, ask background.html
+ // whether it has cached filters. If so, ask the user whether she
+ // wants those filters. Otherwise, we are in default state.
if (page)
{
if (checkWhitelisted(page))
@@ -66,9 +68,15 @@ function onLoad()
}
});
- document.getElementById("enabled").addEventListener("click", toggleEnabled, false);
- document.getElementById("clickhide").addEventListener("click", activateClickHide, false);
- document.getElementById("clickhide-cancel").addEventListener("click", cancelClickHide, false);
+ document.getElementById("enabled").addEventListener(
+ "click", toggleEnabled, false
+ );
+ document.getElementById("clickhide").addEventListener(
+ "click", activateClickHide, false
+ );
+ document.getElementById("clickhide-cancel").addEventListener(
+ "click", cancelClickHide, false
+ );
document.getElementById("options").addEventListener("click", () =>
{
ext.showOptions();
@@ -79,7 +87,11 @@ function onLoad()
{
collapser.addEventListener("click", toggleCollapse, false);
if (!Prefs[collapser.dataset.option])
- document.getElementById(collapser.dataset.collapsable).classList.add("collapsed");
+ {
+ document.getElementById(
+ collapser.dataset.collapsable
+ ).classList.add("collapsed");
+ }
}
}
@@ -91,7 +103,9 @@ function toggleEnabled()
let host = getDecodedHostname(page.url).replace(/^www\./, "");
let filter = Filter.fromText("@@||" + host + "^$document");
if (filter.subscriptions.length && filter.disabled)
+ {
filter.disabled = false;
+ }
else
{
filter.disabled = false;
« options.js ('K') | « options.js ('k') | qunit/.eslintrc.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld