aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Francisco Marques <franciscopcmarques@gmail.com>2020-10-07 15:24:54 +0100
committerLibravatar GitHub <noreply@github.com>2020-10-07 15:24:54 +0100
commit00ddef3290732403dc1ca02b1c2ae7a7b6a796c3 (patch)
tree9867bd95de83aa825a76f145409c9929ae265a2c
parentAdd recipe for Lark (#315) (diff)
downloadferdium-recipes-00ddef3290732403dc1ca02b1c2ae7a7b6a796c3.tar.gz
ferdium-recipes-00ddef3290732403dc1ca02b1c2ae7a7b6a796c3.tar.zst
ferdium-recipes-00ddef3290732403dc1ca02b1c2ae7a7b6a796c3.zip
Add recipe for Slite (#312)
-rw-r--r--recipes/slite/README.md7
-rw-r--r--recipes/slite/icon.pngbin0 -> 12363 bytes
-rw-r--r--recipes/slite/icon.svg1
-rw-r--r--recipes/slite/index.js3
-rw-r--r--recipes/slite/package.json14
-rw-r--r--recipes/slite/webview.js24
6 files changed, 49 insertions, 0 deletions
diff --git a/recipes/slite/README.md b/recipes/slite/README.md
new file mode 100644
index 0000000..ffc15d1
--- /dev/null
+++ b/recipes/slite/README.md
@@ -0,0 +1,7 @@
1# Slite for Ferdi
2
3This is a Ferdi recipe for [Slite](https://slite.com/)
4
5## Release notes
6
71.0.0: First version \ No newline at end of file
diff --git a/recipes/slite/icon.png b/recipes/slite/icon.png
new file mode 100644
index 0000000..f18b347
--- /dev/null
+++ b/recipes/slite/icon.png
Binary files differ
diff --git a/recipes/slite/icon.svg b/recipes/slite/icon.svg
new file mode 100644
index 0000000..9648d20
--- /dev/null
+++ b/recipes/slite/icon.svg
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="600" height="600" fill="none" xmlns:v="https://vecta.io/nano"><path d="M588 480H12c-6.627 0-12 5.373-12 12v96c0 6.627 5.373 12 12 12h576c6.627 0 12-5.373 12-12v-96c0-6.627-5.373-12-12-12z" fill="#ffe697"/><path d="M360 480h207.92a239.94 239.94 0 0 1-87.864 87.869A239.92 239.92 0 0 1 360.02 600V480z" fill="#ffcf59"/><path d="M588 240H240v108c0 6.627 5.373 12 12 12h348V252c0-6.627-5.373-12-12-12zm-480 0H12c-6.627 0-12 5.373-12 12v96c0 6.627 5.373 12 12 12h96c6.627 0 12-5.373 12-12v-96c0-6.627-5.373-12-12-12z" fill="#aae7ed"/><path d="M588 0H12C5.373 0 0 5.373 0 12v96c0 6.627 5.373 12 12 12h576c6.627 0 12-5.373 12-12V12c0-6.627-5.373-12-12-12z" fill="#b0bbff"/><path d="M480 120H272.1c21.06-36.498 51.362-66.805 87.857-87.87S437.862-.018 480 0z" fill="#5168ec"/><path d="M479.92 120h.12V0h108c6.627 0 12 5.373 12 12v96c0 6.627-5.373 12-12 12H479.92a120 120 0 0 0-84.775 35.19c-22.48 22.5-35.105 53.005-35.105 84.8h-120c-.066-42.132 11.01-83.532 32.1-120z" fill="#b0bbff"/><path d="M567.92 480H360c31.826 0 62.348-12.643 84.853-35.147S480 391.826 480 360h120c.074 42.13-10.993 83.528-32.08 120z" fill="#ffe697"/></svg> \ No newline at end of file
diff --git a/recipes/slite/index.js b/recipes/slite/index.js
new file mode 100644
index 0000000..cd5b37c
--- /dev/null
+++ b/recipes/slite/index.js
@@ -0,0 +1,3 @@
1"use strict";
2
3module.exports = Ferdi => Ferdi;
diff --git a/recipes/slite/package.json b/recipes/slite/package.json
new file mode 100644
index 0000000..cbe8c0c
--- /dev/null
+++ b/recipes/slite/package.json
@@ -0,0 +1,14 @@
1{
2 "id": "slite",
3 "name": "Slite",
4 "version": "1.0.0",
5 "description": "slite",
6 "main": "index.js",
7 "author": "Ferdi <hello@getferdi.com>",
8 "license": "MIT",
9 "config": {
10 "serviceURL": "https://{teamId}.slite.com",
11 "hasTeamId": true,
12 "urlInputSuffix": ".slite.com"
13 }
14} \ No newline at end of file
diff --git a/recipes/slite/webview.js b/recipes/slite/webview.js
new file mode 100644
index 0000000..6e0fa46
--- /dev/null
+++ b/recipes/slite/webview.js
@@ -0,0 +1,24 @@
1"use strict";
2
3var _path = _interopRequireDefault(require("path"));
4
5function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
7module.exports = Ferdi => {
8 const getMessages = function getMessages() {
9 let direct = 0;
10
11 const notificationButton = document.querySelector(
12 "#app button[data-test-id='notificationsCount'"
13 );
14
15 if (notificationButton) {
16 const notificationCount = parseInt(notificationButton.innerText);
17 direct = isNaN(notificationCount) ? 0 : notificationCount;
18 }
19
20 Ferdi.setBadge(direct);
21 };
22
23 Ferdi.loop(getMessages);
24};