diff options
Diffstat (limited to 'recipes/nextcloud-talk')
-rw-r--r-- | recipes/nextcloud-talk/index.js | 6 | ||||
-rw-r--r-- | recipes/nextcloud-talk/package.json | 9 | ||||
-rw-r--r-- | recipes/nextcloud-talk/service.css | 28 | ||||
-rw-r--r-- | recipes/nextcloud-talk/webview.js | 11 |
4 files changed, 36 insertions, 18 deletions
diff --git a/recipes/nextcloud-talk/index.js b/recipes/nextcloud-talk/index.js index 8b520e9..dd41f72 100644 --- a/recipes/nextcloud-talk/index.js +++ b/recipes/nextcloud-talk/index.js | |||
@@ -1,5 +1 @@ | |||
1 | module.exports = Ferdium => class Nextcloud extends Ferdium { | module.exports = Ferdium => Ferdium; | |
2 | buildUrl(url) { | ||
3 | return `${url}/apps/spreed/`; | ||
4 | } | ||
5 | }; | ||
diff --git a/recipes/nextcloud-talk/package.json b/recipes/nextcloud-talk/package.json index ac55283..8ce25ac 100644 --- a/recipes/nextcloud-talk/package.json +++ b/recipes/nextcloud-talk/package.json | |||
@@ -1,12 +1,15 @@ | |||
1 | { | 1 | { |
2 | "id": "nextcloud-talk", | 2 | "id": "nextcloud-talk", |
3 | "name": "Nextcloud Talk", | 3 | "name": "Nextcloud Talk", |
4 | "version": "1.3.1", | 4 | "version": "1.3.2", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-tasks/", | ||
6 | "config": { | 7 | "config": { |
7 | "hasNotificationSound": true, | 8 | "hasNotificationSound": true, |
8 | "hasIndirectMessages": true, | 9 | "hasIndirectMessages": true, |
9 | "hasCustomUrl": true, | 10 | "hasTeamId": true, |
10 | "serviceURL": "https://{nextcloud}/apps/spreed/" | 11 | "urlInputPrefix": "https://", |
12 | "urlInputSuffix": "/apps/spreed/", | ||
13 | "serviceURL": "https://{teamId}/apps/spreed/" | ||
11 | } | 14 | } |
12 | } | 15 | } |
diff --git a/recipes/nextcloud-talk/service.css b/recipes/nextcloud-talk/service.css index f4f08bc..ccdba58 100644 --- a/recipes/nextcloud-talk/service.css +++ b/recipes/nextcloud-talk/service.css | |||
@@ -3,20 +3,34 @@ | |||
3 | display: none; | 3 | display: none; |
4 | } | 4 | } |
5 | 5 | ||
6 | /* Change cursor to the default pointer for top menu Nextcloud home, Talk and | 6 | /* Change cursor to the default pointer for top menu Nextcloud home and Talk |
7 | settings links and disable them */ | 7 | links and disable them */ |
8 | #nextcloud, #appmenu li[data-id="spreed"] a, #settings { | 8 | #nextcloud, |
9 | #appmenu li[data-id="spreed"] a { | ||
9 | cursor: default; | 10 | cursor: default; |
10 | pointer-events: none; | 11 | pointer-events: none; |
11 | } | 12 | } |
12 | 13 | ||
14 | /* Hide all settings options, except the option to log out */ | ||
15 | #settings #expanddiv li:not([data-id='logout']) { | ||
16 | display: none; | ||
17 | } | ||
18 | |||
19 | /* Fix the margin of the dropdown */ | ||
20 | #settings #expanddiv, | ||
21 | #settings #expanddiv > ul { | ||
22 | min-height: 0; | ||
23 | } | ||
24 | |||
13 | /* Hide "More" link in the top menu */ | 25 | /* Hide "More" link in the top menu */ |
14 | #more-apps { | 26 | #more-apps { |
15 | display: none !important; | 27 | display: none !important; |
16 | } | 28 | } |
17 | 29 | ||
18 | /* Hide notifications that are not related to calendar */ | 30 | /* Hide notifications that are not related to Talk */ |
19 | .notifications .notification-wrapper .notification {display: none;} | 31 | .notifications .notification-wrapper .notification { |
32 | display: none; | ||
33 | } | ||
20 | .notifications .notification-wrapper .notification[object_type="chat"], | 34 | .notifications .notification-wrapper .notification[object_type="chat"], |
21 | .notifications .notification-wrapper .notification[object_type="room"] { | 35 | .notifications .notification-wrapper .notification[object_type="room"] { |
22 | display: initial; | 36 | display: initial; |
@@ -24,4 +38,6 @@ settings links and disable them */ | |||
24 | 38 | ||
25 | /* Hide "Dismiss all notifications" as this action will dismiss also hidden | 39 | /* Hide "Dismiss all notifications" as this action will dismiss also hidden |
26 | notifications */ | 40 | notifications */ |
27 | .notification-wrapper .dismiss-all {display: none;} | 41 | .notification-wrapper .dismiss-all { |
42 | display: none; | ||
43 | } | ||
diff --git a/recipes/nextcloud-talk/webview.js b/recipes/nextcloud-talk/webview.js index 1ae3783..77b969b 100644 --- a/recipes/nextcloud-talk/webview.js +++ b/recipes/nextcloud-talk/webview.js | |||
@@ -5,21 +5,24 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de | |||
5 | module.exports = Ferdium => { | 5 | module.exports = Ferdium => { |
6 | const getMessages = () => { | 6 | const getMessages = () => { |
7 | let direct = 0; | 7 | let direct = 0; |
8 | |||
8 | const notificationWrapper = document.querySelector( | 9 | const notificationWrapper = document.querySelector( |
9 | '.notifications .notification-wrapper', | 10 | '.notifications .notification-wrapper', |
10 | ); | 11 | ); |
11 | 12 | ||
12 | if (notificationWrapper) { | 13 | if (notificationWrapper) { |
13 | direct = notificationWrapper.querySelectorAll( | 14 | const directSelector = notificationWrapper.querySelectorAll( |
14 | '.notification[object_type="chat"], .notification[object_type="room"]', | 15 | '.notification[object_type="chat"], .notification[object_type="room"]', |
15 | ).length; | 16 | ); |
17 | direct = directSelector ? Ferdium.safeParseInt(directSelector.length) : 0; | ||
16 | } | 18 | } |
17 | 19 | ||
18 | let indirect = 0; | 20 | let indirect = 0; |
19 | 21 | ||
20 | for (const counter of document.querySelectorAll('.app-navigation-entry__counter')) { | 22 | for (const counter of document.querySelectorAll('.app-navigation-entry__counter')) { |
21 | indirect += Number(counter.textContent); | 23 | const entryCounter = Ferdium.safeParseInt(counter.textContent) : 0; |
22 | } | 24 | indirect += entryCounter; |
25 | } | ||
23 | 26 | ||
24 | if (document.title.startsWith("*")) { | 27 | if (document.title.startsWith("*")) { |
25 | indirect++; | 28 | indirect++; |