diff options
-rw-r--r-- | all.json | 9 | ||||
-rw-r--r-- | recipes/whereby/icon.svg | 18 | ||||
-rw-r--r-- | recipes/whereby/index.js | 1 | ||||
-rw-r--r-- | recipes/whereby/package.json | 12 | ||||
-rw-r--r-- | recipes/whereby/service.css | 5 | ||||
-rw-r--r-- | recipes/whereby/webview.js | 25 |
6 files changed, 70 insertions, 0 deletions
@@ -1582,6 +1582,15 @@ | |||
1582 | }, | 1582 | }, |
1583 | { | 1583 | { |
1584 | "featured": false, | 1584 | "featured": false, |
1585 | "id": "whereby", | ||
1586 | "name": "whereby.com", | ||
1587 | "version": "1.0.0", | ||
1588 | "icons": { | ||
1589 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/whereby/icon.svg" | ||
1590 | } | ||
1591 | }, | ||
1592 | { | ||
1593 | "featured": false, | ||
1585 | "id": "wire", | 1594 | "id": "wire", |
1586 | "name": "Wire", | 1595 | "name": "Wire", |
1587 | "version": "1.0.3", | 1596 | "version": "1.0.3", |
diff --git a/recipes/whereby/icon.svg b/recipes/whereby/icon.svg new file mode 100644 index 0000000..02c850b --- /dev/null +++ b/recipes/whereby/icon.svg | |||
@@ -0,0 +1,18 @@ | |||
1 | <?xml version="1.0" standalone="no"?> | ||
2 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" | ||
3 | "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> | ||
4 | <svg version="1.0" xmlns="http://www.w3.org/2000/svg" | ||
5 | width="64.000000pt" height="64.000000pt" viewBox="0 0 64.000000 64.000000" | ||
6 | preserveAspectRatio="xMidYMid meet"> | ||
7 | |||
8 | <g transform="translate(0.000000,64.000000) scale(0.100000,-0.100000)" | ||
9 | fill="#000000" stroke="none"> | ||
10 | <path d="M434 480 c-12 -4 -33 -23 -46 -40 l-26 -33 -12 37 c-8 26 -16 36 -27 | ||
11 | 32 -8 -3 -59 -6 -113 -6 l-99 0 19 -32 c10 -18 42 -89 70 -158 28 -69 55 -129 | ||
12 | 59 -133 4 -4 23 31 41 78 22 56 36 81 41 73 5 -7 21 -46 36 -85 15 -40 30 -73 | ||
13 | 33 -73 3 0 27 55 53 123 54 137 59 187 25 211 -25 18 -25 18 -54 6z m-172 -31 | ||
14 | c11 -6 31 -35 44 -65 l24 -53 -21 -48 -21 -48 -39 99 c-31 76 -37 101 -28 112 | ||
15 | 14 17 15 17 41 3z m199 -40 c24 -24 22 -66 -7 -135 l-16 -39 -33 80 c-18 44 | ||
16 | -31 83 -28 88 5 8 41 25 56 26 4 1 16 -8 28 -20z"/> | ||
17 | </g> | ||
18 | </svg> | ||
diff --git a/recipes/whereby/index.js b/recipes/whereby/index.js new file mode 100644 index 0000000..23607bd --- /dev/null +++ b/recipes/whereby/index.js | |||
@@ -0,0 +1 @@ | |||
module.exports = Ferdi => Ferdi; | |||
diff --git a/recipes/whereby/package.json b/recipes/whereby/package.json new file mode 100644 index 0000000..5ca5c17 --- /dev/null +++ b/recipes/whereby/package.json | |||
@@ -0,0 +1,12 @@ | |||
1 | { | ||
2 | "id": "whereby", | ||
3 | "name": "whereby.com", | ||
4 | "version": "1.0.0", | ||
5 | "license": "MIT", | ||
6 | "config": { | ||
7 | "serviceURL": "https://whereby.com/{teamId}", | ||
8 | "hasNotificationSound": true, | ||
9 | "hasTeamId": true, | ||
10 | "urlInputPrefix": "https://whereby.com/" | ||
11 | } | ||
12 | } | ||
diff --git a/recipes/whereby/service.css b/recipes/whereby/service.css new file mode 100644 index 0000000..b453fd4 --- /dev/null +++ b/recipes/whereby/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/whereby/webview.js b/recipes/whereby/webview.js new file mode 100644 index 0000000..0e5529e --- /dev/null +++ b/recipes/whereby/webview.js | |||
@@ -0,0 +1,25 @@ | |||
1 | var _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
4 | |||
5 | module.exports = Ferdi => { | ||
6 | const getMessages = function getMessages() { | ||
7 | const elements = document.querySelectorAll('.CxUIE, .unread'); | ||
8 | let count = 0; | ||
9 | |||
10 | for (let i = 0; i < elements.length; i += 1) { | ||
11 | if (elements[i].querySelectorAll('*[data-icon="muted"]').length === 0) { | ||
12 | count += 1; | ||
13 | } | ||
14 | } | ||
15 | |||
16 | // set Ferdi badge | ||
17 | Ferdi.setBadge(count); | ||
18 | }; | ||
19 | |||
20 | // check for new messages every second and update Ferdi badge | ||
21 | Ferdi.loop(getMessages); | ||
22 | |||
23 | // inject Ferdi.css stylesheet | ||
24 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
25 | }; | ||