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

Delta Between Two Patch Sets: lib/notificationHelper.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Left Patch Set: Use const as per the new rules Created Jan. 18, 2017, 7:23 a.m.
Right Patch Set: Addressed some more feedback Created Jan. 18, 2017, 11:44 a.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
« no previous file with change/comment | « lib/messaging.js ('k') | lib/popupBlocker.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-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
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 type: "question", 57 type: "question",
58 title: ext.i18n.getMessage("overlay_notification_button_yes") 58 title: ext.i18n.getMessage("overlay_notification_button_yes")
59 }); 59 });
60 buttons.push({ 60 buttons.push({
61 type: "question", 61 type: "question",
62 title: ext.i18n.getMessage("overlay_notification_button_no") 62 title: ext.i18n.getMessage("overlay_notification_button_no")
63 }); 63 });
64 } 64 }
65 else 65 else
66 { 66 {
67 const regex = /<a>(.*?)<\/a>/g; 67 let regex = /<a>(.*?)<\/a>/g;
68 let match; 68 let match;
69 while (match = regex.exec(message)) 69 while (match = regex.exec(message))
70 { 70 {
71 buttons.push({ 71 buttons.push({
72 type: "link", 72 type: "link",
73 title: match[1] 73 title: match[1]
74 }); 74 });
75 } 75 }
76 76
77 // Chrome only allows two notification buttons so we need to fall back 77 // Chrome only allows two notification buttons so we need to fall back
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 let methods = displayMethods[notificationType] || defaultDisplayMethods; 259 let methods = displayMethods[notificationType] || defaultDisplayMethods;
260 return methods.indexOf(method) > -1; 260 return methods.indexOf(method) > -1;
261 }; 261 };
262 262
263 ext.pages.onLoading.addListener(page => 263 ext.pages.onLoading.addListener(page =>
264 { 264 {
265 NotificationStorage.showNext(stringifyURL(page.url)); 265 NotificationStorage.showNext(stringifyURL(page.url));
266 }); 266 });
267 267
268 NotificationStorage.addShowListener(showNotification); 268 NotificationStorage.addShowListener(showNotification);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld