From ea9f52797889740c465f1bcaef1283642cc2ef27 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Sun, 12 Sep 2021 08:36:16 +0530 Subject: New recipe: 'dingtalk' (fixes #416) (#686) --- recipes/dingtalk/icon.svg | 6 ++++++ recipes/dingtalk/index.js | 1 + recipes/dingtalk/package.json | 11 +++++++++++ recipes/dingtalk/style.css | 9 +++++++++ recipes/dingtalk/webview.js | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+) create mode 100644 recipes/dingtalk/icon.svg create mode 100644 recipes/dingtalk/index.js create mode 100644 recipes/dingtalk/package.json create mode 100644 recipes/dingtalk/style.css create mode 100644 recipes/dingtalk/webview.js (limited to 'recipes') 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 @@ + + + + + + \ 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 @@ +{ + "id": "dingtalk", + "name": "Dingtalk", + "version": "1.0.24", + "license": "MIT", + "config": { + "serviceURL": "https://im.dingtalk.com/", + "hasNotificationSound": true, + "disablewebsecurity": true + } +} 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 @@ +#layout-container { + justify-content: unset +} + +#layout-container #layout-main { + width: 100%; + flex: 0 1 1500px; +} + 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 @@ +const _path = _interopRequireDefault(require('path')); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = (Ferdi) => { + let checkIsRun = false; + checkHeightAction = () => { + checkIsRun = true; + let checkHeight = setInterval(() => { + let menuPanel = document.getElementById('menu-pannel') + if (!menuPanel) { + return + } + menuPanel.parentElement.setAttribute('style', 'height:' + (window.outerHeight - 60) + 'px'); + clearInterval(checkHeight); + checkIsRun = false + }, 1000) + } + + checkHeightAction(); + + window.addEventListener('resize', () => { + if (!checkIsRun) { + checkHeightAction(); + } + }); + + const getMessages = function getMessages() { + const x = document.querySelectorAll('.unread-num em.ng-binding') + Ferdi.setBadge(x.length > 0 ? x[0].innerHTML : 0); + }; + + Ferdi.loop(getMessages); + + Ferdi.injectCSS(_path.default.join(__dirname, 'style.css')); +}; -- cgit v1.2.3-54-g00ecf