diff options
author | 2021-08-29 11:06:10 +0530 | |
---|---|---|
committer | 2021-08-29 11:07:31 +0530 | |
commit | 7576ea7f6b6f68d3e19474be06b38123d918ee5d (patch) | |
tree | 5ddde7141122d532749582c498cf5b350995ce64 /recipes/enterprise-owa/webview.js | |
parent | New recipe: aws (amazon web services) (#643) (diff) | |
download | ferdium-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/enterprise-owa/webview.js')
-rw-r--r-- | recipes/enterprise-owa/webview.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/recipes/enterprise-owa/webview.js b/recipes/enterprise-owa/webview.js deleted file mode 100644 index de007b3..0000000 --- a/recipes/enterprise-owa/webview.js +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | module.exports = Ferdi => { | ||
2 | const getMessages = 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 folders = document.querySelector('div[title="Folders"]'); | ||
16 | if (!folders) { | ||
17 | return; | ||
18 | } | ||
19 | |||
20 | unreadMail = [...folders.parentNode.children].reduce((count, child) => { | ||
21 | const unread = child.querySelector('.screenReaderOnly'); | ||
22 | return unread && unread.textContent === 'unread' | ||
23 | ? count + parseInt(unread.previousSibling.textContent, 10) | ||
24 | : count; | ||
25 | }, 0); | ||
26 | } | ||
27 | |||
28 | Ferdi.setBadge(unreadMail); | ||
29 | }; | ||
30 | |||
31 | Ferdi.loop(getMessages); | ||
32 | }; | ||