From 12f4f7ab7487b30c31f43dbc3009fb5b8769efdc Mon Sep 17 00:00:00 2001 From: Shao Yang Hong Date: Wed, 7 Oct 2020 22:24:06 +0800 Subject: Add recipe for Lark (#315) --- recipes/lark/README.md | 5 +++++ recipes/lark/darkmode.css | 0 recipes/lark/icon.png | Bin 0 -> 173486 bytes recipes/lark/icon.svg | 1 + recipes/lark/index.js | 1 + recipes/lark/package.json | 15 +++++++++++++++ recipes/lark/service.css | 7 +++++++ recipes/lark/webview.js | 18 ++++++++++++++++++ 8 files changed, 47 insertions(+) create mode 100644 recipes/lark/README.md create mode 100644 recipes/lark/darkmode.css create mode 100644 recipes/lark/icon.png create mode 100644 recipes/lark/icon.svg create mode 100644 recipes/lark/index.js create mode 100644 recipes/lark/package.json create mode 100644 recipes/lark/service.css create mode 100644 recipes/lark/webview.js (limited to 'recipes') diff --git a/recipes/lark/README.md b/recipes/lark/README.md new file mode 100644 index 0000000..9618a9e --- /dev/null +++ b/recipes/lark/README.md @@ -0,0 +1,5 @@ +# Lark for Franz +A Franz recipe for Lark + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/recipes/lark/darkmode.css b/recipes/lark/darkmode.css new file mode 100644 index 0000000..e69de29 diff --git a/recipes/lark/icon.png b/recipes/lark/icon.png new file mode 100644 index 0000000..7a81805 Binary files /dev/null and b/recipes/lark/icon.png differ diff --git a/recipes/lark/icon.svg b/recipes/lark/icon.svg new file mode 100644 index 0000000..9f7ce09 --- /dev/null +++ b/recipes/lark/icon.svg @@ -0,0 +1 @@ +larklogo \ No newline at end of file diff --git a/recipes/lark/index.js b/recipes/lark/index.js new file mode 100644 index 0000000..258da41 --- /dev/null +++ b/recipes/lark/index.js @@ -0,0 +1 @@ +module.exports = Franz => Franz; diff --git a/recipes/lark/package.json b/recipes/lark/package.json new file mode 100644 index 0000000..35c3203 --- /dev/null +++ b/recipes/lark/package.json @@ -0,0 +1,15 @@ +{ + "id": "lark", + "name": "Lark", + "version": "0.0.1", + "description": "Lark", + "main": "index.js", + "author": "hongsy ", + "license": "MIT", + "config": { + "serviceURL": "https://{teamId}.larksuite.com/messenger/", + "hasTeamId": true, + "urlInputSuffix": ".larksuite.com", + "hasNotificationSound": true + } +} diff --git a/recipes/lark/service.css b/recipes/lark/service.css new file mode 100644 index 0000000..eb94cde --- /dev/null +++ b/recipes/lark/service.css @@ -0,0 +1,7 @@ +.lark-chat-left { + background: white; +} + +.left.electron-draggable { + background: white; +} \ No newline at end of file diff --git a/recipes/lark/webview.js b/recipes/lark/webview.js new file mode 100644 index 0000000..a3b052d --- /dev/null +++ b/recipes/lark/webview.js @@ -0,0 +1,18 @@ +const path = require('path'); + + +module.exports = (Franz) => { + const getMessages = function getMessages() { + + const ele = document.querySelectorAll('.larkc-badge-count.navbarMenu-badge'); + if (!ele.length) { + Franz.setBadge(0); + return; + } + const messages = parseInt(ele[0].innerHTML, 10); + Franz.setBadge(messages); + }; + + Franz.injectCSS(path.join(__dirname, 'service.css')); + Franz.loop(getMessages); +}; -- cgit v1.2.3-54-g00ecf