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

Delta Between Two Patch Sets: firstRun.js

Issue 29565721: No Issue - Implemented first run page Base URL: https://hg.adblockplus.org/adblockplusui/
Left Patch Set: Created Oct. 5, 2017, 1:47 p.m.
Right Patch Set: Addressed latest round of feedback Created Jan. 30, 2018, 2:06 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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
27 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
28 42
29 optionsTrigger.addEventListener("click", (e) => 43 optionsTrigger.addEventListener("click", (e) =>
30 { 44 {
31 e.preventDefault(); 45 e.preventDefault();
32 openFilters(); 46 openFilters();
33 }) 47 });
34 48
35 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
36 setLinks("third-column-description", "https://adblockplus.org/acceptable-ads #optout"); 50 setLinks("third-column-description", "https://adblockplus.org/acceptable-ads #optout");
51 setLinks("copyright-notice", "https://eyeo.com");
37 52
38 } 53 initMenu();
39
40 function openFilters()
41 {
42 ext.backgroundPage.sendMessage({type: "app.open", what: "options"});
43 } 54 }
44 55
45 document.addEventListener("DOMContentLoaded", onDOMLoaded, false); 56 document.addEventListener("DOMContentLoaded", onDOMLoaded, false);
46 }()); 57 }());
LEFTRIGHT

Powered by Google App Engine
This is Rietveld