diff options
-rw-r--r-- | all.json | 9 | ||||
-rw-r--r-- | docs/configuration.md | 2 | ||||
-rw-r--r-- | recipes/dingtalk/icon.svg | 6 | ||||
-rw-r--r-- | recipes/dingtalk/index.js | 1 | ||||
-rw-r--r-- | recipes/dingtalk/package.json | 11 | ||||
-rw-r--r-- | recipes/dingtalk/style.css | 9 | ||||
-rw-r--r-- | recipes/dingtalk/webview.js | 36 |
7 files changed, 73 insertions, 1 deletions
@@ -249,6 +249,15 @@ | |||
249 | } | 249 | } |
250 | }, | 250 | }, |
251 | { | 251 | { |
252 | "featured": false, | ||
253 | "id": "dingtalk", | ||
254 | "name": "Dingtalk", | ||
255 | "version": "1.0.24", | ||
256 | "icons": { | ||
257 | "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/recipes/dingtalk/icon.svg" | ||
258 | } | ||
259 | }, | ||
260 | { | ||
252 | "featured": true, | 261 | "featured": true, |
253 | "id": "discord", | 262 | "id": "discord", |
254 | "name": "Discord", | 263 | "name": "Discord", |
diff --git a/docs/configuration.md b/docs/configuration.md index fa5d4d9..ee44081 100644 --- a/docs/configuration.md +++ b/docs/configuration.md | |||
@@ -76,7 +76,7 @@ Some services have direct 1x1 messages e.g. a mention or message to every user i | |||
76 | Services like Slack or HipChat have direct messages e.g. a mention or message to every user in a channel (@channel) and indirect messages e.g. general discussion in a channel. If this flag is set to `true`, the user can enable/disable if there should be a badge for indirect messages. | 76 | Services like Slack or HipChat have direct messages e.g. a mention or message to every user in a channel (@channel) and indirect messages e.g. general discussion in a channel. If this flag is set to `true`, the user can enable/disable if there should be a badge for indirect messages. |
77 | * `string` **message**<br /> | 77 | * `string` **message**<br /> |
78 | Info message that will be displayed in the add/edit service preferences screen. | 78 | Info message that will be displayed in the add/edit service preferences screen. |
79 | * `string` **disablewebsecurity**<br /> | 79 | * `boolean` **disablewebsecurity** _default: false_<br /> |
80 | Some services like hangoutschat need the web security disabled. | 80 | Some services like hangoutschat need the web security disabled. |
81 | 81 | ||
82 | ## Example | 82 | ## Example |
diff --git a/recipes/dingtalk/icon.svg b/recipes/dingtalk/icon.svg new file mode 100644 index 0000000..b71eedb --- /dev/null +++ b/recipes/dingtalk/icon.svg | |||
@@ -0,0 +1,6 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <svg version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xmlns="http://www.w3.org/2000/svg"> | ||
3 | <g> | ||
4 | <path d="M256,0C114.6,0,0,114.6,0,256c0,141.4,114.6,256,256,256c141.4,0,256-114.6,256-256C512,114.6,397.4,0,256,0z M385.7,220.2 c-0.6,2.4-2,5.9-4,10.2h0.1l-0.2,0.4c-11.6,24.6-41.8,73-41.8,73s-0.1-0.1-0.2-0.3l-8.9,15.3h42.6l-81.3,107.5l18.5-73.1H277 l11.7-48.4c-9.4,2.2-20.5,5.4-33.7,9.6c0,0-17.8,10.4-51.4-20c0,0-22.6-19.8-9.5-24.8c5.6-2.1,27.1-4.8,44-7 c22.9-3.1,36.9-4.7,36.9-4.7s-70.5,1-87.2-1.5c-16.7-2.6-37.9-30.3-42.5-54.7c0,0-7-13.4,15-7c22,6.3,113.1,24.7,113.1,24.7 S155,183,147.1,174.2c-7.9-8.8-23.2-48.1-21.2-72.3c0,0,0.9-6,7.1-4.4c0,0,87.6,39.8,147.5,61.7 C340.3,180.9,392.4,191.9,385.7,220.2z" style="fill: rgb(66, 132, 238);"/> | ||
5 | </g> | ||
6 | </svg> \ No newline at end of file | ||
diff --git a/recipes/dingtalk/index.js b/recipes/dingtalk/index.js new file mode 100644 index 0000000..23607bd --- /dev/null +++ b/recipes/dingtalk/index.js | |||
@@ -0,0 +1 @@ | |||
module.exports = Ferdi => Ferdi; | |||
diff --git a/recipes/dingtalk/package.json b/recipes/dingtalk/package.json new file mode 100644 index 0000000..2cf0474 --- /dev/null +++ b/recipes/dingtalk/package.json | |||
@@ -0,0 +1,11 @@ | |||
1 | { | ||
2 | "id": "dingtalk", | ||
3 | "name": "Dingtalk", | ||
4 | "version": "1.0.24", | ||
5 | "license": "MIT", | ||
6 | "config": { | ||
7 | "serviceURL": "https://im.dingtalk.com/", | ||
8 | "hasNotificationSound": true, | ||
9 | "disablewebsecurity": true | ||
10 | } | ||
11 | } | ||
diff --git a/recipes/dingtalk/style.css b/recipes/dingtalk/style.css new file mode 100644 index 0000000..230ac01 --- /dev/null +++ b/recipes/dingtalk/style.css | |||
@@ -0,0 +1,9 @@ | |||
1 | #layout-container { | ||
2 | justify-content: unset | ||
3 | } | ||
4 | |||
5 | #layout-container #layout-main { | ||
6 | width: 100%; | ||
7 | flex: 0 1 1500px; | ||
8 | } | ||
9 | |||
diff --git a/recipes/dingtalk/webview.js b/recipes/dingtalk/webview.js new file mode 100644 index 0000000..68de1b6 --- /dev/null +++ b/recipes/dingtalk/webview.js | |||
@@ -0,0 +1,36 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
4 | |||
5 | module.exports = (Ferdi) => { | ||
6 | let checkIsRun = false; | ||
7 | checkHeightAction = () => { | ||
8 | checkIsRun = true; | ||
9 | let checkHeight = setInterval(() => { | ||
10 | let menuPanel = document.getElementById('menu-pannel') | ||
11 | if (!menuPanel) { | ||
12 | return | ||
13 | } | ||
14 | menuPanel.parentElement.setAttribute('style', 'height:' + (window.outerHeight - 60) + 'px'); | ||
15 | clearInterval(checkHeight); | ||
16 | checkIsRun = false | ||
17 | }, 1000) | ||
18 | } | ||
19 | |||
20 | checkHeightAction(); | ||
21 | |||
22 | window.addEventListener('resize', () => { | ||
23 | if (!checkIsRun) { | ||
24 | checkHeightAction(); | ||
25 | } | ||
26 | }); | ||
27 | |||
28 | const getMessages = function getMessages() { | ||
29 | const x = document.querySelectorAll('.unread-num em.ng-binding') | ||
30 | Ferdi.setBadge(x.length > 0 ? x[0].innerHTML : 0); | ||
31 | }; | ||
32 | |||
33 | Ferdi.loop(getMessages); | ||
34 | |||
35 | Ferdi.injectCSS(_path.default.join(__dirname, 'style.css')); | ||
36 | }; | ||