aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/nextcloud-cospend
diff options
context:
space:
mode:
authorLibravatar Carlos SolĂ­s <csolisr@gmail.com>2022-06-21 09:39:54 -0600
committerLibravatar GitHub <noreply@github.com>2022-06-21 15:39:54 +0000
commit08a7af9ef2bb0030fd1876674d53b719e91f13e2 (patch)
treeda71d5f5d17e90faaf0af07fd0e97936b8820aff /recipes/nextcloud-cospend
parentdocs: add dqos as a contributor for code (#72) [skip ci] (diff)
downloadferdium-recipes-08a7af9ef2bb0030fd1876674d53b719e91f13e2.tar.gz
ferdium-recipes-08a7af9ef2bb0030fd1876674d53b719e91f13e2.tar.zst
ferdium-recipes-08a7af9ef2bb0030fd1876674d53b719e91f13e2.zip
Add fixes for Nextcloud-related webapps (#66)
Diffstat (limited to 'recipes/nextcloud-cospend')
-rw-r--r--recipes/nextcloud-cospend/index.js6
-rw-r--r--recipes/nextcloud-cospend/package.json10
-rw-r--r--recipes/nextcloud-cospend/service.css39
-rw-r--r--recipes/nextcloud-cospend/webview.js11
4 files changed, 48 insertions, 18 deletions
diff --git a/recipes/nextcloud-cospend/index.js b/recipes/nextcloud-cospend/index.js
index 4ba7df9..dd41f72 100644
--- a/recipes/nextcloud-cospend/index.js
+++ b/recipes/nextcloud-cospend/index.js
@@ -1,5 +1 @@
1module.exports = Ferdium => class NextcloudCarnet extends Ferdium { module.exports = Ferdium => Ferdium;
2 buildUrl(url) {
3 return `${url}/apps/cospend/`;
4 }
5};
diff --git a/recipes/nextcloud-cospend/package.json b/recipes/nextcloud-cospend/package.json
index bddfcfd..7367589 100644
--- a/recipes/nextcloud-cospend/package.json
+++ b/recipes/nextcloud-cospend/package.json
@@ -1,13 +1,15 @@
1{ 1{
2 "id": "nextcloud-cospend", 2 "id": "nextcloud-cospend",
3 "name": "Nextcloud Cospend", 3 "name": "Nextcloud Cospend",
4 "version": "1.2.0", 4 "version": "1.2.1",
5 "license": "MIT", 5 "license": "MIT",
6 "repository": "https://github.com/eandersons/ferdi-recipe-nextcloud-cospend", 6 "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-cospend/",
7 "config": { 7 "config": {
8 "hasNotificationSound": true, 8 "hasNotificationSound": true,
9 "hasIndirectMessages": true, 9 "hasIndirectMessages": true,
10 "hasCustomUrl": true, 10 "hasTeamId": true,
11 "serviceURL": "https://{nextcloud}/apps/cospend/" 11 "urlInputPrefix": "https://",
12 "urlInputSuffix": "/apps/cospend/",
13 "serviceURL": "https://{teamId}/apps/cospend/"
12 } 14 }
13} 15}
diff --git a/recipes/nextcloud-cospend/service.css b/recipes/nextcloud-cospend/service.css
index 764531b..85171b0 100644
--- a/recipes/nextcloud-cospend/service.css
+++ b/recipes/nextcloud-cospend/service.css
@@ -1,12 +1,41 @@
1/* Hide all app links and contacts menu link in the top menu except for 1/* Hide all app links and contacts menu link in the top menu except for
2Cospend */ 2Cospend */
3#appmenu li:not([data-id="cospend"]), #contactsmenu {display: none;} 3#appmenu li:not([data-id='cospend']),
4#contactsmenu {
5 display: none;
6}
4 7
5/* Change the cursor to the default for Nextcloud home, Cospend and settings 8/* Change the cursor to the default for Nextcloud home and Cospend
6links in the top menu and disable them */ 9links in the top menu and disable them */
7#nextcloud, #appmenu li[data-id="cospend"] a, #settings { 10#nextcloud,
8 cursor:default; pointer-events: none; 11#appmenu li[data-id='cospend'] a {
12 cursor: default;
13 pointer-events: none;
14}
15
16/* Hide all settings options, except the option to log out */
17#settings #expanddiv li:not([data-id='logout']) {
18 display: none;
19}
20
21/* Fix the margin of the dropdown */
22#settings #expanddiv,
23#settings #expanddiv > ul {
24 min-height: 0;
9} 25}
10 26
11/* Hide "More" link in the top menu */ 27/* Hide "More" link in the top menu */
12#more-apps {display: none !important;} 28#more-apps {
29 display: none !important;
30}
31
32/* Hide notifications that are not related to Cospend */
33.notifications .notification-wrapper .notification:not([object_type="cospend"]) {
34 display: none;
35}
36
37/* Hide "Dismiss all notifications" as this action will dismiss also hidden
38notifications */
39.notification-wrapper .dismiss-all {
40 display: none;
41}
diff --git a/recipes/nextcloud-cospend/webview.js b/recipes/nextcloud-cospend/webview.js
index e9e6433..b3836a7 100644
--- a/recipes/nextcloud-cospend/webview.js
+++ b/recipes/nextcloud-cospend/webview.js
@@ -4,12 +4,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
4 4
5module.exports = Ferdium => { 5module.exports = Ferdium => {
6 const getMessages = () => { 6 const getMessages = () => {
7 const direct = document.querySelectorAll( 7 const directSelector = document.querySelectorAll(
8 '.app-navigation-entry-utils-counter.highlighted', 8 '.app-navigation-entry-utils-counter.highlighted',
9 ).length; 9 );
10 const indirect = document.querySelectorAll( 10 const direct = directSelector ? Ferdium.safeParseInt(directSelector.length) : 0;
11
12 const indirectSelector = document.querySelectorAll(
11 '.app-navigation-entry-utils-counter:not(.highlighted)', 13 '.app-navigation-entry-utils-counter:not(.highlighted)',
12 ).length; 14 );
15 const indirect = indirectSelector ? Ferdium.safeParseInt(indirectSelector.length) : 0;
13 16
14 Ferdium.setBadge(direct, indirect); 17 Ferdium.setBadge(direct, indirect);
15 }; 18 };