From 8a0971ff9f41fdaa1af15e88740ce9479e1ec6ea Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 20 Jun 2021 11:08:00 +0530 Subject: Added new services - 'air-droid' - 'basecamp' - 'box' - 'buffer' - 'chatra' - 'easy-redmine' - 'feedbin' - 'iCloud' - 'jollor' - 'nomadlist' - 'paymo' - 'pivotal-tracker' - 'plan' - 'podio' - 'protonet' - 'teamleader' --- recipes/chatra/webview.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 recipes/chatra/webview.js (limited to 'recipes/chatra/webview.js') 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 @@ +const path = require('path'); + +module.exports = (Franz, options) => { + const getMessages = () => { + // get new conversations in My Queue + const myQueue = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:my"] .count').not('.count--gray').text(); + + // get all missed conversations + const missed = $('.super-nav a.super-nav__item.js-from-super-to-nav[href^="/chat/box:missed"] .count').text(); + + // set Franz badge + // myQueue => New conversations in My Queue + // missed => All missed conversations + Franz.setBadge(myQueue, missed); + }; + + // check for new messages every second and update Franz badge + Franz.loop(getMessages); +}; -- cgit v1.2.3-70-g09d2