diff options
Diffstat (limited to 'recipes/aws-workmail')
-rw-r--r-- | recipes/aws-workmail/.gitignore | 2 | ||||
-rw-r--r-- | recipes/aws-workmail/LICENSE | 21 | ||||
-rw-r--r-- | recipes/aws-workmail/README.md | 21 | ||||
-rw-r--r-- | recipes/aws-workmail/icon.png | bin | 0 -> 371197 bytes | |||
-rwxr-xr-x | recipes/aws-workmail/icon.svg | 13 | ||||
-rw-r--r-- | recipes/aws-workmail/index.js | 1 | ||||
-rw-r--r-- | recipes/aws-workmail/package.json | 25 | ||||
-rw-r--r-- | recipes/aws-workmail/webview.js | 35 |
8 files changed, 118 insertions, 0 deletions
diff --git a/recipes/aws-workmail/.gitignore b/recipes/aws-workmail/.gitignore new file mode 100644 index 0000000..63137ec --- /dev/null +++ b/recipes/aws-workmail/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | # Linter | ||
2 | .jshintrc | ||
diff --git a/recipes/aws-workmail/LICENSE b/recipes/aws-workmail/LICENSE new file mode 100644 index 0000000..231d35b --- /dev/null +++ b/recipes/aws-workmail/LICENSE | |||
@@ -0,0 +1,21 @@ | |||
1 | MIT License | ||
2 | |||
3 | Copyright (c) 2017 Yoav Maman | ||
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/recipes/aws-workmail/README.md b/recipes/aws-workmail/README.md new file mode 100644 index 0000000..dcdfe59 --- /dev/null +++ b/recipes/aws-workmail/README.md | |||
@@ -0,0 +1,21 @@ | |||
1 | # franz-aws-workmail-plugin | ||
2 | |||
3 | [![GitHub release](https://img.shields.io/github/release/yoavmmn/franz-aws-workmail-plugin.svg)](https://github.com/yoavmmn/franz-aws-workmail-plugin/releases/latest) | ||
4 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/yoavmmn/franz-aws-workmail-plugin/master/LICENSE) | ||
5 | |||
6 | The minimum required version of Franz to run custom integrations is 4.0.0. You can download the latest version of Franz [here](http://meetfranz.com/#download_all). | ||
7 | |||
8 | ## Installation | ||
9 | 1. To install this plugin, use one of the following methods to clone the repository: | ||
10 | * Download the zip file from the [latest release](https://github.com/yoavmmn/franz-aws-workmail-plugin/releases/latest) | ||
11 | * git: `git clone https://github.com/yoavmmn/franz-aws-workmail-plugin.git` | ||
12 | * wget: `wget https://github.com/yoavmmn/franz-aws-workmail-plugin/archive/master.zip` | ||
13 | 2. Open the Franz Plugins folder on your machine: | ||
14 | * Linux: `~/.config/Franz/Plugins` | ||
15 | * Mac: `~/Library/Application\ Support/Franz/Plugins/` | ||
16 | * Windows: `%appdata%/Franz/Plugins` | ||
17 | * _Alternatively: Go to your Franz settings page, scroll down to the bottom and you will see an option to "Open the Franz plugin directory"_ | ||
18 | 3. Copy the `franz-aws-workmail-plugin` folder into the plugins directory | ||
19 | 4. Restart Franz | ||
20 | |||
21 | Thats it. Enjoy. | ||
diff --git a/recipes/aws-workmail/icon.png b/recipes/aws-workmail/icon.png new file mode 100644 index 0000000..feb2682 --- /dev/null +++ b/recipes/aws-workmail/icon.png | |||
Binary files differ | |||
diff --git a/recipes/aws-workmail/icon.svg b/recipes/aws-workmail/icon.svg new file mode 100755 index 0000000..8e33da1 --- /dev/null +++ b/recipes/aws-workmail/icon.svg | |||
@@ -0,0 +1,13 @@ | |||
1 | <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" viewBox="0 0 100 100"> | ||
2 | <defs> | ||
3 | <linearGradient id="linear-gradient" x1="50" y1="-687.73" x2="50" y2="-603.9" gradientTransform="translate(0 696)" gradientUnits="userSpaceOnUse"> | ||
4 | <stop offset="0" stop-color="#f58536"/> | ||
5 | <stop offset="1" stop-color="#d16929"/> | ||
6 | </linearGradient> | ||
7 | </defs> | ||
8 | <title>BusinessProductivity</title> | ||
9 | <polygon points="13 28.9 50 7.8 87 28.9 87 71.1 50 92.2 13 71.1 13 28.9" fill="url(#linear-gradient)"/> | ||
10 | <path d="M71.4,35.8v9L49.3,54.6,27.2,44.8v-9H23.3v33H75.2v-33Zm0,29.2H27.3V49.2L49.4,59l22.1-9.8V65Z" fill="#fff"/> | ||
11 | <polygon points="49.3 21.7 23.4 33.3 23.4 38.4 27.3 38.4 27.3 35.9 49.3 26 71.4 35.9 71.4 38.4 75.3 38.4 75.3 33.3 49.3 21.7" fill="#fff"/> | ||
12 | <polygon points="35.1 48.4 35.1 42.1 63.5 42.1 63.5 48.4 67.5 46.6 67.5 38.1 31.2 38.1 31.2 46.6 35.1 48.4" fill="#fff"/> | ||
13 | </svg> | ||
diff --git a/recipes/aws-workmail/index.js b/recipes/aws-workmail/index.js new file mode 100644 index 0000000..258da41 --- /dev/null +++ b/recipes/aws-workmail/index.js | |||
@@ -0,0 +1 @@ | |||
module.exports = Franz => Franz; | |||
diff --git a/recipes/aws-workmail/package.json b/recipes/aws-workmail/package.json new file mode 100644 index 0000000..e2231f5 --- /dev/null +++ b/recipes/aws-workmail/package.json | |||
@@ -0,0 +1,25 @@ | |||
1 | { | ||
2 | "id": "amazon-work-mail", | ||
3 | "name": "Amazon WorkMail", | ||
4 | "version": "1.0.2", | ||
5 | "description": "Amazon WorkMail", | ||
6 | "main": "index.js", | ||
7 | "author": "Yoav Maman", | ||
8 | "license": "MIT", | ||
9 | "config": { | ||
10 | "serviceURL": "https://{teamID}.awsapps.com/mail", | ||
11 | "serviceName": "Amazon WorkMail", | ||
12 | "popup": [], | ||
13 | "hasNotificationSound": false, | ||
14 | "hasIdirectMessages": false, | ||
15 | "hasTeamID": true, | ||
16 | "customURL": false, | ||
17 | "hostedOnly": false, | ||
18 | "webviewOptions": {}, | ||
19 | "openDevTools": false, | ||
20 | "wording": { | ||
21 | "url": "awsapps.com", | ||
22 | "team": "WorkMail" | ||
23 | } | ||
24 | } | ||
25 | } | ||
diff --git a/recipes/aws-workmail/webview.js b/recipes/aws-workmail/webview.js new file mode 100644 index 0000000..a979903 --- /dev/null +++ b/recipes/aws-workmail/webview.js | |||
@@ -0,0 +1,35 @@ | |||
1 | module.exports = (Franz, options) => { | ||
2 | const reload = (EventType) => { | ||
3 | return new Promise((resolve, reject) => { | ||
4 | const btn = document.getElementsByClassName('giraffe-hierarchy-node-refresh')[0]; | ||
5 | const EventObject = document.createEvent('Events'); | ||
6 | EventObject.initEvent(EventType, true, false); | ||
7 | |||
8 | if (btn.dispatchEvent(EventObject)) { | ||
9 | resolve(); | ||
10 | } else { | ||
11 | reject(); | ||
12 | } | ||
13 | }); | ||
14 | }; | ||
15 | |||
16 | const getUnread = () => { | ||
17 | const nodes = document.getElementsByClassName('giraffe-hierarchy-node-counter'); | ||
18 | let counter = 0; | ||
19 | |||
20 | for (var i = 0; i < nodes.length; i++) { | ||
21 | let node = parseInt(nodes[i].innerText); | ||
22 | counter += (node > 0) ? node : 0; | ||
23 | } | ||
24 | |||
25 | Franz.setBadge(counter); | ||
26 | }; | ||
27 | |||
28 | if (!window.location.pathname.includes('auth')) { | ||
29 | Franz.loop(getUnread); | ||
30 | |||
31 | window.setInterval(function() { | ||
32 | reload('click'); | ||
33 | }, 60000); | ||
34 | } | ||
35 | }; | ||