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

Side by Side Diff: stats.js

Issue 29567798: Noissue - Replace ext.pages.open with tabs.create (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Oct. 6, 2017, 3:16 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
« no previous file with comments | « notification.js ('k') | no next file » | 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
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 /* global i18n, getPref, togglePref */ 18 /* global i18n, getPref, togglePref */
19 19
20 "use strict"; 20 "use strict";
21 21
22 (function() 22 (function()
23 { 23 {
24 const {require} = ext.backgroundPage.getWindow();
25
26 const {FilterNotifier} = require("filterNotifier"); 24 const {FilterNotifier} = require("filterNotifier");
27 25
28 let currentTab; 26 let currentTab;
29 const shareURL = "https://adblockplus.org/"; 27 const shareURL = "https://adblockplus.org/";
30 28
31 let messageMark = {}; 29 let messageMark = {};
32 let shareLinks = { 30 let shareLinks = {
33 facebook: ["https://www.facebook.com/dialog/feed", { 31 facebook: ["https://www.facebook.com/dialog/feed", {
34 app_id: "475542399197328", 32 app_id: "475542399197328",
35 link: shareURL, 33 link: shareURL,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 function share(ev) 124 function share(ev)
127 { 125 {
128 getPref("blocked_total", blockedTotal => 126 getPref("blocked_total", blockedTotal =>
129 { 127 {
130 // Easter Egg 128 // Easter Egg
131 if (blockedTotal <= 9000 || blockedTotal >= 10000) 129 if (blockedTotal <= 9000 || blockedTotal >= 10000)
132 blockedTotal = blockedTotal.toLocaleString(); 130 blockedTotal = blockedTotal.toLocaleString();
133 else 131 else
134 blockedTotal = i18n.getMessage("stats_over", (9000).toLocaleString()); 132 blockedTotal = i18n.getMessage("stats_over", (9000).toLocaleString());
135 133
136 ext.pages.open(createShareLink(ev.target.dataset.social, blockedTotal)); 134 chrome.tabs.create({
135 url: createShareLink(ev.target.dataset.social, blockedTotal)
136 });
137 }); 137 });
138 } 138 }
139 139
140 function toggleIconNumber() 140 function toggleIconNumber()
141 { 141 {
142 togglePref("show_statsinicon", showStatsInIcon => 142 togglePref("show_statsinicon", showStatsInIcon =>
143 { 143 {
144 document.getElementById("show-iconnumber").setAttribute( 144 document.getElementById("show-iconnumber").setAttribute(
145 "aria-checked", showStatsInIcon 145 "aria-checked", showStatsInIcon
146 ); 146 );
147 }); 147 });
148 } 148 }
149 149
150 document.addEventListener("DOMContentLoaded", onLoad, false); 150 document.addEventListener("DOMContentLoaded", onLoad, false);
151 window.addEventListener("unload", onUnload, false); 151 window.addEventListener("unload", onUnload, false);
152 }()); 152 }());
OLDNEW
« no previous file with comments | « notification.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld