aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/outlook/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-29 11:06:10 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-29 11:07:31 +0530
commit7576ea7f6b6f68d3e19474be06b38123d918ee5d (patch)
tree5ddde7141122d532749582c498cf5b350995ce64 /recipes/outlook/webview.js
parentNew recipe: aws (amazon web services) (#643) (diff)
downloadferdium-recipes-7576ea7f6b6f68d3e19474be06b38123d918ee5d.tar.gz
ferdium-recipes-7576ea7f6b6f68d3e19474be06b38123d918ee5d.tar.zst
ferdium-recipes-7576ea7f6b6f68d3e19474be06b38123d918ee5d.zip
cleanup: Remove duplicated recipes for Outlook Web App and Enterprise OWA. Fixes #523
Diffstat (limited to 'recipes/outlook/webview.js')
-rw-r--r--recipes/outlook/webview.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/recipes/outlook/webview.js b/recipes/outlook/webview.js
deleted file mode 100644
index 123158e..0000000
--- a/recipes/outlook/webview.js
+++ /dev/null
@@ -1,33 +0,0 @@
1module.exports = Ferdi => {
2 function getMessages() {
3 let unreadMail = 0;
4
5 if (location.pathname.match(/\/owa/)) {
6 // classic app
7 unreadMail = parseInt(
8 jQuery("span[title*='Inbox'] + div > span")
9 .first()
10 .text(),
11 10,
12 );
13 } else {
14 // new app
15 const favorites = document.querySelector('div[title="Favorites"]');
16 if (!favorites) {
17 return;
18 }
19 const folders = Array.from(favorites.nextSibling.childNodes);
20
21 unreadMail = folders.reduce((count, child) => {
22 const unread = child.querySelector('.screenReaderOnly');
23 return unread && unread.textContent === 'unread'
24 ? count + parseInt(unread.previousSibling.textContent, 10)
25 : count;
26 }, 0);
27 }
28
29 Ferdi.setBadge(unreadMail);
30 }
31
32 Ferdi.loop(getMessages);
33};