diff options
Diffstat (limited to 'recipes/erepublik')
-rw-r--r-- | recipes/erepublik/webview.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/recipes/erepublik/webview.js b/recipes/erepublik/webview.js index ca55df3..ebd3743 100644 --- a/recipes/erepublik/webview.js +++ b/recipes/erepublik/webview.js | |||
@@ -1,6 +1,4 @@ | |||
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 }; |
@@ -8,7 +6,6 @@ function _interopRequireDefault(obj) { | |||
8 | 6 | ||
9 | module.exports = Ferdi => { | 7 | module.exports = Ferdi => { |
10 | const getMessages = function getMessages() { | 8 | const getMessages = function getMessages() { |
11 | |||
12 | const elementNotify = document.getElementsByClassName('notify'); | 9 | const elementNotify = document.getElementsByClassName('notify'); |
13 | const elementFeed = document.getElementsByClassName('unreadCounter ng-binding ng-scope'); | 10 | const elementFeed = document.getElementsByClassName('unreadCounter ng-binding ng-scope'); |
14 | 11 | ||
@@ -16,17 +13,17 @@ module.exports = Ferdi => { | |||
16 | let countFeed = 0; | 13 | let countFeed = 0; |
17 | 14 | ||
18 | for (let i = 0; i < elementNotify.length; i++) { | 15 | for (let i = 0; i < elementNotify.length; i++) { |
19 | let splitText = elementNotify[i].title.split(':'); | 16 | const splitText = elementNotify[i].title.split(':'); |
20 | let badgeNumber = parseInt(splitText[1], 10); | 17 | const badgeNumber = parseInt(splitText[1], 10); |
21 | if (badgeNumber) { | 18 | if (badgeNumber) { |
22 | countNotify = countNotify + badgeNumber; | 19 | countNotify += badgeNumber; |
23 | } | 20 | } |
24 | } | 21 | } |
25 | 22 | ||
26 | for (let i = 0; i < elementFeed.length; i++) { | 23 | for (let i = 0; i < elementFeed.length; i++) { |
27 | let feedNumber = parseInt(elementFeed[i].textContent, 10); | 24 | const feedNumber = parseInt(elementFeed[i].textContent, 10); |
28 | if (feedNumber) { | 25 | if (feedNumber) { |
29 | countFeed = countFeed + feedNumber; | 26 | countFeed += feedNumber; |
30 | } | 27 | } |
31 | } | 28 | } |
32 | 29 | ||
@@ -34,7 +31,6 @@ module.exports = Ferdi => { | |||
34 | Ferdi.setBadge(countNotify, countFeed); | 31 | Ferdi.setBadge(countNotify, countFeed); |
35 | }; | 32 | }; |
36 | 33 | ||
37 | |||
38 | Ferdi.loop(getMessages); | 34 | Ferdi.loop(getMessages); |
39 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | 35 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); |
40 | Ferdi.injectCSS(_path.default.join(__dirname, 'crpk-resources/fonts.css')); | 36 | Ferdi.injectCSS(_path.default.join(__dirname, 'crpk-resources/fonts.css')); |