diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/hipchat/icon.svg | 1 | ||||
-rw-r--r-- | recipes/hipchat/index.js | 57 | ||||
-rw-r--r-- | recipes/hipchat/package.json | 14 | ||||
-rw-r--r-- | recipes/hipchat/webview.js | 21 |
4 files changed, 0 insertions, 93 deletions
diff --git a/recipes/hipchat/icon.svg b/recipes/hipchat/icon.svg deleted file mode 100644 index 4ccc019..0000000 --- a/recipes/hipchat/icon.svg +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | <svg height="80" width="80" xmlns="http://www.w3.org/2000/svg"><mask id="a" fill="#fff"><path d="M0 1.58h79.272v74.112H0" fill-rule="evenodd"/></mask><g fill="#2d497d" fill-rule="evenodd"><path d="M61.283 44.442c0-.83-.675-1.577-1.577-1.577-.366 0-.741.123-1.047.4-3.993 3.59-10.79 6.766-19.008 6.788h-.032c-8.203-.022-14.804-3.324-19.008-6.787-.265-.218-.757-.37-1.075-.37-.978 0-1.546.833-1.549 1.748 0 .703.495 1.296.902 1.905 2.356 3.538 9.663 9.55 20.66 9.55h.174c10.995 0 18.305-6.012 20.658-9.55.407-.609.902-1.4.902-2.107"/><path d="M72.217 71.027c-2.8-1.596-5.456-4.293-6.673-7.992-.24-.726-.029-1.31.53-1.741 8.102-6.267 13.199-15.366 13.199-25.5C79.273 16.9 61.526 1.58 39.638 1.58 17.748 1.579.001 16.9.001 35.795c0 18.907 17.746 34.229 39.637 34.229 2.86 0 5.649-.262 8.336-.76a2.26 2.26 0 0 1 1.637.302c5.424 3.33 13.501 6.125 20.585 6.125 2.283 0 3.16-1.448 3.16-2.766 0-.851-.46-1.51-1.139-1.898m-10.606-3.328c.123.167.19.31.19.46 0 .23-.218.389-.493.389-1.987 0-8.105-3.3-11.322-6.018-.445-.372-1.06-.508-1.937-.318a39.403 39.403 0 0 1-8.414.902c-18.22 0-32.99-12.203-32.99-27.262 0-15.05 14.77-27.25 32.99-27.25s32.992 12.2 32.992 27.25c0 8.985-5.26 16.952-13.375 21.919-.543.331-1.117.956-1.117 1.738 0 1.602 1.502 5.576 3.476 8.19" mask="url(#a)" transform="translate(0 1)"/></g></svg> \ No newline at end of file | ||
diff --git a/recipes/hipchat/index.js b/recipes/hipchat/index.js deleted file mode 100644 index e786bcb..0000000 --- a/recipes/hipchat/index.js +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | function _asyncToGenerator(fn) { | ||
2 | return function () { | ||
3 | const gen = Reflect.apply(fn, this, arguments); | ||
4 | return new Promise((resolve, reject) => { | ||
5 | function step(key, arg) { | ||
6 | try { | ||
7 | var info = gen[key](arg); | ||
8 | var value = info.value; | ||
9 | } catch (error) { | ||
10 | reject(error); | ||
11 | return; | ||
12 | } | ||
13 | if (info.done) { | ||
14 | resolve(value); | ||
15 | } else { | ||
16 | // eslint-disable-next-line consistent-return | ||
17 | return Promise.resolve(value).then( | ||
18 | value => { | ||
19 | step('next', value); | ||
20 | }, | ||
21 | error => { | ||
22 | step('throw', error); | ||
23 | }, | ||
24 | ); | ||
25 | } | ||
26 | } | ||
27 | return step('next'); | ||
28 | }); | ||
29 | }; | ||
30 | } | ||
31 | |||
32 | module.exports = Ferdium => | ||
33 | class HipChat extends Ferdium { | ||
34 | validateUrl(url) { | ||
35 | return _asyncToGenerator(function* () { | ||
36 | try { | ||
37 | const resp = yield window.fetch(`${url}/api/features`, { | ||
38 | method: 'GET', | ||
39 | headers: { | ||
40 | 'Content-Type': 'application/json', | ||
41 | }, | ||
42 | }); | ||
43 | const data = yield resp.json(); | ||
44 | |||
45 | return Object.hasOwnProperty.call(data, 'features'); | ||
46 | } catch (error) { | ||
47 | console.error(error); | ||
48 | } | ||
49 | |||
50 | return false; | ||
51 | })(); | ||
52 | } | ||
53 | |||
54 | buildUrl(url) { | ||
55 | return `${url}/chat`; | ||
56 | } | ||
57 | }; | ||
diff --git a/recipes/hipchat/package.json b/recipes/hipchat/package.json deleted file mode 100644 index 0f9f3f0..0000000 --- a/recipes/hipchat/package.json +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | { | ||
2 | "id": "hipchat", | ||
3 | "name": "HipChat", | ||
4 | "version": "1.3.0", | ||
5 | "license": "MIT", | ||
6 | "config": { | ||
7 | "serviceURL": "https://{teamId}.hipchat.com/chat", | ||
8 | "hasNotificationSound": true, | ||
9 | "hasIndirectMessages": true, | ||
10 | "hasTeamId": true, | ||
11 | "hasCustomUrl": true, | ||
12 | "urlInputSuffix": ".hipchat.com" | ||
13 | } | ||
14 | } | ||
diff --git a/recipes/hipchat/webview.js b/recipes/hipchat/webview.js deleted file mode 100644 index 6871fbb..0000000 --- a/recipes/hipchat/webview.js +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
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 => { | ||
8 | const getMessages = () => { | ||
9 | const directMessages = document.querySelectorAll('.hc-mention').length; | ||
10 | const allMessages = | ||
11 | document.querySelectorAll('.aui-badge:not(.hc-mention)').length - | ||
12 | directMessages; | ||
13 | |||
14 | // set Ferdium badge | ||
15 | Ferdium.setBadge(directMessages, allMessages); | ||
16 | }; | ||
17 | |||
18 | Ferdium.loop(getMessages); | ||
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
21 | }; | ||