aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/dingtalk
diff options
context:
space:
mode:
authorLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-09-12 08:36:16 +0530
committerLibravatar GitHub <noreply@github.com>2021-09-12 03:06:16 +0000
commitea9f52797889740c465f1bcaef1283642cc2ef27 (patch)
treebcb07685c8dfa8c8b683b05ae22031b0cb16e217 /recipes/dingtalk
parentNew recipe: 'yandex-mail' (fixes #421) (#685) (diff)
downloadferdium-recipes-ea9f52797889740c465f1bcaef1283642cc2ef27.tar.gz
ferdium-recipes-ea9f52797889740c465f1bcaef1283642cc2ef27.tar.zst
ferdium-recipes-ea9f52797889740c465f1bcaef1283642cc2ef27.zip
New recipe: 'dingtalk' (fixes #416) (#686)
Diffstat (limited to 'recipes/dingtalk')
-rw-r--r--recipes/dingtalk/icon.svg6
-rw-r--r--recipes/dingtalk/index.js1
-rw-r--r--recipes/dingtalk/package.json11
-rw-r--r--recipes/dingtalk/style.css9
-rw-r--r--recipes/dingtalk/webview.js36
5 files changed, 63 insertions, 0 deletions
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 @@
1const _path = _interopRequireDefault(require('path'));
2
3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4
5module.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};