From cb706c0c901b39bcd12f2a5ef407e59e669c0d43 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Wed, 19 May 2021 22:40:12 +0530 Subject: Added new recipe: amazon-workmail (fixes #491) --- recipes/aws-workmail/.gitignore | 2 ++ recipes/aws-workmail/LICENSE | 21 +++++++++++++++++++++ recipes/aws-workmail/README.md | 21 +++++++++++++++++++++ recipes/aws-workmail/icon.png | Bin 0 -> 371197 bytes recipes/aws-workmail/icon.svg | 13 +++++++++++++ recipes/aws-workmail/index.js | 1 + recipes/aws-workmail/package.json | 25 +++++++++++++++++++++++++ recipes/aws-workmail/webview.js | 35 +++++++++++++++++++++++++++++++++++ 8 files changed, 118 insertions(+) create mode 100644 recipes/aws-workmail/.gitignore create mode 100644 recipes/aws-workmail/LICENSE create mode 100644 recipes/aws-workmail/README.md create mode 100644 recipes/aws-workmail/icon.png create mode 100755 recipes/aws-workmail/icon.svg create mode 100644 recipes/aws-workmail/index.js create mode 100644 recipes/aws-workmail/package.json create mode 100644 recipes/aws-workmail/webview.js (limited to 'recipes') 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 @@ +# Linter +.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 @@ +MIT License + +Copyright (c) 2017 Yoav Maman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +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 @@ +# franz-aws-workmail-plugin + +[![GitHub release](https://img.shields.io/github/release/yoavmmn/franz-aws-workmail-plugin.svg)](https://github.com/yoavmmn/franz-aws-workmail-plugin/releases/latest) +[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/yoavmmn/franz-aws-workmail-plugin/master/LICENSE) + +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). + +## Installation +1. To install this plugin, use one of the following methods to clone the repository: + * Download the zip file from the [latest release](https://github.com/yoavmmn/franz-aws-workmail-plugin/releases/latest) + * git: `git clone https://github.com/yoavmmn/franz-aws-workmail-plugin.git` + * wget: `wget https://github.com/yoavmmn/franz-aws-workmail-plugin/archive/master.zip` +2. Open the Franz Plugins folder on your machine: + * Linux: `~/.config/Franz/Plugins` + * Mac: `~/Library/Application\ Support/Franz/Plugins/` + * Windows: `%appdata%/Franz/Plugins` + * _Alternatively: Go to your Franz settings page, scroll down to the bottom and you will see an option to "Open the Franz plugin directory"_ +3. Copy the `franz-aws-workmail-plugin` folder into the plugins directory +4. Restart Franz + +Thats it. Enjoy. diff --git a/recipes/aws-workmail/icon.png b/recipes/aws-workmail/icon.png new file mode 100644 index 0000000..feb2682 Binary files /dev/null and b/recipes/aws-workmail/icon.png 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 @@ + + + + + + + + BusinessProductivity + + + + + 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 @@ +{ + "id": "amazon-work-mail", + "name": "Amazon WorkMail", + "version": "1.0.2", + "description": "Amazon WorkMail", + "main": "index.js", + "author": "Yoav Maman", + "license": "MIT", + "config": { + "serviceURL": "https://{teamID}.awsapps.com/mail", + "serviceName": "Amazon WorkMail", + "popup": [], + "hasNotificationSound": false, + "hasIdirectMessages": false, + "hasTeamID": true, + "customURL": false, + "hostedOnly": false, + "webviewOptions": {}, + "openDevTools": false, + "wording": { + "url": "awsapps.com", + "team": "WorkMail" + } + } +} 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 @@ +module.exports = (Franz, options) => { + const reload = (EventType) => { + return new Promise((resolve, reject) => { + const btn = document.getElementsByClassName('giraffe-hierarchy-node-refresh')[0]; + const EventObject = document.createEvent('Events'); + EventObject.initEvent(EventType, true, false); + + if (btn.dispatchEvent(EventObject)) { + resolve(); + } else { + reject(); + } + }); + }; + + const getUnread = () => { + const nodes = document.getElementsByClassName('giraffe-hierarchy-node-counter'); + let counter = 0; + + for (var i = 0; i < nodes.length; i++) { + let node = parseInt(nodes[i].innerText); + counter += (node > 0) ? node : 0; + } + + Franz.setBadge(counter); + }; + + if (!window.location.pathname.includes('auth')) { + Franz.loop(getUnread); + + window.setInterval(function() { + reload('click'); + }, 60000); + } +}; -- cgit v1.2.3-54-g00ecf