diff options
author | 2021-07-31 15:28:23 +0530 | |
---|---|---|
committer | 2021-07-31 15:28:23 +0530 | |
commit | 97697e3d069972844b2912a93022f4a4904a40d6 (patch) | |
tree | 53faff30fbac9d72042f593dfe1c547809f4f121 /recipes/telegram/webview.js | |
parent | Allow any url in the custom-service to allow for sites like 'http://translate... (diff) | |
download | ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.gz ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.zst ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.zip |
Fixed eslintrc as root for this folder; Reformatted all files.
Diffstat (limited to 'recipes/telegram/webview.js')
-rw-r--r-- | recipes/telegram/webview.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/recipes/telegram/webview.js b/recipes/telegram/webview.js index a8c2ddd..8da63d1 100644 --- a/recipes/telegram/webview.js +++ b/recipes/telegram/webview.js | |||
@@ -1,21 +1,18 @@ | |||
1 | // Code copied from: https://gitlab.com/gortega4/ferdi_recipes | 1 | // Code copied from: https://gitlab.com/gortega4/ferdi_recipes |
2 | 2 | ||
3 | 'use strict'; | ||
4 | |||
5 | const path = require('path'); | 3 | const path = require('path'); |
6 | 4 | ||
7 | module.exports = Franz => { | 5 | module.exports = Franz => { |
8 | const getMessages = function getMessages() { | 6 | const getMessages = function getMessages() { |
9 | let count = 0; | 7 | let count = 0; |
10 | let count_sec = 0 | 8 | let count_sec = 0; |
11 | const elements = document.querySelectorAll('.rp'); | 9 | const elements = document.querySelectorAll('.rp'); |
12 | for (let i = 0; i < elements.length; i += 1) { | 10 | for (let i = 0; i < elements.length; i += 1) { |
13 | if (elements[i].querySelector('.dialog-subtitle-badge') && (!isNaN(parseInt(elements[i].querySelector('.dialog-subtitle-badge').innerText)) )) { | 11 | if (elements[i].querySelector('.dialog-subtitle-badge') && (!isNaN(parseInt(elements[i].querySelector('.dialog-subtitle-badge').innerText)))) { |
14 | if (parseInt(elements[i].querySelector('.dialog-subtitle-badge').innerText) != "" && (elements[i].dataset.peerId > 0)) { | 12 | if (parseInt(elements[i].querySelector('.dialog-subtitle-badge').innerText) != '' && (elements[i].dataset.peerId > 0)) { |
15 | count = +count + parseInt(elements[i].querySelector('.dialog-subtitle-badge').innerText) | 13 | count = +count + parseInt(elements[i].querySelector('.dialog-subtitle-badge').innerText); |
16 | } | 14 | } else { |
17 | else { | 15 | count_sec = +count_sec + parseInt(elements[i].querySelector('.dialog-subtitle-badge').innerText); |
18 | count_sec = +count_sec + parseInt(elements[i].querySelector('.dialog-subtitle-badge').innerText) | ||
19 | } | 16 | } |
20 | } | 17 | } |
21 | } | 18 | } |