diff options
Diffstat (limited to 'uncompressed/enterprise-owa/webview.js')
-rw-r--r-- | uncompressed/enterprise-owa/webview.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/uncompressed/enterprise-owa/webview.js b/uncompressed/enterprise-owa/webview.js deleted file mode 100644 index e144c46..0000000 --- a/uncompressed/enterprise-owa/webview.js +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = function getMessages() { | ||
5 | let unreadMail = 0; | ||
6 | |||
7 | if (location.pathname.match(/\/owa/)) { | ||
8 | // classic app | ||
9 | unreadMail = parseInt( | ||
10 | jQuery("span[title*='Inbox'] + div > span") | ||
11 | .first() | ||
12 | .text(), | ||
13 | 10 | ||
14 | ); | ||
15 | } else { | ||
16 | // new app | ||
17 | const folders = document.querySelector('div[title="Folders"]'); | ||
18 | if (!folders) { | ||
19 | return; | ||
20 | } | ||
21 | |||
22 | unreadMail = [...folders.parentNode.children].reduce((count, child) => { | ||
23 | const unread = child.querySelector('.screenReaderOnly'); | ||
24 | return unread && unread.textContent === 'unread' | ||
25 | ? count + parseInt(unread.previousSibling.textContent, 10) | ||
26 | : count; | ||
27 | }, 0); | ||
28 | } | ||
29 | |||
30 | Franz.setBadge(unreadMail); | ||
31 | }; | ||
32 | Franz.loop(getMessages); | ||
33 | }; | ||