aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/hangoutschat
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-07-31 15:28:23 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-07-31 15:28:23 +0530
commit97697e3d069972844b2912a93022f4a4904a40d6 (patch)
tree53faff30fbac9d72042f593dfe1c547809f4f121 /recipes/hangoutschat
parentAllow any url in the custom-service to allow for sites like 'http://translate... (diff)
downloadferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.gz
ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.zst
ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.zip
Fixed eslintrc as root for this folder; Reformatted all files.
Diffstat (limited to 'recipes/hangoutschat')
-rw-r--r--recipes/hangoutschat/index.js7
-rw-r--r--recipes/hangoutschat/webview.js12
2 files changed, 9 insertions, 10 deletions
diff --git a/recipes/hangoutschat/index.js b/recipes/hangoutschat/index.js
index 2c8b220..c6173fa 100644
--- a/recipes/hangoutschat/index.js
+++ b/recipes/hangoutschat/index.js
@@ -1,6 +1,5 @@
1var os = require('os') 1const os = require('os');
2 2
3// just pass through Franz 3// just pass through Franz
4module.exports = Franz => 4module.exports = Franz => class HangoutsChat extends Franz {
5 class HangoutsChat extends Franz { 5};
6 };
diff --git a/recipes/hangoutschat/webview.js b/recipes/hangoutschat/webview.js
index d344ad7..0f17116 100644
--- a/recipes/hangoutschat/webview.js
+++ b/recipes/hangoutschat/webview.js
@@ -1,25 +1,25 @@
1module.exports = (Franz) => { 1module.exports = (Franz) => {
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
5 // class corresponding to the bold text that is visible for room messages 5 // class corresponding to the bold text that is visible for room messages
6 const indirectMessageSelector = "div.V6.CL.V2.X9.Y2 span.akt span.XU"; 6 const indirectMessageSelector = 'div.V6.CL.V2.X9.Y2 span.akt span.XU';
7 7
8 const getMessages = function getMessages() { 8 const getMessages = function getMessages() {
9 // get unread direct messages 9 // get unread direct messages
10 let directCount = Number(document.querySelector(directMessageSelector).innerText) 10 const directCount = Number(document.querySelector(directMessageSelector).innerText);
11 11
12 // get unread indirect messages 12 // get unread indirect messages
13 let indirectCount = Number(document.querySelector(indirectMessageSelector).innerText); 13 const indirectCount = Number(document.querySelector(indirectMessageSelector).innerText);
14 14
15 // set Franz badge 15 // set Franz badge
16 Franz.setBadge(directCount, indirectCount); 16 Franz.setBadge(directCount, indirectCount);
17 }; 17 };
18 18
19 document.addEventListener("click", (e) => { 19 document.addEventListener('click', (e) => {
20 const { tagName, target, href } = e.target; 20 const { tagName, target, href } = e.target;
21 21
22 if (tagName === "A" && target === "_blank") { 22 if (tagName === 'A' && target === '_blank') {
23 e.preventDefault(); 23 e.preventDefault();
24 e.stopImmediatePropagation(); 24 e.stopImmediatePropagation();
25 window.open(href); 25 window.open(href);