| Index: lib/notification.js |
| =================================================================== |
| --- a/lib/notification.js |
| +++ b/lib/notification.js |
| @@ -123,17 +123,17 @@ let Notification = exports.Notification |
| saveNotificationData(); |
| }, |
| _onDownloadSuccess: function(downloadable, responseText, errorCallback, redirectCallback) |
| { |
| try |
| { |
| let data = JSON.parse(responseText); |
| - for each (let notification in data.notifications) |
| + for (let notification of data.notifications) |
| { |
| if ("severity" in notification) |
| { |
| if (!("type" in notification)) |
| notification.type = notification.severity; |
| delete notification.severity; |
| } |
| } |
| @@ -186,40 +186,40 @@ let Notification = exports.Notification |
| } |
| let notifications = localData.concat(remoteData); |
| if (notifications.length === 0) |
| return null; |
| let {addonName, addonVersion, application, applicationVersion, platform, platformVersion} = require("info"); |
| let notificationToShow = null; |
| - for each (let notification in notifications) |
| + for (let notification of notifications) |
| { |
| if ((typeof notification.type === "undefined" || notification.type !== "critical") |
| && Prefs.notificationdata.shown.indexOf(notification.id) !== -1) |
| continue; |
| if (typeof url === "string" || notification.urlFilters instanceof Array) |
| { |
| if (typeof url === "string" && notification.urlFilters instanceof Array) |
| { |
| let matcher = new Matcher(); |
| - for each (let urlFilter in notification.urlFilters) |
| + for (let urlFilter of notification.urlFilters) |
| matcher.add(Filter.fromText(urlFilter)); |
| if (!matcher.matchesAny(url, "DOCUMENT", url)) |
| continue; |
| } |
| else |
| continue; |
| } |
| if (notification.targets instanceof Array) |
| { |
| let match = false; |
| - for each (let target in notification.targets) |
| + for (let target of notification.targets) |
| { |
| if (checkTarget(target, "extension", addonName, addonVersion) && |
| checkTarget(target, "application", application, applicationVersion) && |
| checkTarget(target, "platform", platform, platformVersion)) |
| { |
| match = true; |
| break; |
| } |
| @@ -258,17 +258,17 @@ let Notification = exports.Notification |
| * application locale) |
| * @return {Object} the translated texts |
| */ |
| getLocalizedTexts: function(notification, locale) |
| { |
| locale = locale || Utils.appLocale; |
| let textKeys = ["title", "message"]; |
| let localizedTexts = []; |
| - for each (let key in textKeys) |
| + for (let key of textKeys) |
| { |
| if (key in notification) |
| { |
| if (typeof notification[key] == "string") |
| localizedTexts[key] = notification[key]; |
| else |
| localizedTexts[key] = localize(notification[key], locale); |
| } |
| @@ -327,13 +327,13 @@ let Notification = exports.Notification |
| * @param {String} id notification ID |
| * @param {Boolean} approved indicator whether notification has been approved or not |
| */ |
| triggerQuestionListeners: function(id, approved) |
| { |
| if (!(id in listeners)) |
| return; |
| let questionListeners = listeners[id]; |
| - for each (let listener in questionListeners) |
| + for (let listener of questionListeners) |
| listener(approved); |
| } |
| }; |
| Notification.init(); |