diff options
author | 2020-07-29 12:46:29 +0200 | |
---|---|---|
committer | 2020-07-29 12:46:29 +0200 | |
commit | 921e6c8950ecb73e07075e08bd9a5476d8a98bf8 (patch) | |
tree | b425fe608b655570755eea425f278ea10bb813ad /uncompressed | |
parent | Merge pull request #236 from ruippeixotog/patch-1 (diff) | |
parent | Update room list's CSS class name (diff) | |
download | ferdium-recipes-921e6c8950ecb73e07075e08bd9a5476d8a98bf8.tar.gz ferdium-recipes-921e6c8950ecb73e07075e08bd9a5476d8a98bf8.tar.zst ferdium-recipes-921e6c8950ecb73e07075e08bd9a5476d8a98bf8.zip |
Merge pull request #247 from fjl5/master
Update recipe for element
Diffstat (limited to 'uncompressed')
-rw-r--r-- | uncompressed/element/README.md | 4 | ||||
-rw-r--r-- | uncompressed/element/package.json | 4 | ||||
-rw-r--r-- | uncompressed/element/webview.js | 19 |
3 files changed, 15 insertions, 12 deletions
diff --git a/uncompressed/element/README.md b/uncompressed/element/README.md index affdf4b..221864f 100644 --- a/uncompressed/element/README.md +++ b/uncompressed/element/README.md | |||
@@ -1,2 +1,2 @@ | |||
1 | # Element for Franz | 1 | # Element for Franz and Ferdi |
2 | This is a Franz recipe/plugin for Element | 2 | This is a Franz and Ferdi recipe/plugin for Element |
diff --git a/uncompressed/element/package.json b/uncompressed/element/package.json index 6774ce3..3b2f59f 100644 --- a/uncompressed/element/package.json +++ b/uncompressed/element/package.json | |||
@@ -1,10 +1,10 @@ | |||
1 | { | 1 | { |
2 | "id": "element", | 2 | "id": "element", |
3 | "name": "Element", | 3 | "name": "Element", |
4 | "version": "1.0.0", | 4 | "version": "1.0.2", |
5 | "description": "Decentralized, encrypted chat & collaboration powered by [matrix]", | 5 | "description": "Decentralized, encrypted chat & collaboration powered by [matrix]", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Omove <61330514+omove@users.noreply.github.com>", | 7 | "author": "Sylvain Cecchetto <cecchetto.sylvain@me.com>, Omove <61330514+omove@users.noreply.github.com>, Achim Leitner <1033549+fjl5@users.noreply.github.com>", |
8 | "license": "MIT", | 8 | "license": "MIT", |
9 | "config": { | 9 | "config": { |
10 | "serviceURL": "https://app.element.io", | 10 | "serviceURL": "https://app.element.io", |
diff --git a/uncompressed/element/webview.js b/uncompressed/element/webview.js index 6201f27..aab6038 100644 --- a/uncompressed/element/webview.js +++ b/uncompressed/element/webview.js | |||
@@ -2,17 +2,20 @@ | |||
2 | 2 | ||
3 | module.exports = Franz => { | 3 | module.exports = Franz => { |
4 | function getMessages() { | 4 | function getMessages() { |
5 | const indirect_badge = document.getElementsByClassName('mx_RoomSubList_badge'); | 5 | const badges = document.getElementsByClassName('mx_RoomSublist_badgeContainer'); |
6 | let indirect_count = 0; | ||
7 | if (indirect_badge.length !== 0) { | ||
8 | indirect_count = indirect_badge.length; | ||
9 | } | ||
10 | 6 | ||
11 | const direct_badge = document.getElementsByClassName('mx_RoomSubList_badgeHighlight'); | 7 | // Number of messages from People |
12 | let direct_count = 0; | 8 | let direct_count = 0; |
13 | if (direct_badge.length !== 0) { | 9 | if (badges.length > 0 && badges[0].children.length > 0) { |
14 | direct_count = direct_badge.length; | 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) | ||
15 | } | 17 | } |
18 | |||
16 | // set Franz badge | 19 | // set Franz badge |
17 | Franz.setBadge(direct_count, indirect_count); | 20 | Franz.setBadge(direct_count, indirect_count); |
18 | } | 21 | } |