aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/zulip
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/zulip
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/zulip')
-rw-r--r--recipes/zulip/index.js10
-rw-r--r--recipes/zulip/webview.js12
2 files changed, 10 insertions, 12 deletions
diff --git a/recipes/zulip/index.js b/recipes/zulip/index.js
index 199d0f4..cd8ffea 100644
--- a/recipes/zulip/index.js
+++ b/recipes/zulip/index.js
@@ -1,13 +1,13 @@
1module.exports = Franz => class Zulip extends Franz { 1module.exports = Franz => class Zulip extends Franz {
2 async validateUrl(url) { 2 async validateUrl(url) {
3 const baseUrl = new window.URL(url); 3 const baseUrl = new window.URL(url);
4 const apiVersion = 'api/v1' 4 const apiVersion = 'api/v1';
5 try { 5 try {
6 const resp = await window.fetch(`${baseUrl.origin}/${apiVersion}/server_settings`, { 6 const resp = await window.fetch(`${baseUrl.origin}/${apiVersion}/server_settings`, {
7 method: 'GET', 7 method: 'GET',
8 headers: { 8 headers: {
9 'Content-Type': 'application/json', 9 'Content-Type': 'application/json',
10 }, 10 },
11 }); 11 });
12 const data = await resp.json(); 12 const data = await resp.json();
13 13
diff --git a/recipes/zulip/webview.js b/recipes/zulip/webview.js
index a595b2c..7a71886 100644
--- a/recipes/zulip/webview.js
+++ b/recipes/zulip/webview.js
@@ -1,9 +1,7 @@
1"use strict";
2
3module.exports = (Franz) => { 1module.exports = (Franz) => {
4 const getMessages = function getMessages() { 2 const getMessages = function getMessages() {
5 const allMessages = Math.round(document.querySelectorAll("#global_filters .top_left_all_messages .count .value")[0].innerText); 3 const allMessages = Math.round(document.querySelectorAll('#global_filters .top_left_all_messages .count .value')[0].innerText);
6 Franz.setBadge(allMessages); 4 Franz.setBadge(allMessages);
7 }; 5 };
8 Franz.loop(getMessages); 6 Franz.loop(getMessages);
9}; 7};