| Index: lib/icon.js |
| =================================================================== |
| --- a/lib/icon.js |
| +++ b/lib/icon.js |
| @@ -1,6 +1,6 @@ |
| /* |
| * This file is part of Adblock Plus <https://adblockplus.org/>, |
| - * Copyright (C) 2006-2016 Eyeo GmbH |
| + * Copyright (C) 2006-2017 eyeo GmbH |
| * |
| * Adblock Plus is free software: you can redistribute it and/or modify |
| * it under the terms of the GNU General Public License version 3 as |
| @@ -21,9 +21,9 @@ |
| const {FilterNotifier} = require("filterNotifier"); |
| -const frameOpacities = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, |
| - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| - 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.0]; |
| +const frameOpacities = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, |
| + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| + 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.0]; |
| const numberOfFrames = frameOpacities.length; |
| let stopRequested = false; |
| @@ -46,7 +46,7 @@ |
| reject("Failed to load image " + url); |
| }); |
| }); |
| -}; |
| +} |
| function setIcon(page, notificationType, opacity, frames) |
| { |
| @@ -56,11 +56,15 @@ |
| if (!notificationType || !frames) |
| { |
| if (opacity > 0.5) |
| - page.browserAction.setIcon("icons/abp-$size-notification-" |
| - + notificationType + ".png"); |
| + { |
| + page.browserAction.setIcon("/icons/abp-$size-notification-" + |
| + notificationType + ".png"); |
| + } |
| else |
| - page.browserAction.setIcon("icons/abp-$size" + |
| + { |
| + page.browserAction.setIcon("/icons/abp-$size" + |
| (whitelisted ? "-whitelisted" : "") + ".png"); |
| + } |
| } |
| else |
| { |
| @@ -102,12 +106,12 @@ |
| ]).then(images => |
| { |
| let imageMap = { |
| - 16: { base: [images[0], images[1]], overlay: images[2] }, |
| - 19: { base: [images[3], images[4]], overlay: images[5] }, |
| - 20: { base: [images[6], images[7]], overlay: images[8] }, |
| - 32: { base: [images[9], images[10]], overlay: images[11] }, |
| - 38: { base: [images[12], images[13]], overlay: images[14] }, |
| - 40: { base: [images[15], images[16]], overlay: images[17] } |
| + 16: {base: [images[0], images[1]], overlay: images[2]}, |
| + 19: {base: [images[3], images[4]], overlay: images[5]}, |
| + 20: {base: [images[6], images[7]], overlay: images[8]}, |
| + 32: {base: [images[9], images[10]], overlay: images[11]}, |
| + 38: {base: [images[12], images[13]], overlay: images[14]}, |
| + 40: {base: [images[15], images[16]], overlay: images[17]} |
| }; |
| let frames = {}; |
| @@ -199,7 +203,8 @@ |
| * If the icon is already animated, it replaces the previous |
| * animation as soon as the current interval has been finished. |
| * |
| - * @param {string} type The notification type (i.e: "information" or "critical") |
| + * @param {string} type The notification type (i.e: "information" or |
| + * "critical".) |
| */ |
| exports.startIconAnimation = type => |
| { |