diff options
Diffstat (limited to 'recipes/kimaicloud')
-rw-r--r-- | recipes/kimaicloud/package.json | 2 | ||||
-rw-r--r-- | recipes/kimaicloud/webview.js | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/recipes/kimaicloud/package.json b/recipes/kimaicloud/package.json index 76319f2..d37135d 100644 --- a/recipes/kimaicloud/package.json +++ b/recipes/kimaicloud/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "kimaicloud", | 2 | "id": "kimaicloud", |
3 | "name": "Kimai Cloud", | 3 | "name": "Kimai Cloud", |
4 | "version": "1.4.0", | 4 | "version": "1.5.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/kimai-cloud/recipe-kimaicloud", | 6 | "repository": "https://github.com/kimai-cloud/recipe-kimaicloud", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/kimaicloud/webview.js b/recipes/kimaicloud/webview.js index 2855aa2..90ff710 100644 --- a/recipes/kimaicloud/webview.js +++ b/recipes/kimaicloud/webview.js | |||
@@ -1,9 +1,17 @@ | |||
1 | module.exports = (Ferdium) => { | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | let count = 0; | 9 | let count = 0; |
4 | 10 | ||
5 | // get amount of running timesheets | 11 | // get amount of running timesheets |
6 | const label = document.querySelector('.main-header .navbar .dropdown.messages-menu .ticktac span.label'); | 12 | const label = document.querySelector( |
13 | '.main-header .navbar .dropdown.messages-menu .ticktac span.label', | ||
14 | ); | ||
7 | if (label !== undefined) { | 15 | if (label !== undefined) { |
8 | count = Ferdium.safeParseInt(label.textContent); | 16 | count = Ferdium.safeParseInt(label.textContent); |
9 | } | 17 | } |
@@ -12,7 +20,7 @@ module.exports = (Ferdium) => { | |||
12 | Ferdium.setBadge(count); | 20 | Ferdium.setBadge(count); |
13 | }; | 21 | }; |
14 | 22 | ||
15 | document.addEventListener('click', (e) => { | 23 | document.addEventListener('click', e => { |
16 | const { tagName, target, href } = e.target; | 24 | const { tagName, target, href } = e.target; |
17 | 25 | ||
18 | if (tagName === 'A' && target === '_blank') { | 26 | if (tagName === 'A' && target === '_blank') { |
@@ -23,4 +31,6 @@ module.exports = (Ferdium) => { | |||
23 | }); | 31 | }); |
24 | 32 | ||
25 | Ferdium.loop(getMessages); | 33 | Ferdium.loop(getMessages); |
34 | |||
35 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
26 | }; | 36 | }; |