diff options
author | 2023-04-25 00:42:22 +0200 | |
---|---|---|
committer | 2023-04-24 23:42:22 +0100 | |
commit | e91222a6db229f267b3761f3228aaae60435d2bd (patch) | |
tree | af36df837995e9bf46958a152a0960649457e40d /recipes/gotify/webview.js | |
parent | add magnouvean as a contributor for code (#339) [skip ci] (diff) | |
download | ferdium-recipes-e91222a6db229f267b3761f3228aaae60435d2bd.tar.gz ferdium-recipes-e91222a6db229f267b3761f3228aaae60435d2bd.tar.zst ferdium-recipes-e91222a6db229f267b3761f3228aaae60435d2bd.zip |
Add Gotify recipe (#336)
Diffstat (limited to 'recipes/gotify/webview.js')
-rw-r--r-- | recipes/gotify/webview.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/recipes/gotify/webview.js b/recipes/gotify/webview.js new file mode 100644 index 0000000..46762ed --- /dev/null +++ b/recipes/gotify/webview.js | |||
@@ -0,0 +1,16 @@ | |||
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 | let count = document.querySelectorAll('#messages').length; | ||
10 | |||
11 | Ferdium.setBadge(count); | ||
12 | }; | ||
13 | |||
14 | Ferdium.loop(getMessages); | ||
15 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
16 | }; | ||