diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/nextcloud-deck/README.md | 23 | ||||
-rw-r--r-- | recipes/nextcloud-deck/icon.svg | 9 | ||||
-rw-r--r-- | recipes/nextcloud-deck/index.js | 1 | ||||
-rw-r--r-- | recipes/nextcloud-deck/package.json | 14 | ||||
-rw-r--r-- | recipes/nextcloud-deck/service.css | 41 | ||||
-rw-r--r-- | recipes/nextcloud-deck/webview.js | 20 |
6 files changed, 108 insertions, 0 deletions
diff --git a/recipes/nextcloud-deck/README.md b/recipes/nextcloud-deck/README.md new file mode 100644 index 0000000..e438ccb --- /dev/null +++ b/recipes/nextcloud-deck/README.md | |||
@@ -0,0 +1,23 @@ | |||
1 | # Ferdium recipe for Nextcloud News | ||
2 | |||
3 | Nextcloud Deck is a kanban style organization tool aimed at personal planning and project organization for teams integrated with Nextcloud. | ||
4 | |||
5 | To add Nextcloud Deck service to Ferdium, Nextcloud server address should be provided in the field "Custom server". | ||
6 | |||
7 | ## Credits | ||
8 | |||
9 | This recipe is based on [`recipe-nextcloud-tasks`](https://github.com/meetfranz/recipe-nextcloud-tasks). | ||
10 | |||
11 | Icon was sourced from <https://github.com/nextcloud/deck/tree/main/img> (`deck.svg`, as `favicon.svg` seems to be malformed currently) and I added the rounded blue square in the background. If someone can find or make an icon that better matches the other Nextcloud services, please do. | ||
12 | |||
13 | ## Links | ||
14 | |||
15 | Ferdium: | ||
16 | |||
17 | - [Ferdium](https://ferdium.org/) | ||
18 | - [Ferdium recipes](https://github.com/ferdium/ferdium-recipes) | ||
19 | |||
20 | Nextcloud: | ||
21 | |||
22 | - [Nextcloud](https://nextcloud.com/) | ||
23 | - [Nextcloud Deck](https://apps.nextcloud.com/apps/deck) | ||
diff --git a/recipes/nextcloud-deck/icon.svg b/recipes/nextcloud-deck/icon.svg new file mode 100644 index 0000000..badb802 --- /dev/null +++ b/recipes/nextcloud-deck/icon.svg | |||
@@ -0,0 +1,9 @@ | |||
1 | <svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" viewBox="0 0 16 16"> | ||
2 | <g fill="#fff"> | ||
3 | <rect ry="2.5" height="16" width="16" x="0" y="0" fill="#0082c9"/> | ||
4 | <rect ry="1" height="8" width="14" y="7" x="1"/> | ||
5 | <rect ry=".5" height="1" width="12" y="5" x="2"/> | ||
6 | <rect ry=".5" height="1" width="10" y="3" x="3"/> | ||
7 | <rect ry=".5" height="1" width="8" y="1" x="4"/> | ||
8 | </g> | ||
9 | </svg> | ||
diff --git a/recipes/nextcloud-deck/index.js b/recipes/nextcloud-deck/index.js new file mode 100644 index 0000000..dd41f72 --- /dev/null +++ b/recipes/nextcloud-deck/index.js | |||
@@ -0,0 +1 @@ | |||
module.exports = Ferdium => Ferdium; | |||
diff --git a/recipes/nextcloud-deck/package.json b/recipes/nextcloud-deck/package.json new file mode 100644 index 0000000..7d2be65 --- /dev/null +++ b/recipes/nextcloud-deck/package.json | |||
@@ -0,0 +1,14 @@ | |||
1 | { | ||
2 | "id": "nextcloud-deck", | ||
3 | "name": "Nextcloud Deck", | ||
4 | "version": "1.0.0", | ||
5 | "license": "MIT", | ||
6 | "repository": "https://github.com/mindcombatant/ferdium-recipes/tree/master/recipes/nextcloud-deck/", | ||
7 | "config": { | ||
8 | "hasNotificationSound": true, | ||
9 | "hasTeamId": true, | ||
10 | "urlInputPrefix": "https://", | ||
11 | "urlInputSuffix": "/apps/deck/", | ||
12 | "serviceURL": "https://{teamId}/apps/deck/" | ||
13 | } | ||
14 | } | ||
diff --git a/recipes/nextcloud-deck/service.css b/recipes/nextcloud-deck/service.css new file mode 100644 index 0000000..0bfd055 --- /dev/null +++ b/recipes/nextcloud-deck/service.css | |||
@@ -0,0 +1,41 @@ | |||
1 | /* Hide all app links and contacts menu link in the top menu except for | ||
2 | Deck */ | ||
3 | #appmenu li:not([data-id='deck']), | ||
4 | #contactsmenu { | ||
5 | display: none; | ||
6 | } | ||
7 | |||
8 | /* Change the cursor to the default for Nextcloud home and Deck | ||
9 | links in the top menu and disable them */ | ||
10 | #nextcloud, | ||
11 | #appmenu li[data-id='deck'] a { | ||
12 | cursor: default; | ||
13 | pointer-events: none; | ||
14 | } | ||
15 | |||
16 | /* Hide all settings options, except the option to log out */ | ||
17 | #settings #expanddiv li:not([data-id='logout']) { | ||
18 | display: none; | ||
19 | } | ||
20 | |||
21 | /* Fix the margin of the dropdown */ | ||
22 | #settings #expanddiv, | ||
23 | #settings #expanddiv > ul { | ||
24 | min-height: 0; | ||
25 | } | ||
26 | |||
27 | /* Hide "More" link in the top menu */ | ||
28 | #more-apps { | ||
29 | display: none !important; | ||
30 | } | ||
31 | |||
32 | /* Hide notifications that are not related to Deck */ | ||
33 | .notifications .notification-wrapper .notification:not([object_type="deck"]) { | ||
34 | display: none; | ||
35 | } | ||
36 | |||
37 | /* Hide "Dismiss all notifications" as this action will dismiss also hidden | ||
38 | notifications */ | ||
39 | .notification-wrapper .dismiss-all { | ||
40 | display: none; | ||
41 | } | ||
diff --git a/recipes/nextcloud-deck/webview.js b/recipes/nextcloud-deck/webview.js new file mode 100644 index 0000000..33bf0c5 --- /dev/null +++ b/recipes/nextcloud-deck/webview.js | |||
@@ -0,0 +1,20 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | ||
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | const getMessages = () => { | ||
9 | const directSelector = document.querySelector( | ||
10 | '.subscriptions-feed .app-navigation-entry-utils-counter', | ||
11 | ); | ||
12 | const direct = directSelector ? Ferdium.safeParseInt(directSelector.textContent) : 0; | ||
13 | |||
14 | Ferdium.setBadge(direct); | ||
15 | }; | ||
16 | |||
17 | Ferdium.loop(getMessages); | ||
18 | |||
19 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
20 | }; | ||