diff options
author | Flying--Dutchman <github@dutches.de> | 2022-05-12 21:28:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 19:28:38 +0000 |
commit | dd58de1e4c211f6b8601d99160bdca39cbee9993 (patch) | |
tree | 6914226698dc5e1e8be4ac9158c49ee96fa14949 /recipes/gitea/webview.js | |
parent | docs: add beerpiss as a contributor for code (#25) [skip ci] (diff) | |
download | ferdium-recipes-dd58de1e4c211f6b8601d99160bdca39cbee9993.tar.gz ferdium-recipes-dd58de1e4c211f6b8601d99160bdca39cbee9993.tar.zst ferdium-recipes-dd58de1e4c211f6b8601d99160bdca39cbee9993.zip |
Add Gitea recipe (#27)
Diffstat (limited to 'recipes/gitea/webview.js')
-rwxr-xr-x | recipes/gitea/webview.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/recipes/gitea/webview.js b/recipes/gitea/webview.js new file mode 100755 index 0000000..3deaedf --- /dev/null +++ b/recipes/gitea/webview.js | |||
@@ -0,0 +1,13 @@ | |||
1 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | ||
3 | const directCountElement = document.querySelector('.notification_count',); | ||
4 | let directCount = 0; | ||
5 | if (directCountElement) { | ||
6 | directCount = Ferdium.safeParseInt(directCountElement.textContent); | ||
7 | } | ||
8 | |||
9 | Ferdium.setBadge(directCount, 0); | ||
10 | }; | ||
11 | |||
12 | Ferdium.loop(getMessages); | ||
13 | }; | ||