diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/nextcloud-talk/README.md | 21 | ||||
-rw-r--r-- | recipes/nextcloud-talk/package.json | 4 | ||||
-rw-r--r-- | recipes/nextcloud-talk/service.css | 12 | ||||
-rw-r--r-- | recipes/nextcloud-talk/webview.js | 28 |
4 files changed, 54 insertions, 11 deletions
diff --git a/recipes/nextcloud-talk/README.md b/recipes/nextcloud-talk/README.md new file mode 100644 index 0000000..e6194c2 --- /dev/null +++ b/recipes/nextcloud-talk/README.md | |||
@@ -0,0 +1,21 @@ | |||
1 | # Ferdi recipe for Nextcloud Talk | ||
2 | |||
3 | Nextcloud Talk - Chat, video & audio-conferencing using WebRTC. | ||
4 | |||
5 | To add Nextcloud Talk to Ferdi, Nextcloud server address should be provided in the field "Custom server". | ||
6 | |||
7 | ## Credits | ||
8 | |||
9 | This recipe is based on [`recipe-nextcloud-talk`](https://github.com/meetfranz/recipe-nextcloud-talk). | ||
10 | |||
11 | ## Links | ||
12 | |||
13 | Ferdi: | ||
14 | |||
15 | - [Ferdi](https://getferdi.com/) | ||
16 | - [Ferdi recipes](https://github.com/getferdi/recipes) | ||
17 | |||
18 | Nextcloud: | ||
19 | |||
20 | - [Nextcloud](https://nextcloud.com/) | ||
21 | - [Nextcloud Talk](https://apps.nextcloud.com/apps/spreed) | ||
diff --git a/recipes/nextcloud-talk/package.json b/recipes/nextcloud-talk/package.json index dcb5508..abbdd5a 100644 --- a/recipes/nextcloud-talk/package.json +++ b/recipes/nextcloud-talk/package.json | |||
@@ -1,8 +1,8 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-talk", | 2 | "id": "nextcloud-talk", |
3 | "name": "Nextcloud Talk", | 3 | "name": "Nextcloud Talk", |
4 | "version": "1.0.2", | 4 | "version": "1.0.3", |
5 | "description": "Nextcloud Talk", | 5 | "description": "Nextcloud Talk - chat, video & audio-conferencing using WebRTC", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Stefan Malzner <stefan@adlk.io>", | 7 | "author": "Stefan Malzner <stefan@adlk.io>", |
8 | "license": "MIT", | 8 | "license": "MIT", |
diff --git a/recipes/nextcloud-talk/service.css b/recipes/nextcloud-talk/service.css index 82dde75..f4f08bc 100644 --- a/recipes/nextcloud-talk/service.css +++ b/recipes/nextcloud-talk/service.css | |||
@@ -15,7 +15,13 @@ settings links and disable them */ | |||
15 | display: none !important; | 15 | display: none !important; |
16 | } | 16 | } |
17 | 17 | ||
18 | /* Hide contacts in the top menu */ | 18 | /* Hide notifications that are not related to calendar */ |
19 | #contactsmenu { | 19 | .notifications .notification-wrapper .notification {display: none;} |
20 | display: none; | 20 | .notifications .notification-wrapper .notification[object_type="chat"], |
21 | .notifications .notification-wrapper .notification[object_type="room"] { | ||
22 | display: initial; | ||
21 | } | 23 | } |
24 | |||
25 | /* Hide "Dismiss all notifications" as this action will dismiss also hidden | ||
26 | notifications */ | ||
27 | .notification-wrapper .dismiss-all {display: none;} | ||
diff --git a/recipes/nextcloud-talk/webview.js b/recipes/nextcloud-talk/webview.js index c180d4d..0dfb6ea 100644 --- a/recipes/nextcloud-talk/webview.js +++ b/recipes/nextcloud-talk/webview.js | |||
@@ -6,13 +6,29 @@ function _interopRequireDefault(obj) { | |||
6 | return obj && obj.__esModule ? obj : { default: obj }; | 6 | return obj && obj.__esModule ? obj : { default: obj }; |
7 | } | 7 | } |
8 | 8 | ||
9 | module.exports = Franz => { | 9 | module.exports = Ferdi => { |
10 | const getMessages = function getMessages() { | 10 | const getMessages = function getMessages() { |
11 | const direct = document.querySelectorAll('.app-navigation-entry-utils-counter.highlighted').length; | 11 | let direct = 0; |
12 | const indirect = document.querySelectorAll('.app-navigation-entry-utils-counter:not(.highlighted)').length; | 12 | const notificationWrapper = document.querySelector( |
13 | Franz.setBadge(direct, indirect); | 13 | '.notifications .notification-wrapper' |
14 | ); | ||
15 | |||
16 | if (notificationWrapper) { | ||
17 | direct = notificationWrapper.querySelectorAll( | ||
18 | '.notification[object_type="chat"], .notification[object_type="room"' | ||
19 | ).length; | ||
20 | } | ||
21 | |||
22 | let indirect = 0; | ||
23 | |||
24 | document.querySelectorAll('.app-navigation-entry__counter').forEach( | ||
25 | function(counter) { | ||
26 | indirect += Number(counter.textContent); | ||
27 | } | ||
28 | ); | ||
29 | Ferdi.setBadge(direct, indirect); | ||
14 | }; | 30 | }; |
15 | 31 | ||
16 | Franz.loop(getMessages); | 32 | Ferdi.loop(getMessages); |
17 | Franz.injectCSS(_path.default.join(__dirname, 'service.css')); | 33 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); |
18 | }; | 34 | }; |