Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 clearInterval(fadeInInterval); | 81 clearInterval(fadeInInterval); |
82 }, 100); | 82 }, 100); |
83 }); | 83 }); |
84 }, 15000); | 84 }, 15000); |
85 } | 85 } |
86 | 86 |
87 /** | 87 /** |
88 * Set the browser action icon for the given page, indicating whether | 88 * Set the browser action icon for the given page, indicating whether |
89 * adblocking is active there, and considering the icon animation. | 89 * adblocking is active there, and considering the icon animation. |
90 * | 90 * |
91 * @param {Page} [page] The page to set the browser action icon for | 91 * @param {Page} page The page to set the browser action icon for |
92 * @param {Boolean} [whitelisted] Whether the page has been whitelisted | 92 * @param {Boolean} whitelisted Whether the page has been whitelisted |
93 */ | 93 */ |
94 function updateIcon(page, whitelisted) | 94 function updateIcon(page, whitelisted) |
95 { | 95 { |
96 page.browserAction.setIcon(getIconPath(whitelisted)); | 96 page.browserAction.setIcon(getIconPath(whitelisted)); |
97 whitelistedState.set(page, whitelisted); | 97 whitelistedState.set(page, whitelisted); |
98 } | 98 } |
99 exports.updateIcon = updateIcon; | 99 exports.updateIcon = updateIcon; |
100 | 100 |
101 /** | 101 /** |
102 * Starts to animate the browser action icon to indicate a pending notifcation. | 102 * Starts to animate the browser action icon to indicate a pending notifcation. |
103 * | 103 * |
104 * @param {string} [type] The notifaction type (i.e: "information" or "critical" ) | 104 * @param {string} type The notifaction type (i.e: "information" or "critical") |
kzar
2015/03/02 17:09:21
Nit: "notifaction" looks like a typo.
Sebastian Noack
2015/03/02 17:21:38
Well, this typo isn't matter of this change. But f
| |
105 */ | 105 */ |
106 function startIconAnimation(type) | 106 function startIconAnimation(type) |
107 { | 107 { |
108 notificationType = type; | 108 notificationType = type; |
109 | 109 |
110 if (animationInterval == null) | 110 if (animationInterval == null) |
111 animationInterval = runAnimation(); | 111 animationInterval = runAnimation(); |
112 } | 112 } |
113 exports.startIconAnimation = startIconAnimation; | 113 exports.startIconAnimation = startIconAnimation; |
114 | 114 |
115 /** | 115 /** |
116 * Stops to animate the browser action icon. | 116 * Stops to animate the browser action icon. |
117 */ | 117 */ |
118 function stopIconAnimation() | 118 function stopIconAnimation() |
119 { | 119 { |
120 if (animationInterval != null) | 120 if (animationInterval != null) |
121 { | 121 { |
122 clearInterval(animationInterval); | 122 clearInterval(animationInterval); |
123 animationInterval = null; | 123 animationInterval = null; |
124 } | 124 } |
125 | 125 |
126 notificationType = null; | 126 notificationType = null; |
127 } | 127 } |
128 exports.stopIconAnimation = stopIconAnimation; | 128 exports.stopIconAnimation = stopIconAnimation; |
OLD | NEW |