From a62cb87a75dbe5065ef14f26463bb7b69bfc4972 Mon Sep 17 00:00:00 2001 From: Edgars Date: Tue, 10 Nov 2020 10:32:33 +0200 Subject: Nextcloud Calendar: Display only calendar related notifications and their count `service.css` was updated to hide notifications that are not related to Nextcloud Calendar. `webview.js` was updated to fix notifications count selector. --- recipes/nextcloud-calendar/service.css | 5 +++++ recipes/nextcloud-calendar/webview.js | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'recipes/nextcloud-calendar') diff --git a/recipes/nextcloud-calendar/service.css b/recipes/nextcloud-calendar/service.css index 833d5a8..634a959 100644 --- a/recipes/nextcloud-calendar/service.css +++ b/recipes/nextcloud-calendar/service.css @@ -10,3 +10,8 @@ settings links and disable them */ /* Hide "More" link in the top menu */ #more-apps {display: none !important;} + +/* Hide notifications that are not related to calendar */ +.notifications .notification-wrapper .notification:not([object_type="dav"]) { + display: none; +} diff --git a/recipes/nextcloud-calendar/webview.js b/recipes/nextcloud-calendar/webview.js index 53496fe..e36a9d4 100644 --- a/recipes/nextcloud-calendar/webview.js +++ b/recipes/nextcloud-calendar/webview.js @@ -6,18 +6,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {default: obj}; } -module.exports = Franz => { +module.exports = Ferdi => { const getMessages = function getMessages() { const direct = document.querySelectorAll( - '.app-navigation-entry-utils-counter.highlighted' - ).length; - const indirect = document.querySelectorAll( - '.app-navigation-entry-utils-counter:not(.highlighted)' + '.notifications .notification-wrapper .notification[object_type="dav"]' ).length; - Franz.setBadge(direct, indirect); + Ferdi.setBadge(direct); }; - Franz.loop(getMessages); - Franz.injectCSS(_path.default.join(__dirname, 'service.css')); + Ferdi.loop(getMessages); + Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); }; -- cgit v1.2.3-70-g09d2