diff options
author | 2023-05-15 00:00:50 +0000 | |
---|---|---|
committer | 2023-05-15 01:00:50 +0100 | |
commit | 48c07ad8f8bc69f71ccbfe36642210e9b840c1c1 (patch) | |
tree | fd79725574d00f07c579c6d9551e8f841adfd8c1 /recipes/nextcloud-deck/webview.js | |
parent | Add awork recipe (#355) (diff) | |
download | ferdium-recipes-48c07ad8f8bc69f71ccbfe36642210e9b840c1c1.tar.gz ferdium-recipes-48c07ad8f8bc69f71ccbfe36642210e9b840c1c1.tar.zst ferdium-recipes-48c07ad8f8bc69f71ccbfe36642210e9b840c1c1.zip |
Add Nextcloud Deck Recipe (#360)
Diffstat (limited to 'recipes/nextcloud-deck/webview.js')
-rw-r--r-- | recipes/nextcloud-deck/webview.js | 20 |
1 files changed, 20 insertions, 0 deletions
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 | }; | ||