aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/ring-central
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2023-07-26 06:29:03 -0600
committerLibravatar GitHub <noreply@github.com>2023-07-26 17:59:03 +0530
commit9b8f01716774a960073e944823ab727cc867a8f6 (patch)
tree732b83770baa78f5cf12776aaa33ce65bebfa418 /recipes/ring-central
parentAdd Excalidraw recipe (#393) (diff)
downloadferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.gz
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.zst
ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.zip
chore: improve lint setup (#397)
- update eslint config to closely mirror the ones from ferdium-app - add .eslintignore - opt in to eslint `reportUnusedDisableDirectives` config option - remove `trailingComma: all` from `prettier` config which is default in `prettier` v3 - autofix or disable a lot of lint issues throughout codebase - add `volta` configuration to `package.json` to autoload correct `node` and `pnpm` versions - upgrade all `eslint` and `prettier` related dependencies to latest - update lint:fix npm script - reformat touched files with prettier - bumped up minor version for all recipes that have changes - introduced injection of 'service.css' where it was missing in many recipes --------- Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'recipes/ring-central')
-rw-r--r--recipes/ring-central/icon.svg1
-rw-r--r--recipes/ring-central/index.js1
-rw-r--r--recipes/ring-central/package.json15
-rw-r--r--recipes/ring-central/webview.js27
4 files changed, 44 insertions, 0 deletions
diff --git a/recipes/ring-central/icon.svg b/recipes/ring-central/icon.svg
new file mode 100644
index 0000000..e30813e
--- /dev/null
+++ b/recipes/ring-central/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/ring-central/index.js b/recipes/ring-central/index.js
new file mode 100644
index 0000000..dd41f72
--- /dev/null
+++ b/recipes/ring-central/index.js
@@ -0,0 +1 @@
module.exports = Ferdium => Ferdium;
diff --git a/recipes/ring-central/package.json b/recipes/ring-central/package.json
new file mode 100644
index 0000000..ee21fb3
--- /dev/null
+++ b/recipes/ring-central/package.json
@@ -0,0 +1,15 @@
1{
2 "id": "ring-central",
3 "name": "RingCentral",
4 "version": "1.2.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/ring-central/webview.js b/recipes/ring-central/webview.js
new file mode 100644
index 0000000..68a688a
--- /dev/null
+++ b/recipes/ring-central/webview.js
@@ -0,0 +1,27 @@
1function _interopRequireDefault(obj) {
2 return obj && obj.__esModule ? obj : { default: obj };
3}
4
5const _path = _interopRequireDefault(require('path'));
6
7module.exports = Ferdium => {
8 const getMessages = () => {
9 let directCount = 0;
10 let indirectCount = 0;
11
12 const messageCountElement = document.querySelector('#Message-umi');
13 if (messageCountElement) {
14 directCount = Ferdium.safeParseInt(messageCountElement.textContent);
15 }
16
17 const unreadChats = document.querySelectorAll('.has-unread');
18 // unreadChats includes direct messages - do not count them
19 indirectCount = unreadChats.length - directCount;
20
21 Ferdium.setBadge(directCount, indirectCount);
22 };
23
24 Ferdium.loop(getMessages);
25
26 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
27};