diff options
author | Vijay A <avijayr@protonmail.com> | 2021-07-31 15:28:23 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-07-31 15:28:23 +0530 |
commit | 97697e3d069972844b2912a93022f4a4904a40d6 (patch) | |
tree | 53faff30fbac9d72042f593dfe1c547809f4f121 /recipes/jitsi | |
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/jitsi')
-rw-r--r-- | recipes/jitsi/index.js | 9 | ||||
-rw-r--r-- | recipes/jitsi/webview.js | 20 |
2 files changed, 13 insertions, 16 deletions
diff --git a/recipes/jitsi/index.js b/recipes/jitsi/index.js index 6e3a728..8de4268 100644 --- a/recipes/jitsi/index.js +++ b/recipes/jitsi/index.js | |||
@@ -1,6 +1,5 @@ | |||
1 | "use strict"; | ||
2 | module.exports = Franz => class Jitsi extends Franz { | 1 | module.exports = Franz => class Jitsi extends Franz { |
3 | overrideUserAgent() { | 2 | overrideUserAgent() { |
4 | return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(); | 3 | return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(); |
5 | } | 4 | } |
6 | } \ No newline at end of file | 5 | }; |
diff --git a/recipes/jitsi/webview.js b/recipes/jitsi/webview.js index 563a3cf..69c468e 100644 --- a/recipes/jitsi/webview.js +++ b/recipes/jitsi/webview.js | |||
@@ -1,14 +1,12 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const NOTIFICATION_BADGE_CLASS = '.badge-round'; | 1 | const NOTIFICATION_BADGE_CLASS = '.badge-round'; |
4 | 2 | ||
5 | module.exports = Ferdi => { | 3 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 4 | const getMessages = () => { |
7 | const badges = [...document.querySelectorAll(NOTIFICATION_BADGE_CLASS)]; | 5 | const badges = [...document.querySelectorAll(NOTIFICATION_BADGE_CLASS)]; |
8 | const messages = badges.reduce((currentValue, element) => currentValue + Number(element.innerText), 0); | 6 | const messages = badges.reduce((currentValue, element) => currentValue + Number(element.innerText), 0); |
9 | 7 | ||
10 | Ferdi.setBadge(messages); | 8 | Ferdi.setBadge(messages); |
11 | } | 9 | }; |
12 | 10 | ||
13 | Ferdi.loop(getMessages); | 11 | Ferdi.loop(getMessages); |
14 | } \ No newline at end of file | 12 | }; |