diff options
Diffstat (limited to 'recipes/kimai-cloud')
-rw-r--r-- | recipes/kimai-cloud/icon.png | bin | 0 -> 138391 bytes | |||
-rw-r--r-- | recipes/kimai-cloud/icon.svg | 58 | ||||
-rw-r--r-- | recipes/kimai-cloud/index.js | 2 | ||||
-rw-r--r-- | recipes/kimai-cloud/package.json | 18 | ||||
-rw-r--r-- | recipes/kimai-cloud/webview.js | 27 |
5 files changed, 105 insertions, 0 deletions
diff --git a/recipes/kimai-cloud/icon.png b/recipes/kimai-cloud/icon.png new file mode 100644 index 0000000..9a5ce67 --- /dev/null +++ b/recipes/kimai-cloud/icon.png | |||
Binary files differ | |||
diff --git a/recipes/kimai-cloud/icon.svg b/recipes/kimai-cloud/icon.svg new file mode 100644 index 0000000..01f6066 --- /dev/null +++ b/recipes/kimai-cloud/icon.svg | |||
@@ -0,0 +1,58 @@ | |||
1 | <?xml version="1.0" standalone="yes"?> | ||
2 | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" | ||
3 | viewBox="0 0 440 440" width="440px" height="440px" style="zoom: 1;"> | ||
4 | <title>Kimai Time-Tracker</title> | ||
5 | <radialGradient id="background" cy="41.266644" r="160.5" | ||
6 | gradientTransform="matrix(1.1673343 0 0 1.196623 -102.24121 -19.722475)" cx="611" | ||
7 | gradientUnits="userSpaceOnUse"> | ||
8 | <stop stop-color="#00AAE9" offset="0"></stop> | ||
9 | <stop stop-color="#1E87B6" offset="1"></stop> | ||
10 | </radialGradient> | ||
11 | <radialGradient id="startButton" cy="-16.37981" r="55.747124" | ||
12 | gradientTransform="matrix(1.9295131 -1.1140049 1.1550268 2.0005649 -1087.6858 1104.8947)" | ||
13 | cx="873.78265" gradientUnits="userSpaceOnUse"> | ||
14 | <stop stop-color="#f9f9f9" offset="0"></stop> | ||
15 | <stop stop-color="#fff" offset="1"></stop> | ||
16 | </radialGradient> | ||
17 | <linearGradient id="outerBorder" y1="234.57143" x1="611.14288" y2="-110.91601" x2="610.57141" gradientUnits="userSpaceOnUse"> | ||
18 | <stop stop-color="#f2f2f2" offset="0"></stop> | ||
19 | <stop stop-color="#f2f2f2" offset="1"></stop> | ||
20 | </linearGradient> | ||
21 | <g transform="translate(-390.56693 181.56689)"> | ||
22 | <g> | ||
23 | <circle cx="611px" r="187.776825px" fill="url(#outerBorder)" cy="38px"></circle> | ||
24 | <circle stroke="#fff" stroke-linejoin="round" stroke-width="3" cy="38px" fill="url(#background)" r="166.285645px" cx="611px"></circle> | ||
25 | <path d="M571.156433,108.308197 l110,-63.999998 l-110,-64" fill-rule="evenodd" fill="url(#startButton)"></path> | ||
26 | </g> | ||
27 | <g fill-rule="evenodd"> | ||
28 | <g fill="#76B5D5"> | ||
29 | <rect id="hourOne" x="-542.46875px" height="32" y="419.410309px" width="14" opacity="1" | ||
30 | transform="matrix(-.83616052 -.5484848 .5484848 -.83616052 0 0)" ry="7"></rect> | ||
31 | <rect id="hourTwo" x="-320.158203px" height="32" y="642.978027px" width="14" opacity="1" | ||
32 | transform="matrix(-.45720822 -.88935968 .88935968 -.45720822 0 0)" ry="7"></rect> | ||
33 | <rect id="hourThree" x="-48.536366px" height="41" y="718.754395px" width="18" opacity="1" | ||
34 | transform="rotate(-90)" ry="9"></rect> | ||
35 | <rect id="hourFour" x="244.405457px" height="32" y="673.798523px" width="14" opacity="1" | ||
36 | transform="matrix(.47159375 -.88181593 .88181593 .47159375 0 0)" ry="7"></rect> | ||
37 | <rect id="hourFive" x="-505.884949px" height="32" y="-503.867859px" width="14" opacity="1" | ||
38 | transform="matrix(-.8503618 .52619845 -.52619845 -.8503618 0 0)" ry="7"></rect> | ||
39 | <rect id="hourSix" x="-620.297424px" height="41" y="-187.942719px" width="18" opacity="1" | ||
40 | transform="scale(-1)" ry="9"></rect> | ||
41 | <rect id="hourSeven" x="-539.16571px" height="32" y="148.581909px" width="14" opacity="1" | ||
42 | transform="matrix(-.84033379 -.54206929 .54206929 -.84033379 0 0)" ry="7"></rect> | ||
43 | <rect id="hourEight" x="-319.728088px" height="32" y="374.804901px" width="14" opacity="1" | ||
44 | transform="matrix(-.45720822 -.88935968 .88935968 -.45720822 0 0)" ry="7"></rect> | ||
45 | <rect id="hourNine" x="-48.536366px" height="41" y="460.964569px" width="18" opacity="1" | ||
46 | transform="rotate(-90)" ry="9"></rect> | ||
47 | <rect id="hourTen" x="250.841736px" height="32" y="406.195648px" width="14" opacity="1" | ||
48 | transform="matrix(.47159375 -.88181593 .88181593 .47159375 0 0)" ry="7"></rect> | ||
49 | <rect id="hourEleven" x="-505.957611px" height="32" y="-236.959518px" width="14" opacity="1" | ||
50 | transform="matrix(-.849305 .52790248 -.52790248 -.849305 0 0)" ry="7"></rect> | ||
51 | <g transform="scale(-1)"> | ||
52 | <rect id="hourTwelve" x="-633.02533px" height="41" y="69.120789px" width="18" opacity="1" ry="9"></rect> | ||
53 | <rect id="hourZero" x="-606.761353px" height="41" y="69.120789px" width="18" opacity="1" ry="9"></rect> | ||
54 | </g> | ||
55 | </g> | ||
56 | </g> | ||
57 | </g> | ||
58 | </svg> | ||
diff --git a/recipes/kimai-cloud/index.js b/recipes/kimai-cloud/index.js new file mode 100644 index 0000000..46f936f --- /dev/null +++ b/recipes/kimai-cloud/index.js | |||
@@ -0,0 +1,2 @@ | |||
1 | // just pass through Franz | ||
2 | module.exports = Franz => Franz; | ||
diff --git a/recipes/kimai-cloud/package.json b/recipes/kimai-cloud/package.json new file mode 100644 index 0000000..6ad8abd --- /dev/null +++ b/recipes/kimai-cloud/package.json | |||
@@ -0,0 +1,18 @@ | |||
1 | { | ||
2 | "id": "kimaicloud", | ||
3 | "name": "Kimai Cloud", | ||
4 | "version": "1.0.0", | ||
5 | "description": "Kimai Time-Tracker - Cloud version", | ||
6 | "main": "index.js", | ||
7 | "author": "Kevin Papst <support@kimai.cloud>", | ||
8 | "license": "MIT", | ||
9 | "repository": "https://github.com/kimai-cloud/recipe-kimaicloud", | ||
10 | "config": { | ||
11 | "serviceURL": "https://{teamId}.kimai.cloud", | ||
12 | "hasNotificationSound": false, | ||
13 | "hasDirectMessages": true, | ||
14 | "hasIndirectMessages": false, | ||
15 | "hasTeamId": true, | ||
16 | "urlInputSuffix": ".kimai.cloud" | ||
17 | } | ||
18 | } | ||
diff --git a/recipes/kimai-cloud/webview.js b/recipes/kimai-cloud/webview.js new file mode 100644 index 0000000..8baf008 --- /dev/null +++ b/recipes/kimai-cloud/webview.js | |||
@@ -0,0 +1,27 @@ | |||
1 | module.exports = (Franz) => { | ||
2 | const getMessages = function getMessages() { | ||
3 | let count = 0; | ||
4 | |||
5 | // get amount of running timesheets | ||
6 | let label = document.querySelector('.main-header .navbar .dropdown.messages-menu .ticktac span.label'); | ||
7 | if (label !== undefined) { | ||
8 | count = label.textContent; | ||
9 | } | ||
10 | |||
11 | // set Franz badge | ||
12 | Franz.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 | // check for new messages every second and update Franz badge | ||
26 | Franz.loop(getMessages); | ||
27 | }; | ||