aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/intercom
diff options
context:
space:
mode:
authorLibravatar Guillaume RODRIGUEZ <guiguidu31300@gmail.com>2021-01-05 22:56:20 +0100
committerLibravatar GitHub <noreply@github.com>2021-01-05 22:56:20 +0100
commit4f6eee0182a9250f4cdb8aab3e04868286d5c5ce (patch)
treeba6277f525ee8657bcf627741cea5935010d1184 /recipes/intercom
parentUpdate the Google Calendar icon (#400) (diff)
downloadferdium-recipes-4f6eee0182a9250f4cdb8aab3e04868286d5c5ce.tar.gz
ferdium-recipes-4f6eee0182a9250f4cdb8aab3e04868286d5c5ce.tar.zst
ferdium-recipes-4f6eee0182a9250f4cdb8aab3e04868286d5c5ce.zip
Add Intercom recipe (#390)
Diffstat (limited to 'recipes/intercom')
-rw-r--r--recipes/intercom/icon.pngbin0 -> 25356 bytes
-rw-r--r--recipes/intercom/icon.svg1
-rw-r--r--recipes/intercom/index.js1
-rw-r--r--recipes/intercom/package.json14
-rw-r--r--recipes/intercom/webview.js12
5 files changed, 28 insertions, 0 deletions
diff --git a/recipes/intercom/icon.png b/recipes/intercom/icon.png
new file mode 100644
index 0000000..01c1a23
--- /dev/null
+++ b/recipes/intercom/icon.png
Binary files differ
diff --git a/recipes/intercom/icon.svg b/recipes/intercom/icon.svg
new file mode 100644
index 0000000..ebdeacc
--- /dev/null
+++ b/recipes/intercom/icon.svg
@@ -0,0 +1 @@
<svg width="2500" height="2500" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid"><path d="M221.867 140.748a8.534 8.534 0 0 1-17.067 0V64a8.534 8.534 0 0 1 17.067 0v76.748zm-2.978 53.413c-1.319 1.129-32.93 27.655-90.889 27.655-57.958 0-89.568-26.527-90.887-27.656a8.535 8.535 0 0 1-.925-12.033 8.53 8.53 0 0 1 12.013-.942c.501.42 28.729 23.563 79.8 23.563 51.712 0 79.503-23.31 79.778-23.545 3.571-3.067 8.968-2.655 12.033.925a8.534 8.534 0 0 1-.923 12.033zM34.133 64A8.534 8.534 0 0 1 51.2 64v76.748a8.534 8.534 0 0 1-17.067 0V64zm42.668-17.067a8.534 8.534 0 0 1 17.066 0v114.001a8.534 8.534 0 0 1-17.066 0v-114zm42.666-4.318A8.532 8.532 0 0 1 128 34.082a8.532 8.532 0 0 1 8.534 8.533v123.733a8.534 8.534 0 0 1-17.067 0V42.615zm42.667 4.318a8.534 8.534 0 0 1 17.066 0v114.001a8.534 8.534 0 0 1-17.066 0v-114zM224 0H32C14.327 0 0 14.327 0 32v192c0 17.672 14.327 32 32 32h192c17.673 0 32-14.328 32-32V32c0-17.673-14.327-32-32-32z" fill="#1F8DED"/></svg> \ No newline at end of file
diff --git a/recipes/intercom/index.js b/recipes/intercom/index.js
new file mode 100644
index 0000000..415aeea
--- /dev/null
+++ b/recipes/intercom/index.js
@@ -0,0 +1 @@
module.exports = Ferdi => Ferdi; \ No newline at end of file
diff --git a/recipes/intercom/package.json b/recipes/intercom/package.json
new file mode 100644
index 0000000..10f2f60
--- /dev/null
+++ b/recipes/intercom/package.json
@@ -0,0 +1,14 @@
1{
2 "id": "intercom",
3 "name": "Intercom",
4 "version": "1.0.0",
5 "description": "Adds support for Intercom",
6 "main": "index.js",
7 "author": "DJ Walker <donwalker1987@gmail.com>",
8 "license": "MIT",
9 "repository": "",
10 "config": {
11 "serviceURL": "https://app.intercom.io/",
12 "hasNotificationSound": true
13 }
14 } \ No newline at end of file
diff --git a/recipes/intercom/webview.js b/recipes/intercom/webview.js
new file mode 100644
index 0000000..2277a4d
--- /dev/null
+++ b/recipes/intercom/webview.js
@@ -0,0 +1,12 @@
1module.exports = (Ferdi) => {
2 function getMessages() {
3 const numMessages = parseInt(document.querySelector('.left-nav [data-content="Inbox"] .unread__container .unread').innerHTML.trim());
4 if (numMessages >= 0) {
5 Ferdi.setBadge(numMessages, 0);
6 } else {
7 Ferdi.setBadge(0, 0);
8 }
9 }
10
11 Ferdi.loop(getMessages);
12 } \ No newline at end of file