aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/hangoutschat
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-27 18:13:24 +0530
committerLibravatar GitHub <noreply@github.com>2021-08-27 18:13:24 +0530
commit155c4b832281348c16be1f4ef667e6e23dbf1bd8 (patch)
treed144e2de2e6c7fb2e334246e8a4aecdbeb08ef8d /recipes/hangoutschat
parentdocs: fixed template file for creating recipe. (diff)
downloadferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.gz
ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.zst
ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.zip
chore: normalized all recipes to ensure compatibility with es6 (#639)
- Removed some calls to set badge with '0' all the time. - Removed all 'sourceMaps' since they are all outdated atm.
Diffstat (limited to 'recipes/hangoutschat')
-rw-r--r--recipes/hangoutschat/index.js5
-rw-r--r--recipes/hangoutschat/package.json2
-rw-r--r--recipes/hangoutschat/webview.js11
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 @@
1const os = require('os'); 1module.exports = Ferdi => class HangoutsChat extends Ferdi {
2
3// just pass through Franz
4module.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 @@
1module.exports = (Franz) => { 1module.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};