diff options
Diffstat (limited to 'recipes/nextcloud-news')
-rw-r--r-- | recipes/nextcloud-news/README.md | 23 | ||||
-rw-r--r-- | recipes/nextcloud-news/icon.svg | 2 | ||||
-rw-r--r-- | recipes/nextcloud-news/index.js | 1 | ||||
-rw-r--r-- | recipes/nextcloud-news/package.json | 14 | ||||
-rw-r--r-- | recipes/nextcloud-news/service.css | 12 | ||||
-rw-r--r-- | recipes/nextcloud-news/webview.js | 18 |
6 files changed, 70 insertions, 0 deletions
diff --git a/recipes/nextcloud-news/README.md b/recipes/nextcloud-news/README.md new file mode 100644 index 0000000..2d09cf5 --- /dev/null +++ b/recipes/nextcloud-news/README.md | |||
@@ -0,0 +1,23 @@ | |||
1 | # Ferdi recipe for Nextcloud News | ||
2 | |||
3 | Nextcloud News is a RSS news reading app for Nextcloud. | ||
4 | |||
5 | To add Nextcloud News service to Ferdi, 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 | Icons were sourced from <https://github.com/nextcloud/tasks/news/master/img> (`favicon.svg`). | ||
12 | |||
13 | ## Links | ||
14 | |||
15 | Ferdi: | ||
16 | |||
17 | - [Ferdi](https://getferdi.com/) | ||
18 | - [Ferdi recipes](https://github.com/getferdi/recipes) | ||
19 | |||
20 | Nextcloud: | ||
21 | |||
22 | - [Nextcloud](https://nextcloud.com/) | ||
23 | - [Nextcloud News](https://apps.nextcloud.com/apps/news) | ||
diff --git a/recipes/nextcloud-news/icon.svg b/recipes/nextcloud-news/icon.svg new file mode 100644 index 0000000..c40109e --- /dev/null +++ b/recipes/nextcloud-news/icon.svg | |||
@@ -0,0 +1,2 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" id="svg4551" viewBox="0 0 32 32" x="0px" y="0px" enable-background="new 0 0 595.275 311.111" width="32" height="32" xml:space="preserve" version="1.1"><metadata id="metadata4557"><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/></cc:Work></rdf:RDF></metadata><defs id="defs4555"/><rect id="rect4547" fill="#0082c9" x="0" y="-.0000052588" width="32" height="32" ry="5" rx="5"/><path style="fill:#ffffff;stroke-width:0.92142856" d="m 3.7714273,3.1652662 c -0.5104715,0 -0.9214286,0.4109573 -0.9214286,0.9214286 v 1.842857 c 0,0.5104714 0.4109571,0.9214286 0.9214286,0.9214286 H 27.72857 c 0.510471,0 0.921428,-0.4109572 0.921428,-0.9214286 v -1.842857 c 0,-0.5104713 -0.410957,-0.9214286 -0.921428,-0.9214286 z m 0,7.3714278 c -0.5104715,0 -0.9214286,0.410958 -0.9214286,0.921429 v 1.842857 c 0,0.510472 0.4109571,0.921429 0.9214286,0.921429 H 20.357141 c 0.510471,0 0.921429,-0.410957 0.921429,-0.921429 v -1.842857 c 0,-0.510471 -0.410958,-0.921429 -0.921429,-0.921429 z m 0,7.371429 c -0.5104715,0 -0.9214286,0.410957 -0.9214286,0.921428 v 1.842858 c 0,0.510471 0.4109571,0.921429 0.9214286,0.921429 H 25.885712 c 0.510472,0 0.921429,-0.410958 0.921429,-0.921429 v -1.842858 c 0,-0.510471 -0.410957,-0.921428 -0.921429,-0.921428 z m 0,7.371429 c -0.5104715,0 -0.9214286,0.410958 -0.9214286,0.921429 v 1.842857 c 0,0.510472 0.4109571,0.921429 0.9214286,0.921429 H 14.82857 c 0.510472,0 0.921429,-0.410957 0.921429,-0.921429 v -1.842857 c 0,-0.510471 -0.410957,-0.921429 -0.921429,-0.921429 z" id="path4725"/></svg> \ No newline at end of file | ||
diff --git a/recipes/nextcloud-news/index.js b/recipes/nextcloud-news/index.js new file mode 100644 index 0000000..abe7b52 --- /dev/null +++ b/recipes/nextcloud-news/index.js | |||
@@ -0,0 +1 @@ | |||
module.exports = Ferdi => class NextcloudNews extends Ferdi {}; | |||
diff --git a/recipes/nextcloud-news/package.json b/recipes/nextcloud-news/package.json new file mode 100644 index 0000000..692359a --- /dev/null +++ b/recipes/nextcloud-news/package.json | |||
@@ -0,0 +1,14 @@ | |||
1 | { | ||
2 | "id": "nextcloud-news", | ||
3 | "name": "Nextcloud News", | ||
4 | "version": "1.0.0", | ||
5 | "license": "MIT", | ||
6 | "repository": "https://github.com/csolisr/recipes/tree/master/recipes/nextcloud-news/", | ||
7 | "config": { | ||
8 | "hasNotificationSound": true, | ||
9 | "hasTeamId": true, | ||
10 | "urlInputPrefix": "https://", | ||
11 | "urlInputSuffix": "/apps/news/", | ||
12 | "serviceURL": "https://{teamId}/apps/news/" | ||
13 | } | ||
14 | } | ||
diff --git a/recipes/nextcloud-news/service.css b/recipes/nextcloud-news/service.css new file mode 100644 index 0000000..4974300 --- /dev/null +++ b/recipes/nextcloud-news/service.css | |||
@@ -0,0 +1,12 @@ | |||
1 | /* Hide all app links and contacts menu link in the top menu except for | ||
2 | News */ | ||
3 | #appmenu li:not([data-id="news"]), #contactsmenu {display: none;} | ||
4 | |||
5 | /* Change the cursor to the default for Nextcloud home, News and settings | ||
6 | links in the top menu and disable them */ | ||
7 | #nextcloud, #appmenu li[data-id="news"] a, #settings { | ||
8 | cursor: default; pointer-events: none; | ||
9 | } | ||
10 | |||
11 | /* Hide "More" link in the top menu */ | ||
12 | #more-apps {display: none !important;} | ||
diff --git a/recipes/nextcloud-news/webview.js b/recipes/nextcloud-news/webview.js new file mode 100644 index 0000000..048ac7d --- /dev/null +++ b/recipes/nextcloud-news/webview.js | |||
@@ -0,0 +1,18 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
4 | |||
5 | module.exports = Ferdi => { | ||
6 | const getMessages = () => { | ||
7 | const selector = document.querySelector( | ||
8 | '.subscriptions-feed .app-navigation-entry-utils-counter', | ||
9 | ); | ||
10 | const direct = selector ? Ferdi.safeParseInt(selector.innerText) : 0; | ||
11 | |||
12 | Ferdi.setBadge(direct); | ||
13 | }; | ||
14 | |||
15 | Ferdi.loop(getMessages); | ||
16 | |||
17 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
18 | }; | ||