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

Side by Side Diff: chrome/content/ui/sendReport.js

Issue 4884233277407232: Issue 2257 - Replaced non-standard function expressions with ES6 arrow functions (Closed)
Patch Set: Rebased Created May 6, 2015, 10:46 a.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 | « chrome/content/ui/flasher.js ('k') | chrome/content/ui/sidebar.js » ('j') | 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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 let wndStats = RequestNotifier.getWindowStatistics(wnd); 256 let wndStats = RequestNotifier.getWindowStatistics(wnd);
257 if (wndStats) 257 if (wndStats)
258 { 258 {
259 let filters = reportElement("filters"); 259 let filters = reportElement("filters");
260 for (let f in wndStats.filters) 260 for (let f in wndStats.filters)
261 { 261 {
262 let filter = Filter.fromText(f) 262 let filter = Filter.fromText(f)
263 let hitCount = wndStats.filters[f]; 263 let hitCount = wndStats.filters[f];
264 appendElement(filters, "filter", { 264 appendElement(filters, "filter", {
265 text: filter.text, 265 text: filter.text,
266 subscriptions: filter.subscriptions.filter(subscriptionsDataSource.sub scriptionFilter).map(function(s) s.url).join(" "), 266 subscriptions: filter.subscriptions.filter(subscriptionsDataSource.sub scriptionFilter).map(s => s.url).join(" "),
267 hitCount: hitCount 267 hitCount: hitCount
268 }); 268 });
269 this.origFilters.push(filter); 269 this.origFilters.push(filter);
270 } 270 }
271 } 271 }
272 callback(); 272 callback();
273 } 273 }
274 }; 274 };
275 275
276 let subscriptionsDataSource = 276 let subscriptionsDataSource =
(...skipping 12 matching lines...) Expand all
289 let subscriptions = reportElement("subscriptions"); 289 let subscriptions = reportElement("subscriptions");
290 let now = Math.round(Date.now() / 1000); 290 let now = Math.round(Date.now() / 1000);
291 for (let i = 0; i < FilterStorage.subscriptions.length; i++) 291 for (let i = 0; i < FilterStorage.subscriptions.length; i++)
292 { 292 {
293 let subscription = FilterStorage.subscriptions[i]; 293 let subscription = FilterStorage.subscriptions[i];
294 if (!this.subscriptionFilter(subscription)) 294 if (!this.subscriptionFilter(subscription))
295 continue; 295 continue;
296 296
297 let subscriptionXML = appendElement(subscriptions, "subscription", { 297 let subscriptionXML = appendElement(subscriptions, "subscription", {
298 id: subscription.url, 298 id: subscription.url,
299 disabledFilters: subscription.filters.filter(function(filter) filter ins tanceof ActiveFilter && filter.disabled).length 299 disabledFilters: subscription.filters.filter(filter => filter instanceof ActiveFilter && filter.disabled).length
300 }); 300 });
301 if (subscription.version) 301 if (subscription.version)
302 subscriptionXML.setAttribute("version", subscription.version); 302 subscriptionXML.setAttribute("version", subscription.version);
303 if (subscription.lastDownload) 303 if (subscription.lastDownload)
304 subscriptionXML.setAttribute("lastDownloadAttempt", subscription.lastDow nload - now); 304 subscriptionXML.setAttribute("lastDownloadAttempt", subscription.lastDow nload - now);
305 if (subscription instanceof DownloadableSubscription) 305 if (subscription instanceof DownloadableSubscription)
306 { 306 {
307 if (subscription.lastSuccess) 307 if (subscription.lastSuccess)
308 subscriptionXML.setAttribute("lastDownloadSuccess", subscription.lastS uccess - now); 308 subscriptionXML.setAttribute("lastDownloadSuccess", subscription.lastS uccess - now);
309 if (subscription.softExpiration) 309 if (subscription.softExpiration)
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 for (let i = 0; i < this.needUpdate.length; i++) 811 for (let i = 0; i < this.needUpdate.length; i++)
812 if (Synchronizer.isExecuting(this.needUpdate[i].url)) 812 if (Synchronizer.isExecuting(this.needUpdate[i].url))
813 return; 813 return;
814 814
815 FilterNotifier.removeListener(listener); 815 FilterNotifier.removeListener(listener);
816 E("updateInProgress").hidden = "true"; 816 E("updateInProgress").hidden = "true";
817 817
818 let filtersRemoved = false; 818 let filtersRemoved = false;
819 let requests = requestsDataSource.origRequests; 819 let requests = requestsDataSource.origRequests;
820 for (let i = 0; i < requests.length; i++) 820 for (let i = 0; i < requests.length; i++)
821 if (requests[i].filter && !requests[i].filter.subscriptions.filter(fun ction(s) !s.disabled).length) 821 if (requests[i].filter && !requests[i].filter.subscriptions.filter(s = > !s.disabled).length)
822 filtersRemoved = true; 822 filtersRemoved = true;
823 823
824 if (filtersRemoved) 824 if (filtersRemoved)
825 { 825 {
826 // Force the user to reload the page 826 // Force the user to reload the page
827 E("updateFixedIssue").hidden = false; 827 E("updateFixedIssue").hidden = false;
828 document.documentElement.canAdvance = true; 828 document.documentElement.canAdvance = true;
829 829
830 let nextButton = document.documentElement.getButton("next"); 830 let nextButton = document.documentElement.getButton("next");
831 [nextButton.label, nextButton.accessKey] = Utils.splitLabel(E("updateP age").getAttribute("reloadButtonLabel")); 831 [nextButton.label, nextButton.accessKey] = Utils.splitLabel(E("updateP age").getAttribute("reloadButtonLabel"));
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 } 963 }
964 964
965 this.numSubscriptions = FilterStorage.subscriptions.filter(this.subscripti onFilter).length; 965 this.numSubscriptions = FilterStorage.subscriptions.filter(this.subscripti onFilter).length;
966 this.numAppliedFilters = 0; 966 this.numAppliedFilters = 0;
967 for (let filter of filtersDataSource.origFilters) 967 for (let filter of filtersDataSource.origFilters)
968 { 968 {
969 if (filter instanceof WhitelistFilter) 969 if (filter instanceof WhitelistFilter)
970 continue; 970 continue;
971 971
972 this.numAppliedFilters++; 972 this.numAppliedFilters++;
973 if (filter.subscriptions.some(function(subscription) subscription instan ceof SpecialSubscription)) 973 if (filter.subscriptions.some(subscription => subscription instanceof Sp ecialSubscription))
974 this.ownFilters.push(filter); 974 this.ownFilters.push(filter);
975 } 975 }
976 } 976 }
977 977
978 callback(); 978 callback();
979 }, 979 },
980 980
981 updateIssues: function(type) 981 updateIssues: function(type)
982 { 982 {
983 if (type == "other") 983 if (type == "other")
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 1574
1575 function censorURL(url) 1575 function censorURL(url)
1576 { 1576 {
1577 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); 1577 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*");
1578 } 1578 }
1579 1579
1580 function encodeHTML(str) 1580 function encodeHTML(str)
1581 { 1581 {
1582 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;"); 1582 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;");
1583 } 1583 }
OLDNEW
« no previous file with comments | « chrome/content/ui/flasher.js ('k') | chrome/content/ui/sidebar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld