aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/ringcentral
diff options
context:
space:
mode:
authorLibravatar deadmeu <deadmeu@gmail.com>2021-11-29 01:58:16 +1100
committerLibravatar GitHub <noreply@github.com>2021-11-28 20:28:16 +0530
commit37485190b18ccd01d01e2bfe68960b32d8ed357a (patch)
treebbc88d7262e5c702c92d74702c009ed30b719a1c /recipes/ringcentral
parentFix skype notification counter for non-English locales(fixes #763) (#775) (diff)
downloadferdium-recipes-37485190b18ccd01d01e2bfe68960b32d8ed357a.tar.gz
ferdium-recipes-37485190b18ccd01d01e2bfe68960b32d8ed357a.tar.zst
ferdium-recipes-37485190b18ccd01d01e2bfe68960b32d8ed357a.zip
Add RingCentral recipe (#776)
Diffstat (limited to 'recipes/ringcentral')
-rw-r--r--recipes/ringcentral/icon.svg1
-rw-r--r--recipes/ringcentral/index.js1
-rw-r--r--recipes/ringcentral/package.json15
-rw-r--r--recipes/ringcentral/webview.js19
4 files changed, 36 insertions, 0 deletions
diff --git a/recipes/ringcentral/icon.svg b/recipes/ringcentral/icon.svg
new file mode 100644
index 0000000..e30813e
--- /dev/null
+++ b/recipes/ringcentral/icon.svg
@@ -0,0 +1 @@
<svg width="1024" height="1024" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><g fill-rule="nonzero" fill="none"><path d="M25 2a5 5 0 0 1 5 5v18a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5h18Z" fill="#FFF"/><path d="M24 0H8a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h16a8 8 0 0 0 8-8V8a8 8 0 0 0-8-8Zm0 3a5 5 0 0 1 5 5v16a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5V8a5 5 0 0 1 5-5h16Z" fill="#FF7A00"/><path d="M11.092 24.672a.434.434 0 0 0 .322-.124.437.437 0 0 0 .125-.321v-12.54a.351.351 0 0 1 .395-.397h8.13a.35.35 0 0 1 .386.397V15.6a.349.349 0 0 1-.386.397h-3.662a.35.35 0 0 0-.403.397v1.735c-.007.395.03.79.112 1.176.085.35.232.681.434.979l2.527 3.965a.898.898 0 0 0 .842.422h3.296c.166 0 .274-.045.324-.137a.325.325 0 0 0-.05-.334l-2.506-4.047c-.116-.166-.073-.297.125-.397l1.758-.792a2.945 2.945 0 0 0 1.376-1.141c.305-.541.456-1.155.436-1.776v-5.75c0-.974-.252-1.714-.756-2.218-.503-.503-1.243-.755-2.218-.755h-11.4c-.954 0-1.688.252-2.202.755-.514.504-.771 1.244-.771 2.219v13.928a.436.436 0 0 0 .123.321.435.435 0 0 0 .322.124h3.321Z" fill="#0684BC"/></g></svg> \ No newline at end of file
diff --git a/recipes/ringcentral/index.js b/recipes/ringcentral/index.js
new file mode 100644
index 0000000..23607bd
--- /dev/null
+++ b/recipes/ringcentral/index.js
@@ -0,0 +1 @@
module.exports = Ferdi => Ferdi;
diff --git a/recipes/ringcentral/package.json b/recipes/ringcentral/package.json
new file mode 100644
index 0000000..0c8ecab
--- /dev/null
+++ b/recipes/ringcentral/package.json
@@ -0,0 +1,15 @@
1{
2 "id": "ringcentral",
3 "name": "RingCentral",
4 "version": "1.0.0",
5 "license": "MIT",
6 "repository": "https://github.com/deadmeu/ferdi-ringcentral",
7 "aliases": [
8 "Glip"
9 ],
10 "config": {
11 "serviceURL": "https://app.ringcentral.com/",
12 "hasNotificationSound": true,
13 "hasIndirectMessages": true
14 }
15}
diff --git a/recipes/ringcentral/webview.js b/recipes/ringcentral/webview.js
new file mode 100644
index 0000000..ba4f50c
--- /dev/null
+++ b/recipes/ringcentral/webview.js
@@ -0,0 +1,19 @@
1module.exports = Ferdi => {
2 const getMessages = () => {
3 let directCount = 0;
4 let indirectCount = 0;
5
6 const messageCountElement = document.querySelector('#Message-umi');
7 if (messageCountElement) {
8 directCount = Ferdi.safeParseInt(messageCountElement.textContent);
9 }
10
11 const unreadChats = document.querySelectorAll('.has-unread');
12 // unreadChats includes direct messages - do not count them
13 indirectCount = unreadChats.length - directCount;
14
15 Ferdi.setBadge(directCount, indirectCount);
16 };
17
18 Ferdi.loop(getMessages);
19};