diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-10-05 17:04:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 17:04:09 +0200 |
commit | d3841b766f9d37d557646003899f67525c5f755f (patch) | |
tree | 1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/erepublik/webview.js | |
parent | chore: repo maintenance (#732) (diff) | |
download | ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip |
chore: add eslint-plugin-unicorn (#733)
Diffstat (limited to 'recipes/erepublik/webview.js')
-rw-r--r-- | recipes/erepublik/webview.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/recipes/erepublik/webview.js b/recipes/erepublik/webview.js index 6a105e1..a47c57d 100644 --- a/recipes/erepublik/webview.js +++ b/recipes/erepublik/webview.js | |||
@@ -4,19 +4,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de | |||
4 | 4 | ||
5 | module.exports = Ferdi => { | 5 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 6 | const getMessages = () => { |
7 | const elementNotify = document.getElementsByClassName('notify'); | 7 | const elementNotify = document.querySelectorAll('.notify'); |
8 | const elementFeed = document.getElementsByClassName('unreadCounter ng-binding ng-scope'); | 8 | const elementFeed = document.querySelectorAll('.unreadCounter.ng-binding.ng-scope'); |
9 | 9 | ||
10 | let countNotify = 0; | 10 | let countNotify = 0; |
11 | let countFeed = 0; | 11 | let countFeed = 0; |
12 | 12 | ||
13 | for (let i = 0; i < elementNotify.length; i++) { | 13 | for (const element of elementNotify) { |
14 | const splitText = elementNotify[i].title.split(':'); | 14 | const splitText = element.title.split(':'); |
15 | countNotify += Ferdi.safeParseInt(splitText[1]); | 15 | countNotify += Ferdi.safeParseInt(splitText[1]); |
16 | } | 16 | } |
17 | 17 | ||
18 | for (let i = 0; i < elementFeed.length; i++) { | 18 | for (const element of elementFeed) { |
19 | countFeed += Ferdi.safeParseInt(elementFeed[i].textContent); | 19 | countFeed += Ferdi.safeParseInt(element.textContent); |
20 | } | 20 | } |
21 | 21 | ||
22 | Ferdi.setBadge(countNotify, countFeed); | 22 | Ferdi.setBadge(countNotify, countFeed); |