diff options
author | 2020-09-22 20:56:48 +0200 | |
---|---|---|
committer | 2020-09-22 19:56:48 +0100 | |
commit | 6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch) | |
tree | 9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /uncompressed/enterprise-owa/webview.js | |
parent | Updated logos for Outlook/OWA (diff) | |
download | ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.gz ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.tar.zst ferdium-recipes-6f5e4a00588aefdda7a5a1cfe70935870e7e234a.zip |
Unpack recipes and update recipes icons (#292)
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
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 | }; | ||