From 6f5e4a00588aefdda7a5a1cfe70935870e7e234a Mon Sep 17 00:00:00 2001 From: Bennett Date: Tue, 22 Sep 2020 20:56:48 +0200 Subject: Unpack recipes and update recipes icons (#292) Co-authored-by: Amine Mouafik --- recipes/monday/README.md | 5 +++++ recipes/monday/icon.png | Bin 0 -> 51909 bytes recipes/monday/icon.svg | 36 ++++++++++++++++++++++++++++++++++++ recipes/monday/index.js | 3 +++ recipes/monday/package.json | 14 ++++++++++++++ recipes/monday/service.css | 3 +++ recipes/monday/webview.js | 29 +++++++++++++++++++++++++++++ 7 files changed, 90 insertions(+) create mode 100644 recipes/monday/README.md create mode 100644 recipes/monday/icon.png create mode 100644 recipes/monday/icon.svg create mode 100644 recipes/monday/index.js create mode 100644 recipes/monday/package.json create mode 100644 recipes/monday/service.css create mode 100755 recipes/monday/webview.js (limited to 'recipes/monday') diff --git a/recipes/monday/README.md b/recipes/monday/README.md new file mode 100644 index 0000000..3d95301 --- /dev/null +++ b/recipes/monday/README.md @@ -0,0 +1,5 @@ +# Monday for Franz +Unofficial support for monday.com in Franz + +### How to create your own Franz recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/recipes/monday/icon.png b/recipes/monday/icon.png new file mode 100644 index 0000000..77b8980 Binary files /dev/null and b/recipes/monday/icon.png differ diff --git a/recipes/monday/icon.svg b/recipes/monday/icon.svg new file mode 100644 index 0000000..a7959f1 --- /dev/null +++ b/recipes/monday/icon.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/recipes/monday/index.js b/recipes/monday/index.js new file mode 100644 index 0000000..e8243fb --- /dev/null +++ b/recipes/monday/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = Franz => Franz; \ No newline at end of file diff --git a/recipes/monday/package.json b/recipes/monday/package.json new file mode 100644 index 0000000..79ea17d --- /dev/null +++ b/recipes/monday/package.json @@ -0,0 +1,14 @@ +{ + "id": "monday", + "name": "Monday", + "version": "1.0.1", + "description": "Monday.com", + "main": "index.js", + "author": "Wilhelm Hjelm ", + "license": "MIT", + "config": { + "serviceURL": "https://{teamId}.monday.com", + "hasTeamId": true, + "urlInputSuffix": ".monday.com" + } +} diff --git a/recipes/monday/service.css b/recipes/monday/service.css new file mode 100644 index 0000000..c4e4024 --- /dev/null +++ b/recipes/monday/service.css @@ -0,0 +1,3 @@ +#support_list { + display: none !important; +} diff --git a/recipes/monday/webview.js b/recipes/monday/webview.js new file mode 100755 index 0000000..c5a58b6 --- /dev/null +++ b/recipes/monday/webview.js @@ -0,0 +1,29 @@ +"use strict"; + +var _path = _interopRequireDefault(require("path")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = Franz => { + + const getMessages = function getMessages() { + + let count = 0; + + let counters = document.querySelectorAll('.surface-control-component .item-counter, .surface-control-component .view-item-counter'); + + for (var i = 0; i < counters.length; i++) { + count += parseInt(counters[i].textContent); + } + + if (isNaN(count)) { + count = 0; + } + + Franz.setBadge(count); + }; + + Franz.injectCSS(_path.default.join(__dirname, 'service.css')); + Franz.loop(getMessages); + +}; -- cgit v1.2.3-54-g00ecf