diff options
author | 2020-01-25 12:50:08 +0100 | |
---|---|---|
committer | 2020-01-25 12:50:08 +0100 | |
commit | 1bfdd391c8d2607e8917d827d28a06b4a11bde9d (patch) | |
tree | 6ef936e226f8504d10c9c717032cef89a0a775bb /uncompressed/zeplin/webview.js | |
parent | Update recipe_request.md (diff) | |
download | ferdium-recipes-1bfdd391c8d2607e8917d827d28a06b4a11bde9d.tar.gz ferdium-recipes-1bfdd391c8d2607e8917d827d28a06b4a11bde9d.tar.zst ferdium-recipes-1bfdd391c8d2607e8917d827d28a06b4a11bde9d.zip |
#31 Add Zeplin
Diffstat (limited to 'uncompressed/zeplin/webview.js')
-rw-r--r-- | uncompressed/zeplin/webview.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/uncompressed/zeplin/webview.js b/uncompressed/zeplin/webview.js new file mode 100644 index 0000000..2e87537 --- /dev/null +++ b/uncompressed/zeplin/webview.js | |||
@@ -0,0 +1,17 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | const path = require('path'); | ||
4 | |||
5 | module.exports = Franz => { | ||
6 | const getMessages = () => { | ||
7 | const totalNotifications = document.querySelectorAll('#notificationList > .notification').length; | ||
8 | const hasUnread = document.querySelectorAll('#notificationsButton.hasUnread').length > 0; | ||
9 | |||
10 | // set Franz badge | ||
11 | if (hasUnread) { | ||
12 | Franz.setBadge(totalNotifications); | ||
13 | } | ||
14 | }; | ||
15 | |||
16 | Franz.loop(getMessages); | ||
17 | }; | ||