aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/podio/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/podio/webview.js')
-rw-r--r--recipes/podio/webview.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/recipes/podio/webview.js b/recipes/podio/webview.js
new file mode 100644
index 0000000..b1ddc4f
--- /dev/null
+++ b/recipes/podio/webview.js
@@ -0,0 +1,22 @@
1const path = require('path');
2
3module.exports = (Franz, options) => {
4 const getMessages = () => {
5 // get unread messages
6 const updates = document.getElementsByClassName('counter')[0].innerHTML;
7
8 // get conversations in 'My Inbox'
9 //const inbox = document.getElementById('franz').getAttribute('data-inbox');
10
11 // set Franz badge
12 // updates => active unread count
13 // inbox => passive unread count
14 Franz.setBadge(updates, 0);
15 };
16
17 // inject franz.css stylesheet
18 Franz.injectCSS(path.join(__dirname, 'css', 'franz.css'));
19
20 // check for new messages every second and update Franz badge
21 Franz.loop(getMessages);
22};