aboutsummaryrefslogtreecommitdiffstats
path: root/uncompressed/jitsi/webview.js
diff options
context:
space:
mode:
authorLibravatar Sampath Kumar Krishnan <sampathBlam@users.noreply.github.com>2020-04-17 14:27:07 +0530
committerLibravatar Sampath Kumar Krishnan <sampathBlam@users.noreply.github.com>2020-04-17 14:27:07 +0530
commite4d3e6e3ccdf1b2b24e1a1171b7776c2cd9ca7a6 (patch)
tree0b7c05b43cd12fce7081e0925f509be2f9d2d935 /uncompressed/jitsi/webview.js
parentfeature: Add jitsi recipe for ferdi (diff)
downloadferdium-recipes-e4d3e6e3ccdf1b2b24e1a1171b7776c2cd9ca7a6.tar.gz
ferdium-recipes-e4d3e6e3ccdf1b2b24e1a1171b7776c2cd9ca7a6.tar.zst
ferdium-recipes-e4d3e6e3ccdf1b2b24e1a1171b7776c2cd9ca7a6.zip
fix: Add notification support for jitsi
- Add the code provided by @vantezzen to webview.js - Change name from Franz to Ferdi in index.js - Update version to 1.0.1
Diffstat (limited to 'uncompressed/jitsi/webview.js')
-rw-r--r--uncompressed/jitsi/webview.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/uncompressed/jitsi/webview.js b/uncompressed/jitsi/webview.js
index 3918c74..563a3cf 100644
--- a/uncompressed/jitsi/webview.js
+++ b/uncompressed/jitsi/webview.js
@@ -1 +1,14 @@
1"use strict"; 1"use strict";
2
3const NOTIFICATION_BADGE_CLASS = '.badge-round';
4
5module.exports = Ferdi => {
6 const getMessages = () => {
7 const badges = [...document.querySelectorAll(NOTIFICATION_BADGE_CLASS)];
8 const messages = badges.reduce((currentValue, element) => currentValue + Number(element.innerText), 0);
9
10 Ferdi.setBadge(messages);
11 }
12
13 Ferdi.loop(getMessages);
14} \ No newline at end of file