Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 /* globals checkShareResource, getDocLink, i18nFormatDateTime, openSharePopup, | 18 /* globals checkShareResource, getDocLink, i18nFormatDateTime, openSharePopup, |
Thomas Greiner
2017/03/07 13:33:02
Detail: Isn't this violating the "max-len" rule?
kzar
2017/03/08 10:29:32
No, just under.
| |
19 E */ | 19 E */ |
20 | 20 |
21 "use strict"; | 21 "use strict"; |
22 | 22 |
23 { | 23 { |
24 let subscriptionsMap = Object.create(null); | 24 let subscriptionsMap = Object.create(null); |
25 let filtersMap = Object.create(null); | 25 let filtersMap = Object.create(null); |
26 let collections = Object.create(null); | 26 let collections = Object.create(null); |
27 let acceptableAdsUrl = null; | 27 let acceptableAdsUrl = null; |
28 let {getMessage} = ext.i18n; | 28 let {getMessage} = ext.i18n; |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
497 let url = dialog.querySelector(".url").textContent; | 497 let url = dialog.querySelector(".url").textContent; |
498 addEnableSubscription(url, title); | 498 addEnableSubscription(url, title); |
499 closeDialog(); | 499 closeDialog(); |
500 break; | 500 break; |
501 } | 501 } |
502 case "cancel-custom-filters": | 502 case "cancel-custom-filters": |
503 E("custom-filters").classList.remove("mode-edit"); | 503 E("custom-filters").classList.remove("mode-edit"); |
504 break; | 504 break; |
505 case "cancel-domain-exception": | 505 case "cancel-domain-exception": |
506 E("whitelisting-textbox").value = ""; | 506 E("whitelisting-textbox").value = ""; |
507 document.querySelector("#whitelisting .controls").classList. | 507 document.querySelector("#whitelisting .controls").classList |
508 remove("mode-edit"); | 508 .remove("mode-edit"); |
509 break; | 509 break; |
510 case "close-dialog": | 510 case "close-dialog": |
511 closeDialog(); | 511 closeDialog(); |
512 break; | 512 break; |
513 case "edit-custom-filters": | 513 case "edit-custom-filters": |
514 E("custom-filters").classList.add("mode-edit"); | 514 E("custom-filters").classList.add("mode-edit"); |
515 editCustomFilters(); | 515 editCustomFilters(); |
516 break; | 516 break; |
517 case "edit-domain-exception": | 517 case "edit-domain-exception": |
518 document.querySelector("#whitelisting .controls").classList. | 518 document.querySelector("#whitelisting .controls").classList |
519 add("mode-edit"); | 519 .add("mode-edit"); |
520 E("whitelisting-textbox").focus(); | 520 E("whitelisting-textbox").focus(); |
521 break; | 521 break; |
522 case "import-subscription": { | 522 case "import-subscription": { |
523 let url = E("blockingList-textbox").value; | 523 let url = E("blockingList-textbox").value; |
524 addEnableSubscription(url); | 524 addEnableSubscription(url); |
525 closeDialog(); | 525 closeDialog(); |
526 break; | 526 break; |
527 } | 527 } |
528 case "open-dialog": { | 528 case "open-dialog": { |
529 let dialog = findParentData(element, "dialog", false); | 529 let dialog = findParentData(element, "dialog", false); |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
979 let domain = E("whitelisting-textbox"); | 979 let domain = E("whitelisting-textbox"); |
980 if (domain.value) | 980 if (domain.value) |
981 { | 981 { |
982 sendMessageHandleErrors({ | 982 sendMessageHandleErrors({ |
983 type: "filters.add", | 983 type: "filters.add", |
984 text: "@@||" + domain.value.toLowerCase() + "^$document" | 984 text: "@@||" + domain.value.toLowerCase() + "^$document" |
985 }); | 985 }); |
986 } | 986 } |
987 | 987 |
988 domain.value = ""; | 988 domain.value = ""; |
989 document.querySelector("#whitelisting .controls"). | 989 document.querySelector("#whitelisting .controls") |
990 classList.remove("mode-edit"); | 990 .classList.remove("mode-edit"); |
991 } | 991 } |
992 | 992 |
993 function editCustomFilters() | 993 function editCustomFilters() |
994 { | 994 { |
995 let filterTexts = []; | 995 let filterTexts = []; |
996 for (let customFilterItem of collections.customFilters.items) | 996 for (let customFilterItem of collections.customFilters.items) |
997 filterTexts.push(customFilterItem.text); | 997 filterTexts.push(customFilterItem.text); |
998 E("custom-filters-raw").value = filterTexts.join("\n"); | 998 E("custom-filters-raw").value = filterTexts.join("\n"); |
999 } | 999 } |
1000 | 1000 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1297 }); | 1297 }); |
1298 ext.backgroundPage.sendMessage({ | 1298 ext.backgroundPage.sendMessage({ |
1299 type: "subscriptions.listen", | 1299 type: "subscriptions.listen", |
1300 filter: ["added", "disabled", "homepage", "lastDownload", "removed", | 1300 filter: ["added", "disabled", "homepage", "lastDownload", "removed", |
1301 "title", "downloadStatus", "downloading"] | 1301 "title", "downloadStatus", "downloading"] |
1302 }); | 1302 }); |
1303 | 1303 |
1304 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 1304 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); |
1305 window.addEventListener("hashchange", onHashChange, false); | 1305 window.addEventListener("hashchange", onHashChange, false); |
1306 } | 1306 } |
LEFT | RIGHT |