aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/chatwork
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/chatwork
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/chatwork')
-rw-r--r--recipes/chatwork/LICENSE21
-rw-r--r--recipes/chatwork/README.md24
-rw-r--r--recipes/chatwork/icon.pngbin0 -> 57962 bytes
-rw-r--r--recipes/chatwork/icon.svg12
-rw-r--r--recipes/chatwork/index.js3
-rw-r--r--recipes/chatwork/package.json16
-rw-r--r--recipes/chatwork/webview.js38
7 files changed, 114 insertions, 0 deletions
diff --git a/recipes/chatwork/LICENSE b/recipes/chatwork/LICENSE
new file mode 100644
index 0000000..668de24
--- /dev/null
+++ b/recipes/chatwork/LICENSE
@@ -0,0 +1,21 @@
1MIT License
2
3Copyright (c) 2017 Koma, hideosasaki
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all
13copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21SOFTWARE.
diff --git a/recipes/chatwork/README.md b/recipes/chatwork/README.md
new file mode 100644
index 0000000..6e23ddb
--- /dev/null
+++ b/recipes/chatwork/README.md
@@ -0,0 +1,24 @@
1# ChatWork
2Recipe for [ChatWork](https://www.chatwork.com) integration with [Franz 5](http://meetfranz.com)
3
4## To test this dev release
5
61. Clone/download the folder `recipe-chatwork`.
7
82. Open the Franz Recipe folder on your machine:
9 * Mac: `~/Library/Application Support/Franz/recipes/`
10 * Windows: `%appdata%/Franz/recipes/`
11 * Linux: `~/.config/Franz/recipes/`
12
133. Create a `dev` folder if you have not already done so
14
153. Unzip and copy the `recipe-chatwork` folder into the recipes dev directory
16
174. Restart Franz
18
19## How to create your own Franz recipes:
20[Read the documentation](https://github.com/meetfranz/plugins)
21
22## Authors
23 * [Koma](https://github.com/koma-private/)
24 * [hideosasaki](https://github.com/hideosasaki)
diff --git a/recipes/chatwork/icon.png b/recipes/chatwork/icon.png
new file mode 100644
index 0000000..e872fce
--- /dev/null
+++ b/recipes/chatwork/icon.png
Binary files differ
diff --git a/recipes/chatwork/icon.svg b/recipes/chatwork/icon.svg
new file mode 100644
index 0000000..cdf41c2
--- /dev/null
+++ b/recipes/chatwork/icon.svg
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="UTF-8"?>
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 55.1 (78136) - https://sketchapp.com -->
4 <title>chatwork</title>
5 <desc>Created with Sketch.</desc>
6 <g id="chatwork" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7 <g id="Group" fill-rule="nonzero">
8 <path d="M62.3276594,4.69260532 C57.8280689,0.191600596 51.0869521,-1.21781966 45.1587049,1.10295203 C39.2304578,3.42372372 35.241804,9.03360114 35,15.3907522 L35,30.5492034 C35,31.3400231 35.641619,31.9811092 36.4330961,31.9811092 L50.3028304,31.9811092 C54.7904092,32.2000797 59.1604319,30.5073546 62.3276594,27.3233006 C68.5574469,21.0638038 68.5574469,10.9521022 62.3276594,4.69260532 L62.3276594,4.69260532 Z" id="Path" fill="#13202F"></path>
9 <path d="M4.68798259,16.7555167 C0.191411848,21.3352081 -1.21661997,28.196329 1.1018655,34.2301096 C3.42035097,40.2638903 9.02470204,44.3235494 15.3755906,44.5696579 L30.5355515,44.5696579 C30.9134479,44.5696579 31.2756322,44.4154768 31.5412963,44.1414419 C31.8069604,43.8674071 31.9539984,43.4963471 31.9496043,43.1110502 L31.9496043,28.9944095 C32.1725515,24.4262525 30.4808553,19.9767557 27.2963842,16.7555167 C21.0430536,10.4148278 10.9413131,10.4148278 4.68798259,16.7555167 L4.68798259,16.7555167 Z M16.9211831,75.2674835 C21.4145232,79.8165966 28.1180994,81.2318268 34.013541,78.8759487 C39.9089825,76.5200706 43.8844427,70.8373894 44.1499199,64.3866049 L44.1499199,48.9287156 C44.1499199,48.5433927 43.9987103,48.1740907 43.7299571,47.9032056 C43.4612039,47.6323206 43.0972955,47.482393 42.7194247,47.4868735 L28.9241891,47.4868735 C24.4440767,47.2595448 20.0803374,48.9844867 16.9211831,52.2315401 C10.7046064,58.6020243 10.7046064,68.8969994 16.9211831,75.2674835 L16.9211831,75.2674835 Z M74.305417,62.8609347 C78.8047353,58.2876966 80.2167991,51.4296556 77.9011164,45.3975214 C75.5854336,39.3653871 69.9827062,35.3071463 63.6342514,35.063559 L48.4742905,35.063559 C47.6906267,35.063559 47.0528029,35.7063894 47.0437953,36.5054012 L47.0437953,50.6220419 C46.8188128,55.1937809 48.5176006,59.6461972 51.7134579,62.8609347 C57.9536906,69.2181074 68.0651842,69.2181074 74.305417,62.8609347 L74.305417,62.8609347 Z" id="Shape" fill="#F03748"></path>
10 </g>
11 </g>
12</svg> \ No newline at end of file
diff --git a/recipes/chatwork/index.js b/recipes/chatwork/index.js
new file mode 100644
index 0000000..a409287
--- /dev/null
+++ b/recipes/chatwork/index.js
@@ -0,0 +1,3 @@
1'use strict';
2
3module.exports = Franz => Franz; \ No newline at end of file
diff --git a/recipes/chatwork/package.json b/recipes/chatwork/package.json
new file mode 100644
index 0000000..cc7e14b
--- /dev/null
+++ b/recipes/chatwork/package.json
@@ -0,0 +1,16 @@
1{
2 "id": "chatwork",
3 "name": "ChatWork",
4 "version": "1.0.3",
5 "description": "ChatWork is a group chat app for business.",
6 "main": "index.js",
7 "author": "Koma, hideosasaki",
8 "license": "MIT",
9 "repository": "https://github.com/hideosasaki/recipe-chatwork",
10 "config": {
11 "serviceURL": "https://www.chatwork.com/login.php",
12 "hasNotificationSound": true,
13 "hasIndirectMessages": true
14 },
15 "openDevTools": true
16} \ No newline at end of file
diff --git a/recipes/chatwork/webview.js b/recipes/chatwork/webview.js
new file mode 100644
index 0000000..48a3fbf
--- /dev/null
+++ b/recipes/chatwork/webview.js
@@ -0,0 +1,38 @@
1'use strict';
2
3module.exports = (Franz, options) => {
4 function getMessages() {
5 let groupCount = 0;
6 let individualCount = 0;
7 let directCount = 0;
8 let indirectCount = 0;
9 let roomInfoContainer = document.querySelectorAll('li.sc-dnqmqq');
10 Array.prototype.forEach.call(roomInfoContainer, function (room) {
11 let count = 0;
12 let unreadBadge = room.querySelector("span.sc-kAzzGY");
13 let unreadBadgeHasMention = room.querySelector("li._unreadBadge.sc-cSHVUG");
14
15 if (unreadBadge && unreadBadge.innerText) {
16 count = parseInt(unreadBadge.innerText);
17 }
18
19 if (0 < count) {
20 if (room.querySelector("img.sc-gqjmRU").getAttribute('src').indexOf('avatar') < 0) {
21 groupCount += count;
22
23 if (unreadBadgeHasMention) {
24 directCount++;
25 } else {
26 indirectCount++;
27 }
28 } else {
29 individualCount += count;
30 directCount++;
31 }
32 }
33 });
34 Franz.setBadge(directCount, indirectCount);
35 }
36
37 Franz.loop(getMessages);
38}; \ No newline at end of file