diff options
Diffstat (limited to 'recipes/bip')
-rw-r--r-- | recipes/bip/webview.js | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/recipes/bip/webview.js b/recipes/bip/webview.js index d242716..e9e956b 100644 --- a/recipes/bip/webview.js +++ b/recipes/bip/webview.js | |||
@@ -1,22 +1,20 @@ | |||
1 | "use strict"; | 1 | const _path = _interopRequireDefault(require('path')); |
2 | |||
3 | var _path = _interopRequireDefault(require("path")); | ||
4 | 2 | ||
5 | function _interopRequireDefault(obj) { | 3 | function _interopRequireDefault(obj) { |
6 | return obj && obj.__esModule ? obj : {default: obj}; | 4 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 5 | } |
8 | 6 | ||
9 | module.exports = Ferdi => { | 7 | module.exports = Ferdi => { |
10 | const getMessages = function getMessages() { | 8 | const getMessages = function getMessages() { |
11 | var elements = document.querySelectorAll(".contact-list__message__unread-badge-counter"); | 9 | const elements = document.querySelectorAll('.contact-list__message__unread-badge-counter'); |
12 | var count = 0; | 10 | let count = 0; |
13 | for (var i = 0; i < elements.length; i++) { | 11 | for (let i = 0; i < elements.length; i++) { |
14 | var countValue = parseInt(elements[i].textContent || '0', 10); | 12 | const countValue = parseInt(elements[i].textContent || '0', 10); |
15 | count += countValue; | 13 | count += countValue; |
16 | } | 14 | } |
17 | Ferdi.setBadge(count, 0); | 15 | Ferdi.setBadge(count, 0); |
18 | }; | 16 | }; |
19 | 17 | ||
20 | Ferdi.loop(getMessages); | 18 | Ferdi.loop(getMessages); |
21 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | 19 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); |
22 | }; | 20 | }; |