From 6f5e4a00588aefdda7a5a1cfe70935870e7e234a Mon Sep 17 00:00:00 2001 From: Bennett Date: Tue, 22 Sep 2020 20:56:48 +0200 Subject: Unpack recipes and update recipes icons (#292) Co-authored-by: Amine Mouafik --- recipes/nextcloud-tasks/README.md | 24 ++++++++++++++++++++++++ recipes/nextcloud-tasks/icon.png | Bin 0 -> 45324 bytes recipes/nextcloud-tasks/icon.svg | 5 +++++ recipes/nextcloud-tasks/index.js | 7 +++++++ recipes/nextcloud-tasks/package.json | 16 ++++++++++++++++ recipes/nextcloud-tasks/service.css | 12 ++++++++++++ recipes/nextcloud-tasks/webview.js | 23 +++++++++++++++++++++++ 7 files changed, 87 insertions(+) create mode 100644 recipes/nextcloud-tasks/README.md create mode 100644 recipes/nextcloud-tasks/icon.png create mode 100644 recipes/nextcloud-tasks/icon.svg create mode 100644 recipes/nextcloud-tasks/index.js create mode 100644 recipes/nextcloud-tasks/package.json create mode 100644 recipes/nextcloud-tasks/service.css create mode 100644 recipes/nextcloud-tasks/webview.js (limited to 'recipes/nextcloud-tasks') diff --git a/recipes/nextcloud-tasks/README.md b/recipes/nextcloud-tasks/README.md new file mode 100644 index 0000000..34f05fd --- /dev/null +++ b/recipes/nextcloud-tasks/README.md @@ -0,0 +1,24 @@ +# Ferdi recipe for Nextcloud Tasks + +Nextcloud Tasks is a tasks app for Nextcloud. +Easily sync tasks from various devices with your Nextcloud and edit them online. + +To add Nextcloud Tasks service to Ferdi, Nextcloud server address should be provided in the field "Custom server". + +## Credits + +This recipe is based on [`recipe-nextcloud-talk`](https://github.com/meetfranz/recipe-nextcloud-talk). + +Icons were sourced from (`favicon.svg`). + +## Links + +Ferdi: + +- [Ferdi](https://getferdi.com/) +- [Ferdi recipes](https://github.com/getferdi/recipes) + +Nextcloud: + +- [Nextcloud](https://nextcloud.com/) +- [Nextcloud Tasks](https://apps.nextcloud.com/apps/tasks) diff --git a/recipes/nextcloud-tasks/icon.png b/recipes/nextcloud-tasks/icon.png new file mode 100644 index 0000000..a09dd5d Binary files /dev/null and b/recipes/nextcloud-tasks/icon.png differ diff --git a/recipes/nextcloud-tasks/icon.svg b/recipes/nextcloud-tasks/icon.svg new file mode 100644 index 0000000..cc1524d --- /dev/null +++ b/recipes/nextcloud-tasks/icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/recipes/nextcloud-tasks/index.js b/recipes/nextcloud-tasks/index.js new file mode 100644 index 0000000..9e4a4e7 --- /dev/null +++ b/recipes/nextcloud-tasks/index.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = Franz => class NextcloudCarnet extends Franz { + buildUrl(url) { + return `${url}/apps/tasks/`; + } +}; diff --git a/recipes/nextcloud-tasks/package.json b/recipes/nextcloud-tasks/package.json new file mode 100644 index 0000000..cabc86a --- /dev/null +++ b/recipes/nextcloud-tasks/package.json @@ -0,0 +1,16 @@ +{ + "id": "nextcloud-tasks", + "name": "Nextcloud Tasks", + "version": "1.0.0", + "description": "Ferdi recipe for Nextcloud Tasks. Easily sync tasks from various devices with your Nextcloud and edit them online.", + "main": "index.js", + "author": "Edgars Andersons ", + "license": "MIT", + "repository": "https://github.com/eandersons/ferdi-recipe-nextcloud-tasks", + "config": { + "hasNotificationSound": true, + "hasIndirectMessages": true, + "hasCustomUrl": true, + "serviceURL": "https://{nextcloud}/apps/tasks/" + } +} diff --git a/recipes/nextcloud-tasks/service.css b/recipes/nextcloud-tasks/service.css new file mode 100644 index 0000000..805b44b --- /dev/null +++ b/recipes/nextcloud-tasks/service.css @@ -0,0 +1,12 @@ +/* Hide all app links and contacts menu link in the top menu except for +Tasks */ +#appmenu li:not([data-id="tasks"]), #contactsmenu {display: none;} + +/* Change the cursor to the default for Nextcloud home, Tasks and settings +links in the top menu and disable them */ +#nextcloud, #appmenu li[data-id="tasks"] a, #settings { + cursor: default; pointer-events: none; +} + +/* Hide "More" link in the top menu */ +#more-apps {display: none !important;} diff --git a/recipes/nextcloud-tasks/webview.js b/recipes/nextcloud-tasks/webview.js new file mode 100644 index 0000000..53496fe --- /dev/null +++ b/recipes/nextcloud-tasks/webview.js @@ -0,0 +1,23 @@ +"use strict"; + +var _path = _interopRequireDefault(require("path")); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +module.exports = Franz => { + 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)' + ).length; + + Franz.setBadge(direct, indirect); + }; + + Franz.loop(getMessages); + Franz.injectCSS(_path.default.join(__dirname, 'service.css')); +}; -- cgit v1.2.3-54-g00ecf