| OLD | NEW |
| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 { | 114 { |
| 115 if (activeNotification.links) | 115 if (activeNotification.links) |
| 116 { | 116 { |
| 117 for (let link of activeNotification.links) | 117 for (let link of activeNotification.links) |
| 118 ext.pages.open(Utils.getDocLink(link)); | 118 ext.pages.open(Utils.getDocLink(link)); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 function notificationButtonClick(buttonIndex) | 122 function notificationButtonClick(buttonIndex) |
| 123 { | 123 { |
| 124 if (!(activeButtons && buttonIndex in activeButtons)) |
| 125 return; |
| 126 |
| 124 switch (activeButtons[buttonIndex].type) | 127 switch (activeButtons[buttonIndex].type) |
| 125 { | 128 { |
| 126 case "link": | 129 case "link": |
| 127 ext.pages.open(Utils.getDocLink(activeNotification.links[buttonIndex])); | 130 ext.pages.open(Utils.getDocLink(activeNotification.links[buttonIndex])); |
| 128 break; | 131 break; |
| 129 case "open-all": | 132 case "open-all": |
| 130 openNotificationLinks(); | 133 openNotificationLinks(); |
| 131 break; | 134 break; |
| 132 case "configure": | 135 case "configure": |
| 133 Prefs.notifications_showui = true; | 136 Prefs.notifications_showui = true; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 let methods = displayMethods[notificationType] || defaultDisplayMethods; | 274 let methods = displayMethods[notificationType] || defaultDisplayMethods; |
| 272 return methods.indexOf(method) > -1; | 275 return methods.indexOf(method) > -1; |
| 273 }; | 276 }; |
| 274 | 277 |
| 275 ext.pages.onLoading.addListener(page => | 278 ext.pages.onLoading.addListener(page => |
| 276 { | 279 { |
| 277 NotificationStorage.showNext(stringifyURL(page.url)); | 280 NotificationStorage.showNext(stringifyURL(page.url)); |
| 278 }); | 281 }); |
| 279 | 282 |
| 280 NotificationStorage.addShowListener(showNotification); | 283 NotificationStorage.addShowListener(showNotification); |
| OLD | NEW |