diff options
Diffstat (limited to 'uncompressed/rocketchat')
-rw-r--r-- | uncompressed/rocketchat/README.md | 5 | ||||
-rw-r--r-- | uncompressed/rocketchat/icon.png | bin | 77680 -> 0 bytes | |||
-rw-r--r-- | uncompressed/rocketchat/icon.svg | 19 | ||||
-rw-r--r-- | uncompressed/rocketchat/index.js | 21 | ||||
-rw-r--r-- | uncompressed/rocketchat/package.json | 16 | ||||
-rw-r--r-- | uncompressed/rocketchat/webview.js | 51 |
6 files changed, 0 insertions, 112 deletions
diff --git a/uncompressed/rocketchat/README.md b/uncompressed/rocketchat/README.md deleted file mode 100644 index c8b5579..0000000 --- a/uncompressed/rocketchat/README.md +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | # Rocket.Chat for Franz | ||
2 | This is the official Franz recipe for Rocket.Chat | ||
3 | |||
4 | ### How to create your own Franz recipes: | ||
5 | * [Read the documentation](https://github.com/meetfranz/plugins) | ||
diff --git a/uncompressed/rocketchat/icon.png b/uncompressed/rocketchat/icon.png deleted file mode 100644 index 116cd78..0000000 --- a/uncompressed/rocketchat/icon.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/uncompressed/rocketchat/icon.svg b/uncompressed/rocketchat/icon.svg deleted file mode 100644 index b87ea43..0000000 --- a/uncompressed/rocketchat/icon.svg +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
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>rocketchat</title> | ||
5 | <desc>Created with Sketch.</desc> | ||
6 | <defs></defs> | ||
7 | <g id="icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> | ||
8 | <g id="rocketchat"> | ||
9 | <g id="rocket-chat" transform="translate(0.000000, 6.000000)"> | ||
10 | <g id="Group"> | ||
11 | <path d="M79.9844575,34.1583472 C79.9844575,30.1420192 78.7829922,26.2917408 76.4127919,22.7112933 C74.2844812,19.4980713 71.3027706,16.6536712 67.5514834,14.2563281 C60.3075637,9.62928822 50.7868466,7.08026506 40.7448291,7.08026506 C37.390305,7.08026506 34.0836797,7.36366728 30.8768442,7.92568175 C28.8874406,6.06321044 26.5579543,4.387545 24.0935527,3.06313869 C10.9261277,-3.31859984 0.00676074016,2.91305528 0.00676074016,2.91305528 C0.00676074016,2.91305528 10.158946,11.2530631 8.50802837,18.5632432 C3.96640834,23.068939 1.50440165,28.502278 1.50440165,34.1583472 C1.50440165,34.1759103 1.50519997,34.1942716 1.50519997,34.2126328 C1.50519997,34.2301956 1.50440165,34.2477588 1.50440165,34.2669181 C1.50440165,39.9229875 3.96561006,45.3563266 8.50802837,49.8612241 C10.158946,57.1722025 0.00676074016,65.51221 0.00676074016,65.51221 C0.00676074016,65.51221 10.9261277,71.7430672 24.0935527,65.3621266 C26.5579543,64.0377203 28.8866422,62.3612566 30.8768442,60.4995838 C34.0844781,61.0608 37.390305,61.3442022 40.7448291,61.3442022 C50.7876447,61.3442022 60.3075637,58.7967753 67.5514834,54.1697356 C71.3027706,51.7723928 74.2844812,48.9287909 76.4127919,45.7139719 C78.7829922,42.1343228 79.9844575,38.2824478 79.9844575,34.2677166 C79.9844575,34.2493553 79.9836594,34.2317925 79.9836594,34.2134313 C79.9836594,34.19507 79.9844575,34.1759103 79.9844575,34.1583472 L79.9844575,34.1583472 L79.9844575,34.1583472 L79.9844575,34.1583472 Z" id="Shape" fill="#C1272D"></path> | ||
12 | <path d="M40.7448291,12.7586872 C59.3400047,12.7586872 74.415405,22.3879754 74.415405,34.26612 C74.415405,46.1434663 59.3400047,55.7735528 40.7448291,55.7735528 C36.6039634,55.7735528 32.6387275,55.2945631 28.9752553,54.4220034 C25.2519093,58.9005566 17.0611866,65.1282203 9.10437047,63.1156656 C11.6925111,60.3359288 15.5268231,55.6386372 14.7061542,47.9013581 C9.93701413,44.1907853 7.07425275,39.4416028 7.07425275,34.26612 C7.07345444,22.387177 22.1488548,12.7586872 40.7448291,12.7586872" id="Shape" fill="#FFFFFF"></path> | ||
13 | <path d="M40.7448291,39.431225 C43.2151791,39.431225 45.2177937,37.42861 45.2177937,34.9582597 C45.2177937,32.4879097 43.2151791,30.4852951 40.7448291,30.4852951 C38.2744787,30.4852951 36.2718641,32.4879097 36.2718641,34.9582597 C36.2718641,37.42861 38.2744787,39.431225 40.7448291,39.431225 L40.7448291,39.431225 L40.7448291,39.431225 Z M56.2960256,39.431225 C58.7663756,39.431225 60.7689906,37.42861 60.7689906,34.9582597 C60.7689906,32.4879097 58.7663756,30.4852951 56.2960256,30.4852951 C53.8256753,30.4852951 51.8230609,32.4879097 51.8230609,34.9582597 C51.8230609,37.42861 53.8256753,39.431225 56.2960256,39.431225 L56.2960256,39.431225 L56.2960256,39.431225 Z M25.1928338,39.4304266 C27.6627432,39.4304266 29.6650004,37.4281691 29.6650004,34.9582597 C29.6650004,32.4883506 27.6627432,30.4860934 25.1928338,30.4860934 C22.7229245,30.4860934 20.7206673,32.4883506 20.7206673,34.9582597 C20.7206673,37.4281691 22.7229245,39.4304266 25.1928338,39.4304266 L25.1928338,39.4304266 L25.1928338,39.4304266 Z" id="Shape" fill="#C1272D"></path> | ||
14 | <path d="M40.7448291,52.9435222 C36.6039634,52.9435222 32.6387275,52.5283978 28.9752553,51.7715944 C25.6877898,55.1995634 18.9164731,59.8074437 11.899275,59.6382006 C10.974825,61.0392453 9.96974506,62.1848291 9.10437047,63.1148672 C17.0611866,65.1274219 25.2519092,58.9005566 28.9752553,54.4212053 C32.6387275,55.2945631 36.6047619,55.7727544 40.7448291,55.7727544 C59.1907197,55.7727544 74.1703219,46.2959447 74.4090184,34.5495222 C74.1703219,44.731245 59.1907197,52.9435222 40.7448291,52.9435222 L40.7448291,52.9435222 L40.7448291,52.9435222 L40.7448291,52.9435222 Z" id="Shape" fill="#CCCCCC"></path> | ||
15 | </g> | ||
16 | </g> | ||
17 | </g> | ||
18 | </g> | ||
19 | </svg> \ No newline at end of file | ||
diff --git a/uncompressed/rocketchat/index.js b/uncompressed/rocketchat/index.js deleted file mode 100644 index 54450ce..0000000 --- a/uncompressed/rocketchat/index.js +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => class RocketChat extends Franz { | ||
4 | async validateUrl(url) { | ||
5 | try { | ||
6 | const resp = await window.fetch(url, { | ||
7 | method: 'GET', | ||
8 | headers: { | ||
9 | 'Content-Type': 'application/json' | ||
10 | } | ||
11 | }); | ||
12 | const status = resp.status.toString(); | ||
13 | return status.startsWith('2') || status.startsWith('3'); | ||
14 | } catch (err) { | ||
15 | console.error(err); | ||
16 | } | ||
17 | |||
18 | return false; | ||
19 | } | ||
20 | |||
21 | }; \ No newline at end of file | ||
diff --git a/uncompressed/rocketchat/package.json b/uncompressed/rocketchat/package.json deleted file mode 100644 index 7200d76..0000000 --- a/uncompressed/rocketchat/package.json +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | { | ||
2 | "id": "rocketchat", | ||
3 | "name": "Rocket.Chat", | ||
4 | "version": "1.0.8", | ||
5 | "description": "Rocket.Chat", | ||
6 | "main": "index.js", | ||
7 | "author": "Stefan Malzner <stefan@adlk.io>", | ||
8 | "license": "MIT", | ||
9 | "config": { | ||
10 | "serviceURL": "https://{teamId}.rocket.chat", | ||
11 | "hasNotificationSound": true, | ||
12 | "hasCustomUrl": true, | ||
13 | "hasTeamId": true, | ||
14 | "urlInputSuffix": ".rocket.chat" | ||
15 | } | ||
16 | } | ||
diff --git a/uncompressed/rocketchat/webview.js b/uncompressed/rocketchat/webview.js deleted file mode 100644 index 5ccd0d2..0000000 --- a/uncompressed/rocketchat/webview.js +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const { | ||
4 | ipcRenderer | ||
5 | } = require('electron'); | ||
6 | |||
7 | const getTeamIcon = function getTeamIcon() { | ||
8 | console.log('getTeamIcon'); | ||
9 | const manifestElement = document.querySelector('link[rel="manifest"]'); | ||
10 | |||
11 | if (manifestElement == null) { | ||
12 | return; | ||
13 | } | ||
14 | |||
15 | const manifestUrl = manifestElement.getAttribute('href'); | ||
16 | console.log(manifestUrl); | ||
17 | |||
18 | if (manifestUrl == null) { | ||
19 | return; | ||
20 | } | ||
21 | |||
22 | const xmlhttp = new XMLHttpRequest(); | ||
23 | |||
24 | xmlhttp.onreadystatechange = function () { | ||
25 | if (this.readyState != 4 || this.status != 200) { | ||
26 | return; | ||
27 | } | ||
28 | |||
29 | const response = JSON.parse(this.responseText); | ||
30 | |||
31 | if (response.icons.length >= 1) { | ||
32 | ipcRenderer.sendToHost('avatar', `${window.location.protocol}//${window.location.host}${response.icons[0].src}`); | ||
33 | } | ||
34 | }; | ||
35 | |||
36 | xmlhttp.open('GET', manifestUrl, true); | ||
37 | xmlhttp.send(); | ||
38 | }; | ||
39 | |||
40 | module.exports = Franz => { | ||
41 | const getMessages = function getMessages() { | ||
42 | const directMessages = Math.round(document.querySelectorAll('.unread.unread-mention, .badge--unread').length / 2); | ||
43 | const indirectMessages = Math.round(document.querySelectorAll('.unread:not(.unread-mention), .sidebar-item--unread').length / 2); | ||
44 | Franz.setBadge(directMessages, indirectMessages); | ||
45 | }; | ||
46 | |||
47 | Franz.loop(getMessages); | ||
48 | setTimeout(() => { | ||
49 | getTeamIcon(); | ||
50 | }, 4000); | ||
51 | }; \ No newline at end of file | ||