aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/mattermost
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/mattermost
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/mattermost')
-rw-r--r--recipes/mattermost/README.md5
-rw-r--r--recipes/mattermost/icon.pngbin0 -> 71150 bytes
-rw-r--r--recipes/mattermost/icon.svg14
-rw-r--r--recipes/mattermost/index.js20
-rw-r--r--recipes/mattermost/package.json14
-rw-r--r--recipes/mattermost/webview.js14
6 files changed, 67 insertions, 0 deletions
diff --git a/recipes/mattermost/README.md b/recipes/mattermost/README.md
new file mode 100644
index 0000000..3321fb5
--- /dev/null
+++ b/recipes/mattermost/README.md
@@ -0,0 +1,5 @@
1# Mattermost for Franz
2This 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/recipes/mattermost/icon.png b/recipes/mattermost/icon.png
new file mode 100644
index 0000000..a98e65d
--- /dev/null
+++ b/recipes/mattermost/icon.png
Binary files differ
diff --git a/recipes/mattermost/icon.svg b/recipes/mattermost/icon.svg
new file mode 100644
index 0000000..9f7056d
--- /dev/null
+++ b/recipes/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/recipes/mattermost/index.js b/recipes/mattermost/index.js
new file mode 100644
index 0000000..8f814fa
--- /dev/null
+++ b/recipes/mattermost/index.js
@@ -0,0 +1,20 @@
1"use strict";
2
3module.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/recipes/mattermost/package.json b/recipes/mattermost/package.json
new file mode 100644
index 0000000..52a1908
--- /dev/null
+++ b/recipes/mattermost/package.json
@@ -0,0 +1,14 @@
1{
2 "id": "mattermost",
3 "name": "Mattermost",
4 "version": "1.2.2",
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/recipes/mattermost/webview.js b/recipes/mattermost/webview.js
new file mode 100644
index 0000000..f348da4
--- /dev/null
+++ b/recipes/mattermost/webview.js
@@ -0,0 +1,14 @@
1"use strict";
2
3module.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 channelMessages = document.querySelectorAll('.sidebar--left .unread-title').length - allMessages;
8 const teamDirectMessages = document.querySelectorAll('.team-wrapper .team-container .badge').length;
9 const teamMessages = document.querySelectorAll('.team-wrapper .unread').length - teamDirectMessages;
10 Franz.setBadge(directMessages + teamDirectMessages, allMessages + channelMessages + teamMessages);
11 };
12
13 Franz.loop(getMessages);
14};