diff options
author | 2020-09-22 20:56:48 +0200 | |
---|---|---|
committer | 2020-09-22 19:56:48 +0100 | |
commit | 6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch) | |
tree | 9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /uncompressed/element/webview.js | |
parent | Updated logos for Outlook/OWA (diff) | |
download | ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.gz ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.zst ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.zip |
Unpack recipes and update recipes icons (#292)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Diffstat (limited to 'uncompressed/element/webview.js')
-rw-r--r-- | uncompressed/element/webview.js | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/uncompressed/element/webview.js b/uncompressed/element/webview.js deleted file mode 100644 index aab6038..0000000 --- a/uncompressed/element/webview.js +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | function getMessages() { | ||
5 | const badges = document.getElementsByClassName('mx_RoomSublist_badgeContainer'); | ||
6 | |||
7 | // Number of messages from People | ||
8 | let direct_count = 0; | ||
9 | if (badges.length > 0 && badges[0].children.length > 0) { | ||
10 | direct_count = parseInt(badges[0].textContent) | ||
11 | } | ||
12 | |||
13 | // Number of messages from Rooms | ||
14 | let indirect_count = 0; | ||
15 | if (badges.length > 1 && badges[1].children.length > 0) { | ||
16 | indirect_count = parseInt(badges[1].textContent) | ||
17 | } | ||
18 | |||
19 | // set Franz badge | ||
20 | Franz.setBadge(direct_count, indirect_count); | ||
21 | } | ||
22 | |||
23 | // check for new messages every second and update Franz badge | ||
24 | Franz.loop(getMessages); | ||
25 | }; | ||