diff options
-rw-r--r-- | all.json | 12 | ||||
-rw-r--r-- | recipes/circuit/webview.js | 1 | ||||
-rw-r--r-- | recipes/proton-mail/webview.js | 4 | ||||
-rw-r--r-- | recipes/ringcentral/icon.svg | 1 | ||||
-rw-r--r-- | recipes/ringcentral/index.js | 1 | ||||
-rw-r--r-- | recipes/ringcentral/package.json | 15 | ||||
-rw-r--r-- | recipes/ringcentral/webview.js | 19 |
7 files changed, 50 insertions, 3 deletions
@@ -1393,6 +1393,18 @@ | |||
1393 | }, | 1393 | }, |
1394 | { | 1394 | { |
1395 | "featured": false, | 1395 | "featured": false, |
1396 | "id": "ringcentral", | ||
1397 | "name": "RingCentral", | ||
1398 | "version": "1.0.0", | ||
1399 | "aliases": [ | ||
1400 | "Glip" | ||
1401 | ], | ||
1402 | "icons": { | ||
1403 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/ringcentral/icon.svg" | ||
1404 | } | ||
1405 | }, | ||
1406 | { | ||
1407 | "featured": false, | ||
1396 | "id": "riseup", | 1408 | "id": "riseup", |
1397 | "name": "Riseup.net", | 1409 | "name": "Riseup.net", |
1398 | "version": "1.1.3", | 1410 | "version": "1.1.3", |
diff --git a/recipes/circuit/webview.js b/recipes/circuit/webview.js index ab1175f..ce74eef 100644 --- a/recipes/circuit/webview.js +++ b/recipes/circuit/webview.js | |||
@@ -3,7 +3,6 @@ | |||
3 | module.exports = Ferdi => { | 3 | module.exports = Ferdi => { |
4 | const getMessages = function getMessages() { | 4 | const getMessages = function getMessages() { |
5 | // Initialize empty vars | 5 | // Initialize empty vars |
6 | var unread = 0; | ||
7 | var match = []; | 6 | var match = []; |
8 | // Get value of <title> tag where in case of new messages the number of messages appear | 7 | // Get value of <title> tag where in case of new messages the number of messages appear |
9 | const titleValue = document.querySelector('title').text; | 8 | const titleValue = document.querySelector('title').text; |
diff --git a/recipes/proton-mail/webview.js b/recipes/proton-mail/webview.js index 89e5dab..455a0c4 100644 --- a/recipes/proton-mail/webview.js +++ b/recipes/proton-mail/webview.js | |||
@@ -2,10 +2,10 @@ module.exports = Ferdi => { | |||
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | let unreadCount = 0; | 3 | let unreadCount = 0; |
4 | // Loop over all displayed counters and take the highest one (from the "All Mail" folder) | 4 | // Loop over all displayed counters and take the highest one (from the "All Mail" folder) |
5 | document.querySelectorAll('.navigation-counter-item').forEach(counterElement => { | 5 | for (const counterElement of document.querySelectorAll('.navigation-counter-item')) { |
6 | const unreadCounter = Ferdi.safeParseInt(counterElement.textContent); | 6 | const unreadCounter = Ferdi.safeParseInt(counterElement.textContent); |
7 | unreadCount = Math.max(unreadCount, unreadCounter); | 7 | unreadCount = Math.max(unreadCount, unreadCounter); |
8 | }); | 8 | } |
9 | 9 | ||
10 | Ferdi.setBadge(unreadCount); | 10 | Ferdi.setBadge(unreadCount); |
11 | }; | 11 | }; |
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 @@ | |||
1 | module.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 | }; | ||