diff options
author | Bennett <hello@vantezzen.io> | 2019-12-11 19:52:52 +0100 |
---|---|---|
committer | Bennett <hello@vantezzen.io> | 2019-12-11 19:52:52 +0100 |
commit | 3c374271bff116415bbc680739e597d0c05e529a (patch) | |
tree | 333584c7044eb2f585e356057b9c54fec93e3e07 /uncompressed/zimbra/webview.js | |
parent | Merge branch 'master' of https://github.com/getferdi/recipes (diff) | |
download | ferdium-recipes-3c374271bff116415bbc680739e597d0c05e529a.tar.gz ferdium-recipes-3c374271bff116415bbc680739e597d0c05e529a.tar.zst ferdium-recipes-3c374271bff116415bbc680739e597d0c05e529a.zip |
Add Zimbra recipe
Diffstat (limited to 'uncompressed/zimbra/webview.js')
-rw-r--r-- | uncompressed/zimbra/webview.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/uncompressed/zimbra/webview.js b/uncompressed/zimbra/webview.js new file mode 100644 index 0000000..aaaa952 --- /dev/null +++ b/uncompressed/zimbra/webview.js | |||
@@ -0,0 +1,18 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = function getMessages() { | ||
5 | const { title } = document; | ||
6 | const regex = /\d+/; | ||
7 | |||
8 | if (regex.test(title)) { | ||
9 | Franz.setBadge( | ||
10 | Number(regex.exec(title)[0]) | ||
11 | ); | ||
12 | } else { | ||
13 | Franz.setBadge(0); | ||
14 | } | ||
15 | }; | ||
16 | |||
17 | Franz.loop(getMessages); | ||
18 | }; \ No newline at end of file | ||