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: Rebased Created March 17, 2017, 12:41 p.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 c7590fce9c8f4bef26cbb7ab428a58b7ee97afed..886198d68fbeabf08f98329fc6ed59d226ac5614 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