From f34f54f31bbfac9d921ca39767f518ab72f30973 Mon Sep 17 00:00:00 2001 From: Edgars Date: Tue, 18 Aug 2020 16:27:22 +0300 Subject: Recipe for Nextcloud Cospend Nextcloud Cospend is a group/shared budget manager. --- all.json | 11 +++ archives/nextcloud-cospend.tar.gz | Bin 0 -> 44718 bytes uncompressed/nextcloud-cospend/README.md | 24 ++++++ uncompressed/nextcloud-cospend/icon.png | Bin 0 -> 41847 bytes uncompressed/nextcloud-cospend/icon.svg | 113 ++++++++++++++++++++++++++++ uncompressed/nextcloud-cospend/index.js | 7 ++ uncompressed/nextcloud-cospend/package.json | 16 ++++ uncompressed/nextcloud-cospend/service.css | 12 +++ uncompressed/nextcloud-cospend/webview.js | 23 ++++++ 9 files changed, 206 insertions(+) create mode 100644 archives/nextcloud-cospend.tar.gz create mode 100644 uncompressed/nextcloud-cospend/README.md create mode 100644 uncompressed/nextcloud-cospend/icon.png create mode 100644 uncompressed/nextcloud-cospend/icon.svg create mode 100644 uncompressed/nextcloud-cospend/index.js create mode 100644 uncompressed/nextcloud-cospend/package.json create mode 100644 uncompressed/nextcloud-cospend/service.css create mode 100644 uncompressed/nextcloud-cospend/webview.js diff --git a/all.json b/all.json index 7953af4..70363b9 100644 --- a/all.json +++ b/all.json @@ -648,6 +648,17 @@ "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/NewsBlur/icon.svg" } }, + { + "author": "Edgars Andersons ", + "featured": false, + "id": "nextcloud-cospend", + "name": "Nextcloud Cospend", + "version": "1.0.0", + "icons": { + "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/nextcloud-cospend/icon.png", + "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/nextcloud-cospend/icon.svg" + } + }, { "author": "Stefan Malzner ", "featured": false, diff --git a/archives/nextcloud-cospend.tar.gz b/archives/nextcloud-cospend.tar.gz new file mode 100644 index 0000000..b2d0f2c Binary files /dev/null and b/archives/nextcloud-cospend.tar.gz differ diff --git a/uncompressed/nextcloud-cospend/README.md b/uncompressed/nextcloud-cospend/README.md new file mode 100644 index 0000000..09d23cf --- /dev/null +++ b/uncompressed/nextcloud-cospend/README.md @@ -0,0 +1,24 @@ +# Ferdi recipe for Nextcloud Cospend + +Nextcloud Cospend is a group/shared budget manager. +It was inspired by the great [IHateMoney](https://github.com/spiral-project/ihatemoney/). + +To add Nextcloud Cospend 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 (`app_black.svg`). + +## Links + +Ferdi: + +- [Ferdi](https://getferdi.com/) +- [Ferdi recipes](https://github.com/getferdi/recipes) + +Nextcloud: + +- [Nextcloud](https://nextcloud.com/) +- [Nextcloud Cospend](https://apps.nextcloud.com/apps/cospend) diff --git a/uncompressed/nextcloud-cospend/icon.png b/uncompressed/nextcloud-cospend/icon.png new file mode 100644 index 0000000..f41b2bb Binary files /dev/null and b/uncompressed/nextcloud-cospend/icon.png differ diff --git a/uncompressed/nextcloud-cospend/icon.svg b/uncompressed/nextcloud-cospend/icon.svg new file mode 100644 index 0000000..4e787bf --- /dev/null +++ b/uncompressed/nextcloud-cospend/icon.svg @@ -0,0 +1,113 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uncompressed/nextcloud-cospend/index.js b/uncompressed/nextcloud-cospend/index.js new file mode 100644 index 0000000..8547bce --- /dev/null +++ b/uncompressed/nextcloud-cospend/index.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = Franz => class NextcloudCarnet extends Franz { + buildUrl(url) { + return `${url}/apps/cospend/`; + } +}; diff --git a/uncompressed/nextcloud-cospend/package.json b/uncompressed/nextcloud-cospend/package.json new file mode 100644 index 0000000..89ae0c9 --- /dev/null +++ b/uncompressed/nextcloud-cospend/package.json @@ -0,0 +1,16 @@ +{ + "id": "nextcloud-cospend", + "name": "Nextcloud Cospend", + "version": "1.0.0", + "description": "Ferdi recipe for Nextcloud Cospend. Nextcloud Cospend is a group/shared budget manager.", + "main": "index.js", + "author": "Edgars Andersons ", + "license": "MIT", + "repository": "https://github.com/eandersons/ferdi-recipe-nextcloud-cospend", + "config": { + "hasNotificationSound": true, + "hasIndirectMessages": true, + "hasCustomUrl": true, + "serviceURL": "https://{nextcloud}/apps/cospend/" + } +} diff --git a/uncompressed/nextcloud-cospend/service.css b/uncompressed/nextcloud-cospend/service.css new file mode 100644 index 0000000..764531b --- /dev/null +++ b/uncompressed/nextcloud-cospend/service.css @@ -0,0 +1,12 @@ +/* Hide all app links and contacts menu link in the top menu except for +Cospend */ +#appmenu li:not([data-id="cospend"]), #contactsmenu {display: none;} + +/* Change the cursor to the default for Nextcloud home, Cospend and settings +links in the top menu and disable them */ +#nextcloud, #appmenu li[data-id="cospend"] a, #settings { + cursor:default; pointer-events: none; +} + +/* Hide "More" link in the top menu */ +#more-apps {display: none !important;} diff --git a/uncompressed/nextcloud-cospend/webview.js b/uncompressed/nextcloud-cospend/webview.js new file mode 100644 index 0000000..53496fe --- /dev/null +++ b/uncompressed/nextcloud-cospend/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-70-g09d2