aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/teamleader
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-10-05 17:04:09 +0200
committerLibravatar GitHub <noreply@github.com>2021-10-05 17:04:09 +0200
commitd3841b766f9d37d557646003899f67525c5f755f (patch)
tree1bcab990c94f2b05678b7a83ffebe08298500f0b /recipes/teamleader
parentchore: repo maintenance (#732) (diff)
downloadferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.gz
ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.tar.zst
ferdium-recipes-d3841b766f9d37d557646003899f67525c5f755f.zip
chore: add eslint-plugin-unicorn (#733)
Diffstat (limited to 'recipes/teamleader')
-rw-r--r--recipes/teamleader/webview.js26
1 files changed, 18 insertions, 8 deletions
diff --git a/recipes/teamleader/webview.js b/recipes/teamleader/webview.js
index 241d787..f846f55 100644
--- a/recipes/teamleader/webview.js
+++ b/recipes/teamleader/webview.js
@@ -1,26 +1,36 @@
1const _path = _interopRequireDefault(require('path')); 1const _path = _interopRequireDefault(require('path'));
2 2
3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3function _interopRequireDefault(obj) {
4 return obj && obj.__esModule ? obj : { default: obj };
5}
4 6
5module.exports = (Ferdi) => { 7module.exports = Ferdi => {
6 const getMessages = () => { 8 const getMessages = () => {
7 let notifications = 0; 9 let notifications = 0;
8 let indirectNotifications = 0; 10 let indirectNotifications = 0;
9 11
10 const notification_element = document.getElementById('notifications_amount'); 12 const notification_element = document.querySelector(
11 const ticket_element = document.querySelector("a[href='tickets.php'] > span"); 13 '#notifications_amount',
12 const call_element = document.getElementById('queue_amount'); 14 );
15 const ticket_element = document.querySelector(
16 "a[href='tickets.php'] > span",
17 );
18 const call_element = document.querySelector('#queue_amount');
13 19
14 if (notification_element) { 20 if (notification_element) {
15 notifications = Ferdi.safeParseInt(notification_element.getAttribute("datacount")); 21 notifications = Ferdi.safeParseInt(
22 notification_element.getAttribute('datacount'),
23 );
16 } 24 }
17 25
18 if (ticket_element != null) { 26 if (ticket_element != null) {
19 indirectNotifications = Ferdi.safeParseInt(ticket_element.innerHTML); 27 indirectNotifications = Ferdi.safeParseInt(ticket_element.textContent);
20 } 28 }
21 29
22 if (call_element) { 30 if (call_element) {
23 indirectNotifications += Ferdi.safeParseInt(call_element.getAttribute("datacount")); 31 indirectNotifications += Ferdi.safeParseInt(
32 call_element.getAttribute('datacount'),
33 );
24 } 34 }
25 35
26 Ferdi.setBadge(notifications, indirectNotifications); 36 Ferdi.setBadge(notifications, indirectNotifications);