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/hackmd/icon.png | Bin 0 -> 4837 bytes recipes/hackmd/icon.svg | 137 ++++++++++++++++++++++++++++++++++++++++++++ recipes/hackmd/index.js | 4 ++ recipes/hackmd/package.json | 14 +++++ recipes/hackmd/service.css | 3 + recipes/hackmd/webview.js | 17 ++++++ 6 files changed, 175 insertions(+) create mode 100644 recipes/hackmd/icon.png create mode 100644 recipes/hackmd/icon.svg create mode 100644 recipes/hackmd/index.js create mode 100644 recipes/hackmd/package.json create mode 100644 recipes/hackmd/service.css create mode 100644 recipes/hackmd/webview.js (limited to 'recipes/hackmd') diff --git a/recipes/hackmd/icon.png b/recipes/hackmd/icon.png new file mode 100644 index 0000000..eebdcf7 Binary files /dev/null and b/recipes/hackmd/icon.png differ diff --git a/recipes/hackmd/icon.svg b/recipes/hackmd/icon.svg new file mode 100644 index 0000000..7c28965 --- /dev/null +++ b/recipes/hackmd/icon.svg @@ -0,0 +1,137 @@ + + + + diff --git a/recipes/hackmd/index.js b/recipes/hackmd/index.js new file mode 100644 index 0000000..46335da --- /dev/null +++ b/recipes/hackmd/index.js @@ -0,0 +1,4 @@ +// just pass through Franz +// todo allow custom url +module.exports = Franz => class HackMd extends Franz { +}; diff --git a/recipes/hackmd/package.json b/recipes/hackmd/package.json new file mode 100644 index 0000000..517efb5 --- /dev/null +++ b/recipes/hackmd/package.json @@ -0,0 +1,14 @@ +{ + "id": "hackmd", + "name": "HackMd", + "version": "1.0.0", + "description": "HackMd", + "main": "index.js", + "author": "Armaldio ", + "license": "MIT", + "repository": "", + "config": { + "serviceURL": "https://hackmd.io", + "hasNotificationSound": true + } +} diff --git a/recipes/hackmd/service.css b/recipes/hackmd/service.css new file mode 100644 index 0000000..a16a615 --- /dev/null +++ b/recipes/hackmd/service.css @@ -0,0 +1,3 @@ +.notice { + display: none; +} diff --git a/recipes/hackmd/webview.js b/recipes/hackmd/webview.js new file mode 100644 index 0000000..1977953 --- /dev/null +++ b/recipes/hackmd/webview.js @@ -0,0 +1,17 @@ +const path = require("path"); + +module.exports = (Franz) => { + const getMessages = function getMessages() { + // get unread messages + const count = document.querySelectorAll('.guilds-wrapper .badge').length; + + // set Franz badge + Franz.setBadge(count); + }; + + // check for new messages every second and update Franz badge + Franz.loop(getMessages); + + // Hide download message + Franz.injectCSS(path.join(__dirname, 'service.css')); +}; -- cgit v1.2.3-70-g09d2