aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/telegram-react
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-09-22 20:56:48 +0200
committerLibravatar GitHub <noreply@github.com>2020-09-22 19:56:48 +0100
commit6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch)
tree9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /recipes/telegram-react
parentUpdated logos for Outlook/OWA (diff)
downloadferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.gz
ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.zst
ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.zip
Unpack recipes and update recipes icons (#292)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Diffstat (limited to 'recipes/telegram-react')
-rw-r--r--recipes/telegram-react/README.md7
-rw-r--r--recipes/telegram-react/icon.pngbin0 -> 15968 bytes
-rw-r--r--recipes/telegram-react/icon.svg27
-rw-r--r--recipes/telegram-react/index.js4
-rw-r--r--recipes/telegram-react/package.json14
-rw-r--r--recipes/telegram-react/webview.js19
6 files changed, 71 insertions, 0 deletions
diff --git a/recipes/telegram-react/README.md b/recipes/telegram-react/README.md
new file mode 100644
index 0000000..fbd7ca6
--- /dev/null
+++ b/recipes/telegram-react/README.md
@@ -0,0 +1,7 @@
1# Telegram for Ferdi
2
3This is the official Ferdi recipe for Telegram
4
5### How to create your own Franz recipes:
6
7- [Read the documentation](https://github.com/getferdi/recipes/tree/master/docs)
diff --git a/recipes/telegram-react/icon.png b/recipes/telegram-react/icon.png
new file mode 100644
index 0000000..3a3135e
--- /dev/null
+++ b/recipes/telegram-react/icon.png
Binary files differ
diff --git a/recipes/telegram-react/icon.svg b/recipes/telegram-react/icon.svg
new file mode 100644
index 0000000..5cfd9c5
--- /dev/null
+++ b/recipes/telegram-react/icon.svg
@@ -0,0 +1,27 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<svg width="80px" height="80px" viewBox="0 0 80 80" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3 <!-- Generator: Sketch 3.7.2 (28276) - http://www.bohemiancoding.com/sketch -->
4 <title>telegram</title>
5 <desc>Created with Sketch.</desc>
6 <defs>
7 <path d="M39.9821723,0.035505618 C17.9006742,0.035505618 0,17.93603 0,40.0176779 L0,40.0176779 C0,62.0993258 17.9006742,80 39.9821723,80 L39.9821723,80 C62.0638202,80 79.9644944,62.0993258 79.9644944,40.0176779 L79.9644944,40.0176779 C79.9644944,17.93603 62.0638202,0.035505618 39.9821723,0.035505618 L39.9821723,0.035505618 Z" id="path-1"></path>
8 </defs>
9 <g id="icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
10 <g id="telegram">
11 <g id="Page-1">
12 <g id="Group-3"></g>
13 <mask id="mask-2" fill="white">
14 <use xlink:href="#path-1"></use>
15 </mask>
16 <use id="Clip-2" fill="#0088CC" xlink:href="#path-1"></use>
17 <g id="Group-10" mask="url(#mask-2)">
18 <g transform="translate(14.232210, 21.573034)">
19 <path d="M45.2046742,1.4619176 L38.0635506,37.4668614 C38.0635506,37.4668614 37.0647491,39.9637903 34.3182322,38.7651386 L17.8388315,26.1308315 L11.8463221,23.2346517 L1.75898127,19.8386966 C1.75898127,19.8386966 0.210966292,19.289633 0.0611535581,18.0911311 C-0.088659176,16.8926292 1.80886891,16.2433408 1.80886891,16.2433408 L41.908794,0.513003745 C41.908794,0.513003745 45.2046742,-0.935086142 45.2046742,1.4619176" id="Fill-4" fill="#FEFEFE"></path>
20 <path d="M16.5721498,37.0625618 C16.5721498,37.0625618 16.0911011,37.0174682 15.4918502,35.1196404 C14.8925993,33.2221124 11.8463071,23.2346966 11.8463071,23.2346966 L36.0660824,7.85387266 C36.0660824,7.85387266 37.4642846,7.00503371 37.414397,7.85387266 C37.414397,7.85387266 37.6641348,8.00368539 36.9150712,8.70286142 C36.1660075,9.40203745 17.8888539,25.8312509 17.8888539,25.8312509" id="Fill-6" fill="#D3E5F1"></path>
21 <path d="M24.1574532,30.975236 L17.6391011,36.9183071 C17.6391011,36.9183071 17.129588,37.304824 16.5721348,37.0625768 L17.8202247,26.0234757" id="Fill-8" fill="#B6D0E4"></path>
22 </g>
23 </g>
24 </g>
25 </g>
26 </g>
27</svg> \ No newline at end of file
diff --git a/recipes/telegram-react/index.js b/recipes/telegram-react/index.js
new file mode 100644
index 0000000..6343150
--- /dev/null
+++ b/recipes/telegram-react/index.js
@@ -0,0 +1,4 @@
1"use strict";
2
3module.exports = Franz => Franz;
4//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlbGVncmFtL2luZGV4LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiJdLCJtYXBwaW5ncyI6Ijs7QUFBQUEsT0FBT0MsT0FBUCxHQUFpQkMsU0FBU0EsS0FBMUIiLCJmaWxlIjoidGVsZWdyYW0vaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IEZyYW56ID0+IEZyYW56O1xuIl19 \ No newline at end of file
diff --git a/recipes/telegram-react/package.json b/recipes/telegram-react/package.json
new file mode 100644
index 0000000..538b37a
--- /dev/null
+++ b/recipes/telegram-react/package.json
@@ -0,0 +1,14 @@
1{
2 "id": "telegram-react",
3 "name": "Telegram React",
4 "version": "1.0.1",
5 "description": "Telegram React",
6 "main": "index.js",
7 "author": "Amine Mouafik <amine@mouafik.fr>",
8 "license": "MIT",
9 "config": {
10 "serviceURL": "https://evgeny-nadymov.github.io/telegram-react/",
11 "hasDirectMessages": true,
12 "hasNotificationSound": true
13 }
14}
diff --git a/recipes/telegram-react/webview.js b/recipes/telegram-react/webview.js
new file mode 100644
index 0000000..223e914
--- /dev/null
+++ b/recipes/telegram-react/webview.js
@@ -0,0 +1,19 @@
1"use strict";
2
3const path = require("path");
4
5module.exports = Franz => {
6 const getMessages = function getMessages() {
7 let count = 0;
8 const elements = document.querySelectorAll(".dialog-badge:not(.dialog-badge-muted)");
9 if (elements) {
10 for (let i = 0; i < elements.length; i += 1) {
11 if (elements[i].querySelector("span").innerHTML !== 0) {
12 count += parseInt(elements[i].querySelector("span").innerHTML);
13 }
14 }
15 }
16 Franz.setBadge(count);
17 };
18 Franz.loop(getMessages);
19};