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/zimbra/README.md | 5 +++++ recipes/zimbra/icon.png | Bin 0 -> 169676 bytes recipes/zimbra/icon.svg | 9 +++++++++ recipes/zimbra/index.js | 7 +++++++ recipes/zimbra/package.json | 14 ++++++++++++++ recipes/zimbra/webview.js | 18 ++++++++++++++++++ 6 files changed, 53 insertions(+) create mode 100644 recipes/zimbra/README.md create mode 100644 recipes/zimbra/icon.png create mode 100644 recipes/zimbra/icon.svg create mode 100644 recipes/zimbra/index.js create mode 100644 recipes/zimbra/package.json create mode 100644 recipes/zimbra/webview.js (limited to 'recipes/zimbra') diff --git a/recipes/zimbra/README.md b/recipes/zimbra/README.md new file mode 100644 index 0000000..fb6e2c3 --- /dev/null +++ b/recipes/zimbra/README.md @@ -0,0 +1,5 @@ +# Zimbra for Ferdi +This is the official Ferdi recipe for Zimbra + +### How to create your own Ferdi recipes: +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/recipes/zimbra/icon.png b/recipes/zimbra/icon.png new file mode 100644 index 0000000..4e07ec0 Binary files /dev/null and b/recipes/zimbra/icon.png differ diff --git a/recipes/zimbra/icon.svg b/recipes/zimbra/icon.svg new file mode 100644 index 0000000..8882545 --- /dev/null +++ b/recipes/zimbra/icon.svg @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/recipes/zimbra/index.js b/recipes/zimbra/index.js new file mode 100644 index 0000000..729a4bb --- /dev/null +++ b/recipes/zimbra/index.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = Franz => class Zimbra extends Franz { + async validateUrl(url) { + return true; + } +}; \ No newline at end of file diff --git a/recipes/zimbra/package.json b/recipes/zimbra/package.json new file mode 100644 index 0000000..c3633e8 --- /dev/null +++ b/recipes/zimbra/package.json @@ -0,0 +1,14 @@ +{ + "id": "zimbra", + "name": "Zimbra", + "version": "1.0.0", + "description": "Zimbra", + "main": "index.js", + "author": "Ferdi Team ", + "license": "MIT", + "config": { + "hasNotificationSound": true, + "hasIndirectMessages": true, + "hasCustomUrl": true + } +} diff --git a/recipes/zimbra/webview.js b/recipes/zimbra/webview.js new file mode 100644 index 0000000..aaaa952 --- /dev/null +++ b/recipes/zimbra/webview.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = Franz => { + const getMessages = function getMessages() { + const { title } = document; + const regex = /\d+/; + + if (regex.test(title)) { + Franz.setBadge( + Number(regex.exec(title)[0]) + ); + } else { + Franz.setBadge(0); + } + }; + + Franz.loop(getMessages); +}; \ No newline at end of file -- cgit v1.2.3-54-g00ecf