diff options
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 | }; | ||