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

Unified Diff: lib/icon.js

Issue 29374674: Issue 4864 - Start using ESLint for adblockpluschrome (Closed)
Patch Set: Use .includes again Created March 31, 2017, 8:37 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/filterValidation.js ('k') | lib/io.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/icon.js
diff --git a/lib/icon.js b/lib/icon.js
index aacfd8ba66f6ba177dbd72fef7cbfef75e093174..d31175c4c9e9208266e1acf11ab2554409244e96 100644
--- a/lib/icon.js
+++ b/lib/icon.js
@@ -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 @@ function loadImage(url)
reject("Failed to load image " + url);
});
});
-};
+}
function setIcon(page, notificationType, opacity, frames)
{
@@ -56,11 +56,15 @@ function setIcon(page, notificationType, opacity, frames)
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" +
(whitelisted ? "-whitelisted" : "") + ".png");
+ }
}
else
{
@@ -102,12 +106,12 @@ function renderFrames(notificationType)
]).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 @@ exports.stopIconAnimation = () =>
* 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 =>
{
« no previous file with comments | « lib/filterValidation.js ('k') | lib/io.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld