aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/kimaicloud/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-09-12 22:01:51 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-09-12 22:06:03 +0530
commit9db43e100a672b6d6932ac68c0fbe503c129138b (patch)
tree4f6a31d25a7345c5d92dbd8b80d30ce7d129944f /recipes/kimaicloud/webview.js
parentNew recipe: 'stackoverflow' (#707) (diff)
downloadferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.tar.gz
ferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.tar.zst
ferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.zip
Added a check to verify that the folder name of the recipe matches the recipe id (#708)
Use the recipe-id as master to rename internal folder names
Diffstat (limited to 'recipes/kimaicloud/webview.js')
-rw-r--r--recipes/kimaicloud/webview.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/recipes/kimaicloud/webview.js b/recipes/kimaicloud/webview.js
new file mode 100644
index 0000000..f4e2e9f
--- /dev/null
+++ b/recipes/kimaicloud/webview.js
@@ -0,0 +1,26 @@
1module.exports = (Ferdi) => {
2 const getMessages = function getMessages() {
3 let count = 0;
4
5 // get amount of running timesheets
6 const label = document.querySelector('.main-header .navbar .dropdown.messages-menu .ticktac span.label');
7 if (label !== undefined) {
8 count = label.textContent;
9 }
10
11 // set Ferdi badge
12 Ferdi.setBadge(count);
13 };
14
15 document.addEventListener('click', (e) => {
16 const { tagName, target, href } = e.target;
17
18 if (tagName === 'A' && target === '_blank') {
19 e.preventDefault();
20 e.stopImmediatePropagation();
21 window.open(href);
22 }
23 });
24
25 Ferdi.loop(getMessages);
26};