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/chatwork | |
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/chatwork')
-rw-r--r-- | uncompressed/chatwork/LICENSE | 21 | ||||
-rw-r--r-- | uncompressed/chatwork/README.md | 24 | ||||
-rw-r--r-- | uncompressed/chatwork/icon.svg | 12 | ||||
-rw-r--r-- | uncompressed/chatwork/index.js | 3 | ||||
-rw-r--r-- | uncompressed/chatwork/package.json | 16 | ||||
-rw-r--r-- | uncompressed/chatwork/webview.js | 38 |
6 files changed, 114 insertions, 0 deletions
diff --git a/uncompressed/chatwork/LICENSE b/uncompressed/chatwork/LICENSE new file mode 100644 index 0000000..668de24 --- /dev/null +++ b/uncompressed/chatwork/LICENSE | |||
@@ -0,0 +1,21 @@ | |||
1 | MIT License | ||
2 | |||
3 | Copyright (c) 2017 Koma, hideosasaki | ||
4 | |||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | of this software and associated documentation files (the "Software"), to deal | ||
7 | in the Software without restriction, including without limitation the rights | ||
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | copies of the Software, and to permit persons to whom the Software is | ||
10 | furnished to do so, subject to the following conditions: | ||
11 | |||
12 | The above copyright notice and this permission notice shall be included in all | ||
13 | copies or substantial portions of the Software. | ||
14 | |||
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
21 | SOFTWARE. | ||
diff --git a/uncompressed/chatwork/README.md b/uncompressed/chatwork/README.md new file mode 100644 index 0000000..6e23ddb --- /dev/null +++ b/uncompressed/chatwork/README.md | |||
@@ -0,0 +1,24 @@ | |||
1 | # ChatWork | ||
2 | Recipe for [ChatWork](https://www.chatwork.com) integration with [Franz 5](http://meetfranz.com) | ||
3 | |||
4 | ## To test this dev release | ||
5 | |||
6 | 1. Clone/download the folder `recipe-chatwork`. | ||
7 | |||
8 | 2. 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 | |||
13 | 3. Create a `dev` folder if you have not already done so | ||
14 | |||
15 | 3. Unzip and copy the `recipe-chatwork` folder into the recipes dev directory | ||
16 | |||
17 | 4. 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/uncompressed/chatwork/icon.svg b/uncompressed/chatwork/icon.svg new file mode 100644 index 0000000..cdf41c2 --- /dev/null +++ b/uncompressed/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/uncompressed/chatwork/index.js b/uncompressed/chatwork/index.js new file mode 100644 index 0000000..a409287 --- /dev/null +++ b/uncompressed/chatwork/index.js | |||
@@ -0,0 +1,3 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = Franz => Franz; \ No newline at end of file | ||
diff --git a/uncompressed/chatwork/package.json b/uncompressed/chatwork/package.json new file mode 100644 index 0000000..cc7e14b --- /dev/null +++ b/uncompressed/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/uncompressed/chatwork/webview.js b/uncompressed/chatwork/webview.js new file mode 100644 index 0000000..48a3fbf --- /dev/null +++ b/uncompressed/chatwork/webview.js | |||
@@ -0,0 +1,38 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.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 | ||