diff options
author | Bennett <hello@vantezzen.io> | 2020-09-22 20:56:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 19:56:48 +0100 |
commit | 6f5e4a00588aefdda7a5a1cfe70935870e7e234a (patch) | |
tree | 9e29aa7aa0620a1a4a968ff8739b4b8ba96791a9 /recipes/github/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 'recipes/github/webview.js')
-rw-r--r-- | recipes/github/webview.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/recipes/github/webview.js b/recipes/github/webview.js new file mode 100644 index 0000000..c3e8729 --- /dev/null +++ b/recipes/github/webview.js | |||
@@ -0,0 +1,20 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => { | ||
4 | const getMessages = function getMessages() { | ||
5 | const directCountElement = document.querySelector('.filter-list .count'); | ||
6 | const indirectCountElement = document.querySelector('[class*="mail-status unread"]') | ||
7 | let directCount, indirectCount | ||
8 | if (directCountElement) { | ||
9 | directCount = parseInt(directCountElement.innerHTML, 10); | ||
10 | } else { | ||
11 | if (indirectCountElement) { | ||
12 | indirectCount = 1; | ||
13 | } | ||
14 | } | ||
15 | Franz.setBadge(directCount, indirectCount); | ||
16 | }; | ||
17 | |||
18 | Franz.loop(getMessages); | ||
19 | } | ||
20 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJnaXRodWIvd2Vidmlldy5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= \ No newline at end of file | ||