aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Jalil Salamé <60845989+jalil-salame@users.noreply.github.com>2023-05-12 06:27:24 +0200
committerLibravatar GitHub <noreply@github.com>2023-05-12 09:57:24 +0530
commite2b06809981fca02ef6337b6ac0a5c28ec70a996 (patch)
tree0d2834f5b1233f52e98058208244a433468d4dc3
parentadd miroslavpejic85 as a contributor for code (#361) (diff)
downloadferdium-recipes-e2b06809981fca02ef6337b6ac0a5c28ec70a996.tar.gz
ferdium-recipes-e2b06809981fca02ef6337b6ac0a5c28ec70a996.tar.zst
ferdium-recipes-e2b06809981fca02ef6337b6ac0a5c28ec70a996.zip
Add Elk recipe (#358)
Elk is a modern Mastodon web client, you can check it out at https://elk.zone/
-rw-r--r--pnpm-lock.yaml3
-rw-r--r--recipes/elk/icon.svg1
-rw-r--r--recipes/elk/index.js1
-rw-r--r--recipes/elk/package.json10
-rw-r--r--recipes/elk/webview.js23
5 files changed, 38 insertions, 0 deletions
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7e71736..367438b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -202,6 +202,9 @@ importers:
202 recipes/elevate: 202 recipes/elevate:
203 specifiers: {} 203 specifiers: {}
204 204
205 recipes/elk:
206 specifiers: {}
207
205 recipes/epicgames: 208 recipes/epicgames:
206 specifiers: {} 209 specifiers: {}
207 210
diff --git a/recipes/elk/icon.svg b/recipes/elk/icon.svg
new file mode 100644
index 0000000..90730e6
--- /dev/null
+++ b/recipes/elk/icon.svg
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="180" height="180" fill="none" viewBox="0 0 250 250"><path fill="#EA9E44" d="M131.676 48.248c-8.828 1.025-13.52-1.333-16.345 7.073 0 0 9.484 14.3 34.759 13.942-1.413 5.843-.757 10.148-.757 15.325 0 17.222-13.621 32.24-43.638 32.24-15.236 0-33.75 2.768-47.876 10.508-10.04 5.484-17.894 13.429-21.37 24.449l3.94 5.587 7.542.102v31.625l-9.202 14.506 2.644 42.03H50.1l.757-33.829c4.339-2.563 14.277-9.226 22.752-19.477 11.503-13.788 20.331-33.829 9.939-58.637l7.769-3.332c8.526 20.349 5.55 37.981-1.917 52.179 14.277-.462 26.536-1.384 36.928-3.127l-2.371-28.857 8.375-.718 7.971 95.798h8.677l1.463-62.379c6.912-2.973 22.652-13.89 30.017-51.82.908-4.613 1.413-8.508 1.665-11.84 1.16-8.457 1.816-17.991 2.018-28.857l-12.36-3.947h37.988l3.683-8.457c-3.582.154-7.87-1.742-7.87-1.742l.857-4.101h7.971l-43.134-22.707c-4.792 1.846-9.837 4.255-13.369 7.176-2.825-2.05-12.612-8.457-26.233-8.713Z"/><path fill="#A75C26" d="M165.174 185.512c4.54-4.921 9.787-11.841 14.681-21.118.151 3.844.403 6.151.605 7.33l22.349 19.169-16.85 33.214-7.567-3.588 10.543-24.346-23.761-10.661ZM84.052 191.15a387.352 387.352 0 0 0 18.212-.718c-7.315 10.918-16.194 18.76-19.876 21.835v33.317H73.76l-4.39-38.442c5.247-4.408 10.292-10.098 14.681-15.992ZM58.424 6.244l8.123-2.307c3.935 14.25 8.828 22.04 14.983 25.987 5.55 3.367 13.066 3.46 21.037 3.024-2.321-.769-4.49-1.845-6.508-3.332-4.49-3.331-8.324-8.867-11.2-18.913l8.072-2.41c2.17 7.587 4.692 11.943 8.072 14.455 3.38 2.46 7.467 3.075 12.31 3.588 9.08 1.025 20.431 1.435 34.608 8.098 1.917.718 3.884 1.64 5.801 2.666a16.807 16.807 0 0 0-.857-1.59c-2.422-3.843-7.164-7.893-15.942-11.173l2.825-7.996c14.277 5.228 19.927 12.66 22.197 18.555 2.624 6.714 1.009 11.968 1.009 11.968-2.018.666-4.036 1.589-6.356 2.306-4.389-3.024-8.526-5.305-12.461-7.099-14.529-5.484-28.756-1.742-41.368-.563-9.485.871-18.162.461-25.679-4.357-7.416-4.716-13.924-13.737-18.666-30.907Z"/><path fill="#A75C26" d="M113.918 19.98c-1.665-3.793-2.674-8.457-2.22-14.198l8.375.615c-.505 6.971 1.917 11.687 4.641 14.762-3.531-.615-6.911-.687-10.796-1.179ZM166.889 19.109l5.499-6.407c14.277 12.609 5.398 30.65 5.398 30.65l-7.819-.87c-.252-4.121-.757-11.78-4.389-16.095 2.371 1.215 4.389 2.553 6.609 4.562 0-3.742-1.161-8.15-5.298-11.84Z"/></svg>
diff --git a/recipes/elk/index.js b/recipes/elk/index.js
new file mode 100644
index 0000000..dd41f72
--- /dev/null
+++ b/recipes/elk/index.js
@@ -0,0 +1 @@
module.exports = Ferdium => Ferdium;
diff --git a/recipes/elk/package.json b/recipes/elk/package.json
new file mode 100644
index 0000000..3f6c001
--- /dev/null
+++ b/recipes/elk/package.json
@@ -0,0 +1,10 @@
1{
2 "id": "elk",
3 "name": "Elk",
4 "version": "1.0.0",
5 "license": "MIT",
6 "repository": "https://github.com/jalil-salame/ferdium-elk-recipe",
7 "config": {
8 "serviceURL": "https://elk.zone/"
9 }
10}
diff --git a/recipes/elk/webview.js b/recipes/elk/webview.js
new file mode 100644
index 0000000..f284fd3
--- /dev/null
+++ b/recipes/elk/webview.js
@@ -0,0 +1,23 @@
1const _path = _interopRequireDefault(require('path'));
2
3function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj };
5}
6
7module.exports = (Ferdium) => {
8 // Inject css
9 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
10
11 // Get notifications
12 Ferdium.loop(() => {
13 const notifications = document.querySelectorAll("[href$=notifications]").item(0);
14 // Null if not present
15 if (!notifications) {
16 return;
17 }
18 // Assume first element contains the number of notifications
19 let parsedValue = Ferdium.safeParseInt(notifications.outerText);
20 // Set to parsed value
21 Ferdium.setBadge(parsedValue);
22 });
23}