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 Dave's comments Created March 2, 2018, 11:43 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 | « background.js ('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 }
243 else if (this == collections.filterLists)
244 {
245 // List preinstalled by administrators
246 getPref("additional_subscriptions", (additionalSubscriptions) =>
247 {
248 if (additionalSubscriptions.includes(item.url))
249 element.classList.add("non-removable");
250 });
251 }
241 } 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;
(...skipping 1214 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 | « background.js ('k') | skin/desktop-options.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld