From 4de42fadc366706060541ca3c42245c23da63217 Mon Sep 17 00:00:00 2001 From: Quentin Goinaud Date: Mon, 28 Oct 2019 22:11:35 +0100 Subject: add hackmd --- uncompressed/hackmd/icon.png | Bin 0 -> 4837 bytes uncompressed/hackmd/icon.svg | 137 +++++++++++++++++++++++++++++++++++++++ uncompressed/hackmd/index.js | 4 ++ uncompressed/hackmd/package.json | 14 ++++ uncompressed/hackmd/service.css | 3 + uncompressed/hackmd/webview.js | 17 +++++ 6 files changed, 175 insertions(+) create mode 100644 uncompressed/hackmd/icon.png create mode 100644 uncompressed/hackmd/icon.svg create mode 100644 uncompressed/hackmd/index.js create mode 100644 uncompressed/hackmd/package.json create mode 100644 uncompressed/hackmd/service.css create mode 100644 uncompressed/hackmd/webview.js (limited to 'uncompressed') diff --git a/uncompressed/hackmd/icon.png b/uncompressed/hackmd/icon.png new file mode 100644 index 0000000..eebdcf7 Binary files /dev/null and b/uncompressed/hackmd/icon.png differ diff --git a/uncompressed/hackmd/icon.svg b/uncompressed/hackmd/icon.svg new file mode 100644 index 0000000..7c28965 --- /dev/null +++ b/uncompressed/hackmd/icon.svg @@ -0,0 +1,137 @@ + + + + diff --git a/uncompressed/hackmd/index.js b/uncompressed/hackmd/index.js new file mode 100644 index 0000000..46335da --- /dev/null +++ b/uncompressed/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/uncompressed/hackmd/package.json b/uncompressed/hackmd/package.json new file mode 100644 index 0000000..517efb5 --- /dev/null +++ b/uncompressed/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/uncompressed/hackmd/service.css b/uncompressed/hackmd/service.css new file mode 100644 index 0000000..a16a615 --- /dev/null +++ b/uncompressed/hackmd/service.css @@ -0,0 +1,3 @@ +.notice { + display: none; +} diff --git a/uncompressed/hackmd/webview.js b/uncompressed/hackmd/webview.js new file mode 100644 index 0000000..cd3afed --- /dev/null +++ b/uncompressed/hackmd/webview.js @@ -0,0 +1,17 @@ +import path from '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