diff options
author | Vijay A <avijayr@protonmail.com> | 2021-07-31 15:28:23 +0530 |
---|---|---|
committer | Vijay A <avijayr@protonmail.com> | 2021-07-31 15:28:23 +0530 |
commit | 97697e3d069972844b2912a93022f4a4904a40d6 (patch) | |
tree | 53faff30fbac9d72042f593dfe1c547809f4f121 /recipes/zulip | |
parent | Allow any url in the custom-service to allow for sites like 'http://translate... (diff) | |
download | ferdium-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.js | 10 | ||||
-rw-r--r-- | recipes/zulip/webview.js | 12 |
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 @@ | |||
1 | module.exports = Franz => class Zulip extends Franz { | 1 | module.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 | |||
3 | module.exports = (Franz) => { | 1 | module.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 | }; |