| Index: lib/notificationHelper.js |
| diff --git a/lib/notificationHelper.js b/lib/notificationHelper.js |
| index 8c5485835e926436c7c93e7fac0f18d79b2166cd..d0a56b4b78ea84469d6efaf77a1e1d8514c22df4 100644 |
| --- a/lib/notificationHelper.js |
| +++ b/lib/notificationHelper.js |
| @@ -17,6 +17,8 @@ |
| /** @module notificationHelper */ |
| +"use strict"; |
| + |
| let {startIconAnimation, stopIconAnimation} = require("icon"); |
| let {Utils} = require("utils"); |
| let {Notification: NotificationStorage} = require("notification"); |
| @@ -38,7 +40,7 @@ let canUseChromeNotifications = typeof chrome != "undefined" && "notifications" |
| function prepareNotificationIconAndPopup() |
| { |
| let animateIcon = shouldDisplay("icon", activeNotification.type); |
| - activeNotification.onClicked = function() |
| + activeNotification.onClicked = () => |
| { |
| if (animateIcon) |
| stopIconAnimation(); |
| @@ -122,7 +124,7 @@ function notificationButtonClick(buttonIndex) |
| break; |
| case "configure": |
| Prefs.notifications_showui = true; |
| - ext.showOptions(function(page) |
| + ext.showOptions(page => |
| { |
| page.sendMessage({ |
| type: "app.respond", |
| @@ -152,14 +154,14 @@ function initChromeNotifications() |
| if (activeNotification && activeNotification.type != "question" && !("links" in activeNotification)) |
| return; |
| - chrome.notifications.clear(notificationId, function(wasCleared) |
| + chrome.notifications.clear(notificationId, wasCleared => |
| { |
| if (wasCleared) |
| notificationClosed(); |
| }); |
| } |
| - chrome.notifications.onButtonClicked.addListener(function(notificationId, buttonIndex) |
| + chrome.notifications.onButtonClicked.addListener((notificationId, buttonIndex) => |
| { |
| notificationButtonClick(buttonIndex); |
| clearActiveNotification(notificationId); |
| @@ -231,7 +233,7 @@ function showNotification(notification) |
| /** |
| * Initializes the notification system. |
| */ |
| -exports.initNotifications = function() |
| +exports.initNotifications = () => |
| { |
| if (canUseChromeNotifications) |
| initChromeNotifications(); |
| @@ -243,10 +245,7 @@ exports.initNotifications = function() |
| * |
| * @return {?object} |
| */ |
| -exports.getActiveNotification = function() |
| -{ |
| - return activeNotification; |
| -}; |
| +exports.getActiveNotification = () => activeNotification; |
| let shouldDisplay = |
| /** |
| @@ -257,7 +256,7 @@ let shouldDisplay = |
| * @param {string} notificationType |
| * @return {boolean} |
| */ |
| -exports.shouldDisplay = function(method, notificationType) |
| +exports.shouldDisplay = (method, notificationType) => |
| { |
| let methods = displayMethods[notificationType] || defaultDisplayMethods; |
| return methods.indexOf(method) > -1; |