aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/amazon-work-mail
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-09-12 22:01:51 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-09-12 22:06:03 +0530
commit9db43e100a672b6d6932ac68c0fbe503c129138b (patch)
tree4f6a31d25a7345c5d92dbd8b80d30ce7d129944f /recipes/amazon-work-mail
parentNew recipe: 'stackoverflow' (#707) (diff)
downloadferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.tar.gz
ferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.tar.zst
ferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.zip
Added a check to verify that the folder name of the recipe matches the recipe id (#708)
Use the recipe-id as master to rename internal folder names
Diffstat (limited to 'recipes/amazon-work-mail')
-rw-r--r--recipes/amazon-work-mail/.gitignore2
-rw-r--r--recipes/amazon-work-mail/LICENSE21
-rwxr-xr-xrecipes/amazon-work-mail/icon.svg1
-rw-r--r--recipes/amazon-work-mail/index.js1
-rw-r--r--recipes/amazon-work-mail/package.json11
-rw-r--r--recipes/amazon-work-mail/webview.js32
6 files changed, 68 insertions, 0 deletions
diff --git a/recipes/amazon-work-mail/.gitignore b/recipes/amazon-work-mail/.gitignore
new file mode 100644
index 0000000..63137ec
--- /dev/null
+++ b/recipes/amazon-work-mail/.gitignore
@@ -0,0 +1,2 @@
1# Linter
2.jshintrc
diff --git a/recipes/amazon-work-mail/LICENSE b/recipes/amazon-work-mail/LICENSE
new file mode 100644
index 0000000..231d35b
--- /dev/null
+++ b/recipes/amazon-work-mail/LICENSE
@@ -0,0 +1,21 @@
1MIT License
2
3Copyright (c) 2017 Yoav Maman
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/amazon-work-mail/icon.svg b/recipes/amazon-work-mail/icon.svg
new file mode 100755
index 0000000..72a9bfb
--- /dev/null
+++ b/recipes/amazon-work-mail/icon.svg
@@ -0,0 +1 @@
<svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><linearGradient id="a" x1="50" y1="-687.73" x2="50" y2="-603.9" gradientTransform="translate(0 696)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f58536"/><stop offset="1" stop-color="#d16929"/></linearGradient></defs><path fill="url(#a)" d="M13 28.9 50 7.8l37 21.1v42.2L50 92.2 13 71.1V28.9z"/><path d="M71.4 35.8v9l-22.1 9.8-22.1-9.8v-9h-3.9v33h51.9v-33zm0 29.2H27.3V49.2L49.4 59l22.1-9.8V65z" fill="#fff"/><path fill="#fff" d="M49.3 21.7 23.4 33.3v5.1h3.9v-2.5l22-9.9 22.1 9.9v2.5h3.9v-5.1l-26-11.6z"/><path fill="#fff" d="M35.1 48.4v-6.3h28.4v6.3l4-1.8v-8.5H31.2v8.5l3.9 1.8z"/></svg> \ No newline at end of file
diff --git a/recipes/amazon-work-mail/index.js b/recipes/amazon-work-mail/index.js
new file mode 100644
index 0000000..23607bd
--- /dev/null
+++ b/recipes/amazon-work-mail/index.js
@@ -0,0 +1 @@
module.exports = Ferdi => Ferdi;
diff --git a/recipes/amazon-work-mail/package.json b/recipes/amazon-work-mail/package.json
new file mode 100644
index 0000000..e407dd2
--- /dev/null
+++ b/recipes/amazon-work-mail/package.json
@@ -0,0 +1,11 @@
1{
2 "id": "amazon-work-mail",
3 "name": "Amazon WorkMail",
4 "version": "1.1.1",
5 "license": "MIT",
6 "config": {
7 "serviceURL": "https://{teamID}.awsapps.com/mail",
8 "hasIndirectMessages": false,
9 "hasTeamId": true
10 }
11}
diff --git a/recipes/amazon-work-mail/webview.js b/recipes/amazon-work-mail/webview.js
new file mode 100644
index 0000000..944a15c
--- /dev/null
+++ b/recipes/amazon-work-mail/webview.js
@@ -0,0 +1,32 @@
1module.exports = (Ferdi) => {
2 const reload = (EventType) => new Promise((resolve, reject) => {
3 const btn = document.getElementsByClassName('giraffe-hierarchy-node-refresh')[0];
4 const EventObject = document.createEvent('Events');
5 EventObject.initEvent(EventType, true, false);
6
7 if (btn.dispatchEvent(EventObject)) {
8 resolve();
9 } else {
10 reject();
11 }
12 });
13
14 const getUnread = () => {
15 const nodes = document.getElementsByClassName('giraffe-hierarchy-node-counter');
16 let counter = 0;
17
18 for (let i = 0; i < nodes.length; i++) {
19 counter += Ferdi.safeParseInt(nodes[i].innerText);
20 }
21
22 Ferdi.setBadge(counter);
23 };
24
25 if (!window.location.pathname.includes('auth')) {
26 Ferdi.loop(getUnread);
27
28 window.setInterval(() => {
29 reload('click');
30 }, 60000);
31 }
32};