diff options
Diffstat (limited to 'recipes/hangoutschat')
-rw-r--r-- | recipes/hangoutschat/index.js | 5 | ||||
-rw-r--r-- | recipes/hangoutschat/package.json | 2 | ||||
-rw-r--r-- | recipes/hangoutschat/webview.js | 11 |
3 files changed, 7 insertions, 11 deletions
diff --git a/recipes/hangoutschat/index.js b/recipes/hangoutschat/index.js index c6173fa..6bed9d7 100644 --- a/recipes/hangoutschat/index.js +++ b/recipes/hangoutschat/index.js | |||
@@ -1,5 +1,2 @@ | |||
1 | const os = require('os'); | 1 | module.exports = Ferdi => class HangoutsChat extends Ferdi { |
2 | |||
3 | // just pass through Franz | ||
4 | module.exports = Franz => class HangoutsChat extends Franz { | ||
5 | }; | 2 | }; |
diff --git a/recipes/hangoutschat/package.json b/recipes/hangoutschat/package.json index a6d8ffe..6bbfba4 100644 --- a/recipes/hangoutschat/package.json +++ b/recipes/hangoutschat/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "hangoutschat", | 2 | "id": "hangoutschat", |
3 | "name": "Hangouts Chat", | 3 | "name": "Hangouts Chat", |
4 | "version": "1.4.6", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "google-chat", | 7 | "google-chat", |
diff --git a/recipes/hangoutschat/webview.js b/recipes/hangoutschat/webview.js index 0f17116..0244d33 100644 --- a/recipes/hangoutschat/webview.js +++ b/recipes/hangoutschat/webview.js | |||
@@ -1,4 +1,4 @@ | |||
1 | module.exports = (Franz) => { | 1 | module.exports = (Ferdi) => { |
2 | // class corresponding to the red badge that is visible for direct messages | 2 | // class corresponding to the red badge that is visible for direct messages |
3 | const directMessageSelector = 'div.V6.CL.su.ahD.X9.Y2 span.akt span.XU'; | 3 | const directMessageSelector = 'div.V6.CL.su.ahD.X9.Y2 span.akt span.XU'; |
4 | 4 | ||
@@ -12,10 +12,12 @@ module.exports = (Franz) => { | |||
12 | // get unread indirect messages | 12 | // get unread indirect messages |
13 | const indirectCount = Number(document.querySelector(indirectMessageSelector).innerText); | 13 | const indirectCount = Number(document.querySelector(indirectMessageSelector).innerText); |
14 | 14 | ||
15 | // set Franz badge | 15 | // set Ferdi badge |
16 | Franz.setBadge(directCount, indirectCount); | 16 | Ferdi.setBadge(directCount, indirectCount); |
17 | }; | 17 | }; |
18 | 18 | ||
19 | Ferdi.loop(getMessages); | ||
20 | |||
19 | document.addEventListener('click', (e) => { | 21 | document.addEventListener('click', (e) => { |
20 | const { tagName, target, href } = e.target; | 22 | const { tagName, target, href } = e.target; |
21 | 23 | ||
@@ -25,7 +27,4 @@ module.exports = (Franz) => { | |||
25 | window.open(href); | 27 | window.open(href); |
26 | } | 28 | } |
27 | }); | 29 | }); |
28 | |||
29 | // check for new messages every second and update Franz badge | ||
30 | Franz.loop(getMessages); | ||
31 | }; | 30 | }; |