From b7bfaff13d55e686ea65c89ba57c117703b5d4ca Mon Sep 17 00:00:00 2001 From: Edgars Date: Thu, 29 Oct 2020 11:52:18 +0200 Subject: Add recipe for Nextcloud (#343) --- recipes/nextcloud/README.md | 24 ++++++++++++++++++++++++ recipes/nextcloud/icon.png | Bin 0 -> 38787 bytes recipes/nextcloud/icon.svg | 1 + recipes/nextcloud/index.js | 7 +++++++ recipes/nextcloud/package.json | 16 ++++++++++++++++ recipes/nextcloud/webview.js | 19 +++++++++++++++++++ 6 files changed, 67 insertions(+) create mode 100644 recipes/nextcloud/README.md create mode 100644 recipes/nextcloud/icon.png create mode 100644 recipes/nextcloud/icon.svg create mode 100644 recipes/nextcloud/index.js create mode 100644 recipes/nextcloud/package.json create mode 100644 recipes/nextcloud/webview.js diff --git a/recipes/nextcloud/README.md b/recipes/nextcloud/README.md new file mode 100644 index 0000000..6703021 --- /dev/null +++ b/recipes/nextcloud/README.md @@ -0,0 +1,24 @@ +# Ferdi recipe for Nextcloud + +Nextcloud is a safe home for all your data – community-driven, free & open source. +The self-hosted productivity platform that keeps you in control. +Share and collaborate on documents, send and receive email, manage your calendar and have video chats without data leaks. + +To add Nextcloud 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-touch.svg`). + +## Links + +Ferdi: + +- [Ferdi](https://getferdi.com/) +- [Ferdi recipes](https://github.com/getferdi/recipes) + +Nextcloud: + +- [Nextcloud](https://nextcloud.com/) diff --git a/recipes/nextcloud/icon.png b/recipes/nextcloud/icon.png new file mode 100644 index 0000000..70ae684 Binary files /dev/null and b/recipes/nextcloud/icon.png differ diff --git a/recipes/nextcloud/icon.svg b/recipes/nextcloud/icon.svg new file mode 100644 index 0000000..82dfdc4 --- /dev/null +++ b/recipes/nextcloud/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recipes/nextcloud/index.js b/recipes/nextcloud/index.js new file mode 100644 index 0000000..4e772d7 --- /dev/null +++ b/recipes/nextcloud/index.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = Franz => class Nextcloud extends Franz { + buildUrl(url) { + return `${url}/`; + } +}; diff --git a/recipes/nextcloud/package.json b/recipes/nextcloud/package.json new file mode 100644 index 0000000..92f713e --- /dev/null +++ b/recipes/nextcloud/package.json @@ -0,0 +1,16 @@ +{ + "id": "nextcloud", + "name": "Nextcloud", + "version": "1.0.0", + "description": "Ferdi recipe for Nextcloud. Nextcloud is a safe home for all your data – community-driven, free & open source.", + "main": "index.js", + "author": "Edgars Andersons ", + "license": "MIT", + "repository": "https://github.com/eandersons/ferdi-recipe-nextcloud", + "config": { + "hasNotificationSound": true, + "hasIndirectMessages": true, + "hasCustomUrl": true, + "serviceURL": "https://{nextcloud}/" + } +} diff --git a/recipes/nextcloud/webview.js b/recipes/nextcloud/webview.js new file mode 100644 index 0000000..b7589de --- /dev/null +++ b/recipes/nextcloud/webview.js @@ -0,0 +1,19 @@ +"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( + '.notifications .notification-container .notification-wrapper li .notification' + ).length; + + Franz.setBadge(direct); + }; + + Franz.loop(getMessages); +}; -- cgit v1.2.3-54-g00ecf