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 Jeen's suggestion in the ticket Created March 2, 2018, 4:31 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
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) =>
245 {
246 if (additionalSubscriptions.includes(item.url))
247 element.classList.add("preconfigured");
248 });
242 249
243 let lastUpdateElement = element.querySelector(".last-update"); 250 let lastUpdateElement = element.querySelector(".last-update");
244 if (lastUpdateElement) 251 if (lastUpdateElement)
245 { 252 {
246 let message = element.querySelector(".message"); 253 let message = element.querySelector(".message");
247 if (item.isDownloading) 254 if (item.isDownloading)
248 { 255 {
249 let text = getMessage("options_filterList_lastDownload_inProgress"); 256 let text = getMessage("options_filterList_lastDownload_inProgress");
250 message.textContent = text; 257 message.textContent = text;
251 element.classList.add("show-message"); 258 element.classList.add("show-message");
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 "ui_warn_tracking"] 1472 "ui_warn_tracking"]
1466 }); 1473 });
1467 browser.runtime.sendMessage({ 1474 browser.runtime.sendMessage({
1468 type: "subscriptions.listen", 1475 type: "subscriptions.listen",
1469 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1476 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1470 "title", "downloadStatus", "downloading"] 1477 "title", "downloadStatus", "downloading"]
1471 }); 1478 });
1472 1479
1473 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1480 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1474 window.addEventListener("hashchange", onHashChange, false); 1481 window.addEventListener("hashchange", onHashChange, false);
OLDNEW

Powered by Google App Engine
This is Rietveld