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

Side by Side Diff: lib/notificationHelper.js

Issue 29339314: Issue 3870 - Rewrite legacy options page to use async messages (Closed)
Patch Set: Update for adblockplusui changes and work around around a race condition with Downloading... label Created April 7, 2016, 11: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 | « dependencies ('k') | options.js » ('j') | options.js » ('J')
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-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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 ext.pages.open(Utils.getDocLink(activeNotification.links[buttonIndex])); 127 ext.pages.open(Utils.getDocLink(activeNotification.links[buttonIndex]));
128 break; 128 break;
129 case "open-all": 129 case "open-all":
130 openNotificationLinks(); 130 openNotificationLinks();
131 break; 131 break;
132 case "configure": 132 case "configure":
133 Prefs.notifications_showui = true; 133 Prefs.notifications_showui = true;
134 ext.showOptions(function(page) 134 ext.showOptions(function(page)
135 { 135 {
136 page.sendMessage({ 136 page.sendMessage({
137 type: "focus-section", 137 type: "app.respond",
138 section: "notifications" 138 action: "focusSection",
139 args: ["notifications"]
139 }); 140 });
140 }); 141 });
141 break; 142 break;
142 case "question": 143 case "question":
143 NotificationStorage.triggerQuestionListeners(activeNotification.id, button Index == 0); 144 NotificationStorage.triggerQuestionListeners(activeNotification.id, button Index == 0);
144 NotificationStorage.markAsShown(activeNotification.id); 145 NotificationStorage.markAsShown(activeNotification.id);
145 activeNotification.onClicked(); 146 activeNotification.onClicked();
146 break; 147 break;
147 } 148 }
148 } 149 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 let methods = displayMethods[notificationType] || defaultDisplayMethods; 271 let methods = displayMethods[notificationType] || defaultDisplayMethods;
271 return methods.indexOf(method) > -1; 272 return methods.indexOf(method) > -1;
272 }; 273 };
273 274
274 ext.pages.onLoading.addListener(page => 275 ext.pages.onLoading.addListener(page =>
275 { 276 {
276 NotificationStorage.showNext(stringifyURL(page.url)); 277 NotificationStorage.showNext(stringifyURL(page.url));
277 }); 278 });
278 279
279 NotificationStorage.addShowListener(showNotification); 280 NotificationStorage.addShowListener(showNotification);
OLDNEW
« no previous file with comments | « dependencies ('k') | options.js » ('j') | options.js » ('J')

Powered by Google App Engine
This is Rietveld