diff options
author | vantezzen <hello@vantezzen.io> | 2019-09-28 12:10:25 +0200 |
---|---|---|
committer | vantezzen <hello@vantezzen.io> | 2019-09-28 12:10:25 +0200 |
commit | 728d339739b63e9bb59e457e4a84fe9a65b93fc9 (patch) | |
tree | a0fc6180ea26fa9ef397458e8eb6491031d6437d /uncompressed/mattermost | |
parent | Add list of recipes (diff) | |
download | ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.tar.gz ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.tar.zst ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.zip |
Add uncompressed recipes
Diffstat (limited to 'uncompressed/mattermost')
-rw-r--r-- | uncompressed/mattermost/README.md | 5 | ||||
-rw-r--r-- | uncompressed/mattermost/icon.svg | 14 | ||||
-rw-r--r-- | uncompressed/mattermost/index.js | 20 | ||||
-rw-r--r-- | uncompressed/mattermost/package.json | 14 | ||||
-rw-r--r-- | uncompressed/mattermost/webview.js | 13 |
5 files changed, 66 insertions, 0 deletions
diff --git a/uncompressed/mattermost/README.md b/uncompressed/mattermost/README.md new file mode 100644 index 0000000..3321fb5 --- /dev/null +++ b/uncompressed/mattermost/README.md | |||
@@ -0,0 +1,5 @@ | |||
1 | # Mattermost for Franz | ||
2 | This is the official Franz recipe for Mattermost | ||
3 | |||
4 | ### How to create your own Franz recipes: | ||
5 | * [Read the documentation](https://github.com/meetfranz/plugins) | ||
diff --git a/uncompressed/mattermost/icon.svg b/uncompressed/mattermost/icon.svg new file mode 100644 index 0000000..9f7056d --- /dev/null +++ b/uncompressed/mattermost/icon.svg | |||
@@ -0,0 +1,14 @@ | |||
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>mattermost</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="mattermost" fill="#0072C6"> | ||
9 | <g id="mattermost-seeklogo.com"> | ||
10 | <path d="M76.1710084,22.92625 C73.5291334,17.220625 69.7047584,12.4209375 64.6397584,8.39 C64.7747584,11.12625 65.0691334,16.97875 65.0691334,16.97875 C65.0691334,16.97875 65.3844459,17.3934375 65.5128834,17.5728125 C70.6313209,24.7215625 72.5019459,32.645 70.7969459,41.25125 C67.3781959,58.508125 50.5560084,69.035625 33.5081959,64.731875 C18.5419461,60.9534375 8.54632109,45.650625 11.3766336,30.4790625 C13.6110086,18.501875 20.6897586,10.523125 32.1844459,6.46875 L32.6010084,6.31125 L32.9278834,6.069375 C34.3210084,4.099375 35.6803834,2.1053125 37.1306959,0 C19.7097586,0.863125 2.18882108,14.84 0.181321079,36.100625 C-1.76117892,56.673125 12.1091336,75.0196875 31.9300709,79.045625 C52.5850709,83.2409375 72.2478834,71.055 78.1897584,51.553125 C81.1610084,41.80125 80.4656959,32.201875 76.1710084,22.92625 L76.1710084,22.92625 Z M27.0113211,35.7925 C27.8825711,44.0696875 35.0569459,49.710625 43.3560084,48.7934375 C51.5097584,47.8921875 57.4703834,39.915625 55.9269459,31.8459375 C54.7238209,25.5540625 53.3941334,19.2865625 52.1181959,13.00875 C51.5903834,10.4109375 51.0563209,7.8140625 50.4960084,5.0740625 C50.2753834,5.268125 50.1728834,5.35 50.0794459,5.4415625 C47.2856959,8.1803125 44.4935084,10.920625 41.6997584,13.659375 C38.2978834,16.9946875 34.9006959,20.334375 31.4906959,23.66125 C28.0706961,26.9978125 26.5138211,31.0696875 27.0113211,35.7925 L27.0113211,35.7925 Z" id="Shape"></path> | ||
11 | </g> | ||
12 | </g> | ||
13 | </g> | ||
14 | </svg> \ No newline at end of file | ||
diff --git a/uncompressed/mattermost/index.js b/uncompressed/mattermost/index.js new file mode 100644 index 0000000..8f814fa --- /dev/null +++ b/uncompressed/mattermost/index.js | |||
@@ -0,0 +1,20 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => class Mattermost 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 | return resp.status.toString().startsWith('2'); | ||
13 | } catch (err) { | ||
14 | console.error(err); | ||
15 | } | ||
16 | |||
17 | return false; | ||
18 | } | ||
19 | |||
20 | }; \ No newline at end of file | ||
diff --git a/uncompressed/mattermost/package.json b/uncompressed/mattermost/package.json new file mode 100644 index 0000000..48f6860 --- /dev/null +++ b/uncompressed/mattermost/package.json | |||
@@ -0,0 +1,14 @@ | |||
1 | { | ||
2 | "id": "mattermost", | ||
3 | "name": "Mattermost", | ||
4 | "version": "1.2.1", | ||
5 | "description": "Mattermost", | ||
6 | "main": "index.js", | ||
7 | "author": "Stefan Malzner <stefan@adlk.io>", | ||
8 | "license": "MIT", | ||
9 | "config": { | ||
10 | "hasNotificationSound": true, | ||
11 | "hasIndirectMessages": true, | ||
12 | "hasCustomUrl": true | ||
13 | } | ||
14 | } | ||
diff --git a/uncompressed/mattermost/webview.js b/uncompressed/mattermost/webview.js new file mode 100644 index 0000000..03258e0 --- /dev/null +++ b/uncompressed/mattermost/webview.js | |||
@@ -0,0 +1,13 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = function getMessages() { | ||
5 | const directMessages = document.querySelectorAll('.sidebar--left .has-badge .badge').length; | ||
6 | const allMessages = document.querySelectorAll('.sidebar--left .has-badge').length - directMessages; | ||
7 | const teamDirectMessages = document.querySelectorAll('.team-wrapper .team-container .badge').length; | ||
8 | const teamMessages = document.querySelectorAll('.team-wrapper .unread').length - teamDirectMessages; | ||
9 | Franz.setBadge(directMessages + teamDirectMessages, allMessages + teamMessages); | ||
10 | }; | ||
11 | |||
12 | Franz.loop(getMessages); | ||
13 | }; \ No newline at end of file | ||