From e4d3e6e3ccdf1b2b24e1a1171b7776c2cd9ca7a6 Mon Sep 17 00:00:00 2001 From: Sampath Kumar Krishnan Date: Fri, 17 Apr 2020 14:27:07 +0530 Subject: 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 --- uncompressed/jitsi/index.js | 2 +- uncompressed/jitsi/package.json | 2 +- uncompressed/jitsi/webview.js | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'uncompressed') diff --git a/uncompressed/jitsi/index.js b/uncompressed/jitsi/index.js index f6f75e3..74b9592 100644 --- a/uncompressed/jitsi/index.js +++ b/uncompressed/jitsi/index.js @@ -1,2 +1,2 @@ "use strict"; -module.exports = Franz => Franz; \ No newline at end of file +module.exports = Ferdi => Ferdi; \ No newline at end of file diff --git a/uncompressed/jitsi/package.json b/uncompressed/jitsi/package.json index 35841e3..cddd8f0 100644 --- a/uncompressed/jitsi/package.json +++ b/uncompressed/jitsi/package.json @@ -1,7 +1,7 @@ { "id": "jitsi", "name": "Jitsi", - "version": "1.0.0", + "version": "1.0.1", "description": "Jitsi", "main": "index.js", "author": "Sampath Kumar Krishnan ", 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 @@ "use strict"; + +const NOTIFICATION_BADGE_CLASS = '.badge-round'; + +module.exports = Ferdi => { + const getMessages = () => { + const badges = [...document.querySelectorAll(NOTIFICATION_BADGE_CLASS)]; + const messages = badges.reduce((currentValue, element) => currentValue + Number(element.innerText), 0); + + Ferdi.setBadge(messages); + } + + Ferdi.loop(getMessages); +} \ No newline at end of file -- cgit v1.2.3-70-g09d2