diff options
author | Vijay A <avijayr@protonmail.com> | 2021-06-20 11:08:00 +0530 |
---|---|---|
committer | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-06-20 05:47:40 +0000 |
commit | 8a0971ff9f41fdaa1af15e88740ce9479e1ec6ea (patch) | |
tree | dbbc5d0bf44f56a1024eae1d9799c47853401e0d /recipes/chatra/webview.js | |
parent | Renamed 'glowingbear' --> 'glowing-bear' and 'ex-google-voice' --> 'google-vo... (diff) | |
download | ferdium-recipes-8a0971ff9f41fdaa1af15e88740ce9479e1ec6ea.tar.gz ferdium-recipes-8a0971ff9f41fdaa1af15e88740ce9479e1ec6ea.tar.zst ferdium-recipes-8a0971ff9f41fdaa1af15e88740ce9479e1ec6ea.zip |
Added new services
- 'air-droid'
- 'basecamp'
- 'box'
- 'buffer'
- 'chatra'
- 'easy-redmine'
- 'feedbin'
- 'iCloud'
- 'jollor'
- 'nomadlist'
- 'paymo'
- 'pivotal-tracker'
- 'plan'
- 'podio'
- 'protonet'
- 'teamleader'
Diffstat (limited to 'recipes/chatra/webview.js')
-rw-r--r-- | recipes/chatra/webview.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/recipes/chatra/webview.js b/recipes/chatra/webview.js new file mode 100644 index 0000000..a8a611c --- /dev/null +++ b/recipes/chatra/webview.js | |||
@@ -0,0 +1,19 @@ | |||
1 | const path = require('path'); | ||
2 | |||
3 | module.exports = (Franz, options) => { | ||
4 | const getMessages = () => { | ||
5 | // get new conversations in My Queue | ||
6 | const myQueue = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:my"] .count').not('.count--gray').text(); | ||
7 | |||
8 | // get all missed conversations | ||
9 | const missed = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:missed"] .count').text(); | ||
10 | |||
11 | // set Franz badge | ||
12 | // myQueue => New conversations in My Queue | ||
13 | // missed => All missed conversations | ||
14 | Franz.setBadge(myQueue, missed); | ||
15 | }; | ||
16 | |||
17 | // check for new messages every second and update Franz badge | ||
18 | Franz.loop(getMessages); | ||
19 | }; | ||