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

Side by Side Diff: js/desktop-options.js

Issue 29712664: Issue 6432 - Hide remove button for additional filter lists (Closed)
Patch Set: Addressed Thomas's comments Created March 6, 2018, 3:03 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 | « desktop-options.html ('k') | skin/desktop-options.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 231
232 element.setAttribute("aria-label", title); 232 element.setAttribute("aria-label", title);
233 if (this.details[i].searchable) 233 if (this.details[i].searchable)
234 element.setAttribute("data-search", title.toLowerCase()); 234 element.setAttribute("data-search", title.toLowerCase());
235 let controls = element.querySelectorAll(".control[role='checkbox']"); 235 let controls = element.querySelectorAll(".control[role='checkbox']");
236 for (let control of controls) 236 for (let control of controls)
237 { 237 {
238 control.setAttribute("aria-checked", item.disabled == false); 238 control.setAttribute("aria-checked", item.disabled == false);
239 if (isAcceptableAds(item.url) && this == collections.filterLists) 239 if (isAcceptableAds(item.url) && this == collections.filterLists)
240 {
240 control.disabled = true; 241 control.disabled = true;
242 }
241 } 243 }
244 getPref("additional_subscriptions", (additionalSubscriptions) =>
Thomas Greiner 2018/03/07 17:45:38 I just noticed that this is called each time we up
saroyanm 2018/03/08 18:03:36 Done, we still need to refactor code to avoid the
Thomas Greiner 2018/03/08 19:28:19 I agree that this can be tackled separately as par
245 {
246 if (additionalSubscriptions.includes(item.url))
247 {
248 element.classList.add("preconfigured");
249 if (this == collections.protection)
Thomas Greiner 2018/03/07 17:45:38 We tend to avoid hard-coding behavior for specific
saroyanm 2018/03/08 18:03:36 Done.
250 controls[0].disabled = true;
251 }
252 });
242 253
243 let lastUpdateElement = element.querySelector(".last-update"); 254 let lastUpdateElement = element.querySelector(".last-update");
244 if (lastUpdateElement) 255 if (lastUpdateElement)
245 { 256 {
246 let message = element.querySelector(".message"); 257 let message = element.querySelector(".message");
247 if (item.isDownloading) 258 if (item.isDownloading)
248 { 259 {
249 let text = getMessage("options_filterList_lastDownload_inProgress"); 260 let text = getMessage("options_filterList_lastDownload_inProgress");
250 message.textContent = text; 261 message.textContent = text;
251 element.classList.add("show-message"); 262 element.classList.add("show-message");
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 "ui_warn_tracking"] 1476 "ui_warn_tracking"]
1466 }); 1477 });
1467 browser.runtime.sendMessage({ 1478 browser.runtime.sendMessage({
1468 type: "subscriptions.listen", 1479 type: "subscriptions.listen",
1469 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1480 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1470 "title", "downloadStatus", "downloading"] 1481 "title", "downloadStatus", "downloading"]
1471 }); 1482 });
1472 1483
1473 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1484 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1474 window.addEventListener("hashchange", onHashChange, false); 1485 window.addEventListener("hashchange", onHashChange, false);
OLDNEW
« no previous file with comments | « desktop-options.html ('k') | skin/desktop-options.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld