aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/nextcloud-carnet
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-carnet
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-carnet')
-rw-r--r--recipes/nextcloud-carnet/index.js6
-rw-r--r--recipes/nextcloud-carnet/package.json10
-rw-r--r--recipes/nextcloud-carnet/service.css44
-rw-r--r--recipes/nextcloud-carnet/webview.js11
4 files changed, 51 insertions, 20 deletions
diff --git a/recipes/nextcloud-carnet/index.js b/recipes/nextcloud-carnet/index.js
index f684bbd..dd41f72 100644
--- a/recipes/nextcloud-carnet/index.js
+++ b/recipes/nextcloud-carnet/index.js
@@ -1,5 +1 @@
1module.exports = Ferdium => class NextcloudCarnet extends Ferdium { module.exports = Ferdium => Ferdium;
2 buildUrl(url) {
3 return `${url}/apps/carnet/`;
4 }
5};
diff --git a/recipes/nextcloud-carnet/package.json b/recipes/nextcloud-carnet/package.json
index 82c1eb7..67c7515 100644
--- a/recipes/nextcloud-carnet/package.json
+++ b/recipes/nextcloud-carnet/package.json
@@ -1,13 +1,15 @@
1{ 1{
2 "id": "nextcloud-carnet", 2 "id": "nextcloud-carnet",
3 "name": "Carnet (Nextcloud)", 3 "name": "Carnet (Nextcloud)",
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-carnet", 6 "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-carnet/",
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/carnet/" 11 "urlInputPrefix": "https://",
12 "urlInputSuffix": "/apps/carnet/",
13 "serviceURL": "https://{teamId}/apps/carnet/"
12 } 14 }
13} 15}
diff --git a/recipes/nextcloud-carnet/service.css b/recipes/nextcloud-carnet/service.css
index 8e767c2..9b2948e 100644
--- a/recipes/nextcloud-carnet/service.css
+++ b/recipes/nextcloud-carnet/service.css
@@ -1,11 +1,41 @@
1/* Hide all app links and contacts link in the top menu except for Carnet */ 1/* Hide all app links and contacts menu link in the top menu except for
2#appmenu li:not([data-id="carnet"]), #contactsmenu {display: none;} 2Carnet */
3#appmenu li:not([data-id='carnet']),
4#contactsmenu {
5 display: none;
6}
7
8/* Change the cursor to the default for Nextcloud home and Carnet
9links in the top menu and disable them */
10#nextcloud,
11#appmenu li[data-id='carnet'] 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}
3 20
4/* Change cursor to the default pointer for Nextcloud home, Carnet and settings 21/* Fix the margin of the dropdown */
5link and disable them in the top menu */ 22#settings #expanddiv,
6#nextcloud, #appmenu li[data-id="carnet"] a, #settings { 23#settings #expanddiv > ul {
7 cursor:default; pointer-events: none; 24 min-height: 0;
8} 25}
9 26
10/* Hide "More" link in the top menu */ 27/* Hide "More" link in the top menu */
11#more-apps {display: none !important;} 28#more-apps {
29 display: none !important;
30}
31
32/* Hide notifications that are not related to Carnet */
33.notifications .notification-wrapper .notification:not([object_type="carnet"]) {
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-carnet/webview.js b/recipes/nextcloud-carnet/webview.js
index e9e6433..b3836a7 100644
--- a/recipes/nextcloud-carnet/webview.js
+++ b/recipes/nextcloud-carnet/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 };