diff options
author | Bennett <hello@vantezzen.io> | 2019-10-29 10:41:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-29 10:41:16 +0100 |
commit | 3bb0f9af81e71833d1254474edd17cd718aa5b89 (patch) | |
tree | 15f7b9a0871e9ae86b8eb461586aef7770616ee3 /uncompressed/hackmd/webview.js | |
parent | update pulse sms (#8) (diff) | |
parent | add hackmd (diff) | |
download | ferdium-recipes-3bb0f9af81e71833d1254474edd17cd718aa5b89.tar.gz ferdium-recipes-3bb0f9af81e71833d1254474edd17cd718aa5b89.tar.zst ferdium-recipes-3bb0f9af81e71833d1254474edd17cd718aa5b89.zip |
Merge pull request #7 from Armaldio/add-hackmd
add hackmd
Diffstat (limited to 'uncompressed/hackmd/webview.js')
-rw-r--r-- | uncompressed/hackmd/webview.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/uncompressed/hackmd/webview.js b/uncompressed/hackmd/webview.js new file mode 100644 index 0000000..cd3afed --- /dev/null +++ b/uncompressed/hackmd/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | import path from 'path'; | ||
2 | |||
3 | module.exports = (Franz) => { | ||
4 | const getMessages = function getMessages() { | ||
5 | // get unread messages | ||
6 | const count = document.querySelectorAll('.guilds-wrapper .badge').length; | ||
7 | |||
8 | // set Franz badge | ||
9 | Franz.setBadge(count); | ||
10 | }; | ||
11 | |||
12 | // check for new messages every second and update Franz badge | ||
13 | Franz.loop(getMessages); | ||
14 | |||
15 | // Hide download message | ||
16 | Franz.injectCSS(path.join(__dirname, 'service.css')); | ||
17 | }; | ||