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-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 |
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, openSharePopup, setLinks, E */ | 18 /* globals checkShareResource, getDocLink, openSharePopup, setLinks, E */ |
Thomas Greiner
2018/02/16 16:19:14
Detail: We no longer use `checkShareResource()` an
| |
19 | 19 |
20 "use strict"; | 20 "use strict"; |
21 | 21 |
22 (function() | 22 (function() |
23 { | 23 { |
24 function openFilters() | |
25 { | |
26 browser.runtime.sendMessage({type: "app.open", what: "options"}); | |
27 } | |
28 | |
29 function navigationClick(event) | |
30 { | |
31 document.getElementById("navbar-menu").classList.toggle("visible"); | |
Thomas Greiner
2018/02/16 16:19:12
Detail: I don't mind using either `E()` or `docume
| |
32 } | |
33 | |
34 function initMenu() | |
35 { | |
36 document.getElementById("navbar-menu-toggle").addEventListener("click", navi gationClick, false); | |
Thomas Greiner
2018/02/16 16:19:11
Detail: The third function argument parameter is r
Thomas Greiner
2018/02/16 16:19:14
Coding style: "Line length: 80 characters or less"
| |
37 } | |
38 | |
24 function onDOMLoaded() | 39 function onDOMLoaded() |
25 { | 40 { |
26 const optionsTrigger = E("options-trigger"); | 41 const optionsTrigger = E("options-trigger"); |
Thomas Greiner
2018/02/16 16:19:13
Coding style: "Use const for constant expressions
| |
27 | 42 |
28 optionsTrigger.addEventListener("click", (e) => | 43 optionsTrigger.addEventListener("click", (e) => |
29 { | 44 { |
30 e.preventDefault(); | 45 e.preventDefault(); |
31 openFilters(); | 46 openFilters(); |
32 }); | 47 }); |
33 | 48 |
34 setLinks("first-column-description", " https://adblockplus.org/terms"); | 49 setLinks("first-column-description", " https://adblockplus.org/terms"); |
Thomas Greiner
2018/02/16 16:19:13
As done with the Updates page, don't hardcode any
| |
35 setLinks("third-column-description", "https://adblockplus.org/acceptable-ads #optout"); | 50 setLinks("third-column-description", "https://adblockplus.org/acceptable-ads #optout"); |
36 } | 51 setLinks("copyright-notice", "https://eyeo.com"); |
37 | 52 |
38 function openFilters() | 53 initMenu(); |
39 { | |
40 browser.runtime.sendMessage({type: "app.open", what: "options"}); | |
41 } | 54 } |
42 | 55 |
43 document.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 56 document.addEventListener("DOMContentLoaded", onDOMLoaded, false); |
44 }()); | 57 }()); |
LEFT | RIGHT |