diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/teamleader/package.json | 2 | ||||
-rw-r--r-- | recipes/teamleader/service.css | 5 | ||||
-rw-r--r-- | recipes/teamleader/webview.js | 26 |
3 files changed, 28 insertions, 5 deletions
diff --git a/recipes/teamleader/package.json b/recipes/teamleader/package.json index 83a8521..60f917a 100644 --- a/recipes/teamleader/package.json +++ b/recipes/teamleader/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "teamleader", | 2 | "id": "teamleader", |
3 | "name": "teamleader", | 3 | "name": "teamleader", |
4 | "version": "1.1.1", | 4 | "version": "1.1.2", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://app.teamleader.eu/?gotologin", | 7 | "serviceURL": "https://app.teamleader.eu/?gotologin", |
diff --git a/recipes/teamleader/service.css b/recipes/teamleader/service.css new file mode 100644 index 0000000..2d8c1a6 --- /dev/null +++ b/recipes/teamleader/service.css | |||
@@ -0,0 +1,5 @@ | |||
1 | .app-wrapper-web .app { | ||
2 | width: 100% !important; | ||
3 | height: 100% !important; | ||
4 | top: 0 !important; | ||
5 | } | ||
diff --git a/recipes/teamleader/webview.js b/recipes/teamleader/webview.js index 7eff414..d341016 100644 --- a/recipes/teamleader/webview.js +++ b/recipes/teamleader/webview.js | |||
@@ -3,11 +3,29 @@ const _path = _interopRequireDefault(require('path')); | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
4 | 4 | ||
5 | module.exports = (Ferdi) => { | 5 | module.exports = (Ferdi) => { |
6 | const getMessages = () => { | 6 | const getMessages = function getMessages() { |
7 | Ferdi.setBadge(document.getElementById('notifications_amount').innerHTML); | 7 | let notifications = 0; |
8 | let indirectNotifications = 0; | ||
9 | |||
10 | const notification_element = document.getElementById('notifications_amount'); | ||
11 | const ticket_element = document.querySelector("a[href='tickets.php'] > span"); | ||
12 | const call_element = document.getElementById('queue_amount'); | ||
13 | |||
14 | if (notification_element) { | ||
15 | notifications = Ferdi.safeParseInt(notification_element.getAttribute("datacount")); | ||
16 | } | ||
17 | |||
18 | if (ticket_element != null) { | ||
19 | indirectNotifications = Ferdi.safeParseInt(ticket_element.innerHTML); | ||
20 | } | ||
21 | |||
22 | if (call_element) { | ||
23 | indirectNotifications += Ferdi.safeParseInt(call_element.getAttribute("datacount")); | ||
24 | } | ||
25 | |||
26 | Ferdi.setBadge(notifications, indirectNotifications); | ||
8 | }; | 27 | }; |
9 | 28 | ||
10 | Ferdi.loop(getMessages); | 29 | Ferdi.loop(getMessages); |
11 | 30 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | |
12 | Ferdi.injectCSS(_path.default.join(__dirname, 'css', 'franz.css')); | ||
13 | }; | 31 | }; |