diff options
author | 2019-09-28 12:10:25 +0200 | |
---|---|---|
committer | 2019-09-28 12:10:25 +0200 | |
commit | 728d339739b63e9bb59e457e4a84fe9a65b93fc9 (patch) | |
tree | a0fc6180ea26fa9ef397458e8eb6491031d6437d /uncompressed/msteams/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/msteams/webview.js')
-rw-r--r-- | uncompressed/msteams/webview.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/uncompressed/msteams/webview.js b/uncompressed/msteams/webview.js new file mode 100644 index 0000000..d614097 --- /dev/null +++ b/uncompressed/msteams/webview.js | |||
@@ -0,0 +1,29 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const path = require('path'); | ||
4 | |||
5 | window.electronSafeIpc = { | ||
6 | send: () => null, | ||
7 | on: () => null | ||
8 | }; | ||
9 | window.desktop = undefined; | ||
10 | |||
11 | module.exports = Franz => { | ||
12 | const getMessages = () => { | ||
13 | let messages = 0; | ||
14 | const badge = document.querySelector('.activity-badge.dot-activity-badge .activity-badge'); | ||
15 | |||
16 | if (badge) { | ||
17 | const value = parseInt(badge.innerHTML, 10); | ||
18 | |||
19 | if (!isNaN(value)) { | ||
20 | messages = value; | ||
21 | } | ||
22 | } | ||
23 | |||
24 | Franz.setBadge(messages); | ||
25 | }; | ||
26 | |||
27 | Franz.injectCSS(path.join(__dirname, 'service.css')); | ||
28 | Franz.loop(getMessages); | ||
29 | }; \ No newline at end of file | ||