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

Unified Diff: lib/icon.js

Issue 29715577: Issue 6449 - Switch to Harmony modules (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Add lib/.eslintrc.json Created March 6, 2018, 10:30 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
Index: lib/icon.js
===================================================================
--- a/lib/icon.js
+++ b/lib/icon.js
@@ -12,19 +12,17 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
/** @module icon */
-"use strict";
-
-const {FilterNotifier} = require("filterNotifier");
+import {FilterNotifier} from "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 numberOfFrames = frameOpacities.length;
let stopRequested = false;
let canUpdateIcon = true;
@@ -178,42 +176,41 @@
clearInterval(interval);
ext.pages.onActivated.removeListener(onActivated);
canUpdateIcon = true;
}
}, 100);
});
}
-let stopIconAnimation =
/**
* Stops to animate the browser action icon
* after the current interval has been finished.
*
* @return {Promise} A promise that is fullfilled when
* the icon animation has been stopped.
*/
-exports.stopIconAnimation = () =>
+export const stopIconAnimation = () =>
{
stopRequested = true;
return notRunning.then(() =>
{
stopRequested = false;
});
};
/**
* Starts to animate the browser action icon to indicate a pending notifcation.
* 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".)
*/
-exports.startIconAnimation = type =>
+export const startIconAnimation = type =>
{
notRunning = new Promise(resolve =>
{
Promise.all([renderFrames(type), stopIconAnimation()]).then(results =>
{
if (stopRequested)
{
resolve();
« lib/.eslintrc.json ('K') | « lib/firefoxDataCleanup.js ('k') | lib/io.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld