From 08a7af9ef2bb0030fd1876674d53b719e91f13e2 Mon Sep 17 00:00:00 2001 From: Carlos SolĂ­s Date: Tue, 21 Jun 2022 09:39:54 -0600 Subject: Add fixes for Nextcloud-related webapps (#66) --- recipes/nextcloud-calendar/index.js | 6 +----- recipes/nextcloud-calendar/package.json | 11 ++++++----- recipes/nextcloud-calendar/service.css | 34 ++++++++++++++++++++++++++------- recipes/nextcloud-calendar/webview.js | 9 ++++++--- 4 files changed, 40 insertions(+), 20 deletions(-) (limited to 'recipes/nextcloud-calendar') diff --git a/recipes/nextcloud-calendar/index.js b/recipes/nextcloud-calendar/index.js index 8d77048..dd41f72 100644 --- a/recipes/nextcloud-calendar/index.js +++ b/recipes/nextcloud-calendar/index.js @@ -1,5 +1 @@ -module.exports = Ferdium => class NextcloudCarnet extends Ferdium { - buildUrl(url) { - return `${url}/apps/calendar/`; - } -}; +module.exports = Ferdium => Ferdium; diff --git a/recipes/nextcloud-calendar/package.json b/recipes/nextcloud-calendar/package.json index fa8b3d9..027ea9b 100644 --- a/recipes/nextcloud-calendar/package.json +++ b/recipes/nextcloud-calendar/package.json @@ -1,13 +1,14 @@ { "id": "nextcloud-calendar", "name": "Nextcloud Calendar", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", - "repository": "https://github.com/eandersons/ferdi-recipe-nextcloud-calendar", + "repository": "https://github.com/csolisr/ferdium-recipes/tree/master/recipes/nextcloud-calendar/", "config": { "hasNotificationSound": true, - "hasIndirectMessages": true, - "hasCustomUrl": true, - "serviceURL": "https://{nextcloud}/apps/calendar/" + "hasTeamId": true, + "urlInputPrefix": "https://", + "urlInputSuffix": "/apps/calendar/", + "serviceURL": "https://{teamId}/apps/calendar/" } } diff --git a/recipes/nextcloud-calendar/service.css b/recipes/nextcloud-calendar/service.css index a0016ae..6e04c63 100644 --- a/recipes/nextcloud-calendar/service.css +++ b/recipes/nextcloud-calendar/service.css @@ -1,15 +1,33 @@ /* Hide all app links and contacts menu link in the top menu except for Calendar */ -#appmenu li:not([data-id="calendar"]), #contactsmenu {display: none;} +#appmenu li:not([data-id="calendar"]), +#contactsmenu { + display: none; +} + +/* Change the cursor to default for top menu Nextcloud home and Calendar +links and disable them */ +#nextcloud, +#appmenu li[data-id="calendar"] a { + cursor:default; + pointer-events: none; +} -/* Change the cursor to default for top menu Nextcloud home, Calendar and -settings links and disable them */ -#nextcloud, #appmenu li[data-id="calendar"] a, #settings { - cursor:default; pointer-events: none; +/* Hide all settings options, except the option to log out */ +#settings #expanddiv li:not([data-id='logout']) { + display: none; +} + +/* Fix the margin of the dropdown */ +#settings #expanddiv, +#settings #expanddiv > ul { + min-height: 0; } /* Hide "More" link in the top menu */ -#more-apps {display: none !important;} +#more-apps { + display: none !important; +} /* Hide notifications that are not related to calendar */ .notifications .notification-wrapper .notification:not([object_type="dav"]) { @@ -18,4 +36,6 @@ settings links and disable them */ /* Hide "Dismiss all notifications" as this action will dismiss also hidden notifications */ -.notification-wrapper .dismiss-all {display: none;} +.notification-wrapper .dismiss-all { + display: none; +} diff --git a/recipes/nextcloud-calendar/webview.js b/recipes/nextcloud-calendar/webview.js index 84c55f2..49ed705 100644 --- a/recipes/nextcloud-calendar/webview.js +++ b/recipes/nextcloud-calendar/webview.js @@ -1,12 +1,15 @@ const _path = _interopRequireDefault(require('path')); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; +} module.exports = Ferdium => { const getMessages = () => { - const direct = document.querySelectorAll( + const directSelector = document.querySelectorAll( '.notifications .notification-wrapper .notification[object_type="dav"]', - ).length; + ); + const direct = directSelector ? Ferdium.safeParseInt(selector.length) : 0; Ferdium.setBadge(direct); }; -- cgit v1.2.3-54-g00ecf