diff options
author | 2019-09-28 12:10:25 +0200 | |
---|---|---|
committer | 2019-09-28 12:10:25 +0200 | |
commit | 728d339739b63e9bb59e457e4a84fe9a65b93fc9 (patch) | |
tree | a0fc6180ea26fa9ef397458e8eb6491031d6437d /uncompressed/sendtask/webview.js | |
parent | Add list of recipes (diff) | |
download | ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.tar.gz ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.tar.zst ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.zip |
Add uncompressed recipes
Diffstat (limited to 'uncompressed/sendtask/webview.js')
-rw-r--r-- | uncompressed/sendtask/webview.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/uncompressed/sendtask/webview.js b/uncompressed/sendtask/webview.js new file mode 100644 index 0000000..d3151ce --- /dev/null +++ b/uncompressed/sendtask/webview.js | |||
@@ -0,0 +1,21 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | const path = require('path'); | ||
4 | |||
5 | module.exports = Franz => { | ||
6 | const getMessages = () => { | ||
7 | const inbox = document.querySelector('.topbar-notificationsButton.has-newNotifications'); | ||
8 | const passiveCount = inbox === null ? 0 : 1; | ||
9 | // set Franz badge | ||
10 | // updates => active unread count | ||
11 | // inbox => passive unread count | ||
12 | Franz.setBadge(0, passiveCount); | ||
13 | }; | ||
14 | |||
15 | // inject franz.css stylesheet | ||
16 | Franz.injectCSS(path.join(__dirname, 'franz.css')); | ||
17 | |||
18 | // check for new messages every second and update Franz badge | ||
19 | Franz.loop(getMessages); | ||
20 | }; | ||
21 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlbmR0YXNrL3dlYnZpZXcuanMiXSwibmFtZXMiOlsicGF0aCIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiLCJnZXRNZXNzYWdlcyIsImluYm94IiwiZG9jdW1lbnQiL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