aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/workplace
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/workplace')
-rw-r--r--recipes/workplace/LICENSE19
-rw-r--r--recipes/workplace/README.md4
-rw-r--r--recipes/workplace/icon.pngbin0 -> 88435 bytes
-rw-r--r--recipes/workplace/icon.svg10
-rw-r--r--recipes/workplace/index.js3
-rw-r--r--recipes/workplace/package.json16
-rw-r--r--recipes/workplace/webview.js51
-rw-r--r--recipes/workplace/workplace.css4
8 files changed, 107 insertions, 0 deletions
diff --git a/recipes/workplace/LICENSE b/recipes/workplace/LICENSE
new file mode 100644
index 0000000..4608c00
--- /dev/null
+++ b/recipes/workplace/LICENSE
@@ -0,0 +1,19 @@
1Copyright 2017 Rico Herwig
2
3Permission is hereby granted, free of charge, to any person obtaining
4a copy of this software and associated documentation files (the "Software"),
5to deal in the Software without restriction, including without limitation the
6rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7copies of the Software, and to permit persons to whom the Software is furnished
8to do so, subject to the following conditions:
9
10The above copyright notice and this permission notice shall be included
11in all copies or substantial portions of the Software.
12
13THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
19OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/recipes/workplace/README.md b/recipes/workplace/README.md
new file mode 100644
index 0000000..75791ac
--- /dev/null
+++ b/recipes/workplace/README.md
@@ -0,0 +1,4 @@
1# Franz 5 Recipe: Workplace by facebook
2This recipe integrates the Workplace Chat by facebook into Franz.
3
4You can get the latest version of Franz [here](https://meetfranz.com/). \ No newline at end of file
diff --git a/recipes/workplace/icon.png b/recipes/workplace/icon.png
new file mode 100644
index 0000000..9705dcf
--- /dev/null
+++ b/recipes/workplace/icon.png
Binary files differ
diff --git a/recipes/workplace/icon.svg b/recipes/workplace/icon.svg
new file mode 100644
index 0000000..52bef1d
--- /dev/null
+++ b/recipes/workplace/icon.svg
@@ -0,0 +1,10 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<svg width="1024px" height="1024px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3 <!-- Generator: Sketch 41.2 (35397) - http://www.bohemiancoding.com/sketch -->
4 <title>Combined Shape</title>
5 <desc>Created with Sketch.</desc>
6 <defs></defs>
7 <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8 <path d="M512,1024 C794.769792,1024 1024,794.769792 1024,512 C1024,229.230208 794.769792,0 512,0 C229.230208,0 0,229.230208 0,512 C0,794.769792 229.230208,1024 512,1024 Z M588.371906,145.551839 C653.099666,158.908361 705.498328,187.676254 755.499666,237.335117 C805.843478,287.67893 833.926421,339.392642 847.625418,407.202676 C856.187291,449.669565 853.447492,517.822074 841.118395,558.919064 C826.391973,608.235452 793.171906,667.141137 771.253512,683.579933 C745.567893,702.416054 716.457525,707.210702 692.826756,696.251505 C669.195987,684.949833 661.319064,670.223411 612.002676,546.589967 C605.495652,529.808696 600.701003,521.589298 598.988629,524.329097 C597.618729,526.726421 584.947157,557.891639 570.563211,593.166555 C540.425418,668.168562 537.685619,673.648161 526.726421,683.237458 C497.273579,710.292977 445.559866,706.868227 423.298997,676.38796 C415.422074,665.771237 304.802676,398.983278 304.802676,390.76388 C304.802676,387.33913 316.104348,390.07893 355.146488,390.76388 L405.832776,391.791304 L430.49097,451.724415 C444.532441,484.602007 460.286288,523.644147 466.450836,538.370569 C472.27291,553.09699 478.094983,563.713712 479.807358,562.343813 C481.177258,560.973913 494.876254,528.438796 509.945151,490.081605 C525.356522,451.724415 540.425418,416.449498 543.507692,411.997324 C546.589967,407.202676 556.179264,399.325753 564.741137,394.188629 C587.002007,381.174582 615.08495,381.174582 637.688294,394.531104 C656.86689,405.490301 662.688963,416.449498 702.416054,515.767224 C716.11505,550.357191 728.444147,578.440134 729.814047,578.440134 C731.183946,578.440134 735.978595,568.850836 740.773244,556.864214 C793.514381,424.668896 718.512375,278.089632 578.782609,240.759866 C547.274916,232.197993 489.73913,233.225418 453.779264,242.472241 C357.886288,267.47291 282.541806,339.735117 252.746488,434.600669 C245.89699,456.861538 240.662207,474.35786 239.494983,513.667559 C240.662207,546.589967 245.89699,569.878261 252.746488,592.13913 C281.171906,681.525084 344.529766,748.307692 429.80602,777.760535 C481.519732,795.569231 523.644147,797.62408 591.796656,785.294983 L602.755853,783.240134 L602.755853,831.186622 L602.755853,879.475585 L590.084281,882.215385 C582.892308,883.585284 564.741137,888.379933 532.548495,888.379933 C494.153846,888.379933 457.546488,883.927759 426.723746,875.365886 C260.623411,829.131773 147.264214,682.210033 147.264214,513.3699 C147.264214,345.214716 263.020736,194.525753 425.011371,152.401338 C468.163211,141.099666 488.792642,140.414716 518.164548,140.414716 C546.591801,140.414716 571.248161,142.12709 588.371906,145.551839 Z" id="Combined-Shape" fill="#4B66A3"></path>
9 </g>
10</svg> \ No newline at end of file
diff --git a/recipes/workplace/index.js b/recipes/workplace/index.js
new file mode 100644
index 0000000..e8243fb
--- /dev/null
+++ b/recipes/workplace/index.js
@@ -0,0 +1,3 @@
1"use strict";
2
3module.exports = Franz => Franz; \ No newline at end of file
diff --git a/recipes/workplace/package.json b/recipes/workplace/package.json
new file mode 100644
index 0000000..cb2193f
--- /dev/null
+++ b/recipes/workplace/package.json
@@ -0,0 +1,16 @@
1{
2 "id": "workplace",
3 "name": "Workplace",
4 "version": "1.1.1",
5 "description": "Workplace by facebook",
6 "main": "index.js",
7 "author": "Rico Herwig <rherwig4711@gmail.com>, Stefan Malzner <stefan@adlk.io>",
8 "license": "MIT",
9 "config": {
10 "serviceURL": "https://{teamId}.workplace.com/chat",
11 "hasNotificationSound": true,
12 "hasDirectMessages": true,
13 "hasTeamId": true,
14 "urlInputSuffix": ".workplace.com"
15 }
16 }
diff --git a/recipes/workplace/webview.js b/recipes/workplace/webview.js
new file mode 100644
index 0000000..a26515e
--- /dev/null
+++ b/recipes/workplace/webview.js
@@ -0,0 +1,51 @@
1"use strict";
2
3const path = require('path');
4
5module.exports = Franz => {
6 const getMessages = () => {
7 let direct = 0;
8 let indirect = 0;
9 const chatsElement = document.querySelector('#chats');
10 const notifications = document.querySelector('#notifications span span');
11
12 if (notifications) {
13 indirect = parseInt(notifications.innerText, 10);
14 }
15
16 if (chatsElement) {
17 if (!chatsElement.hasAttribute('aria-current')) {
18 const chatMessages = chatsElement.querySelector('span');
19
20 if (chatMessages) {
21 direct = parseInt(chatMessages.innerText, 10);
22 }
23 } else {
24 direct = document.querySelectorAll('[data-pagelet="WorkGalahadChannel"] .uiList [role="gridcell"] [role="button"] .oxk9n0fw').length;
25 }
26 }
27
28 Franz.setBadge(direct, indirect);
29 };
30
31 Franz.injectCSS(path.join(__dirname, 'workplace.css'));
32 Franz.loop(getMessages);
33 localStorage._cs_desktopNotifsEnabled = JSON.stringify({
34 __t: new Date().getTime(),
35 __v: true
36 });
37
38 if (typeof Franz.onNotify === 'function') {
39 Franz.onNotify(notification => {
40 if (typeof notification.title !== 'string') {
41 notification.title = ((notification.title.props || {}).content || [])[0] || 'Work Chat';
42 }
43
44 if (typeof notification.options.body !== 'string') {
45 notification.options.body = (((notification.options.body || {}).props || {}).content || [])[0] || '';
46 }
47
48 return notification;
49 });
50 }
51}; \ No newline at end of file
diff --git a/recipes/workplace/workplace.css b/recipes/workplace/workplace.css
new file mode 100644
index 0000000..4830348
--- /dev/null
+++ b/recipes/workplace/workplace.css
@@ -0,0 +1,4 @@
1#pagelet_bluebar,
2#pageFooter {
3 display: none;
4}