From 9db43e100a672b6d6932ac68c0fbe503c129138b Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Sun, 12 Sep 2021 22:01:51 +0530 Subject: Added a check to verify that the folder name of the recipe matches the recipe id (#708) Use the recipe-id as master to rename internal folder names --- recipes/superhuman/LICENSE | 21 +++++++++++++++++++++ recipes/superhuman/icon.svg | 1 + recipes/superhuman/index.js | 6 ++++++ recipes/superhuman/package.json | 10 ++++++++++ recipes/superhuman/webview.js | 8 ++++++++ 5 files changed, 46 insertions(+) create mode 100644 recipes/superhuman/LICENSE create mode 100644 recipes/superhuman/icon.svg create mode 100644 recipes/superhuman/index.js create mode 100644 recipes/superhuman/package.json create mode 100644 recipes/superhuman/webview.js (limited to 'recipes/superhuman') diff --git a/recipes/superhuman/LICENSE b/recipes/superhuman/LICENSE new file mode 100644 index 0000000..fcf56e2 --- /dev/null +++ b/recipes/superhuman/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 CrystalLarsh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/recipes/superhuman/icon.svg b/recipes/superhuman/icon.svg new file mode 100644 index 0000000..faaa17f --- /dev/null +++ b/recipes/superhuman/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recipes/superhuman/index.js b/recipes/superhuman/index.js new file mode 100644 index 0000000..44bc55d --- /dev/null +++ b/recipes/superhuman/index.js @@ -0,0 +1,6 @@ +module.exports = Ferdi => class SuperHuman extends Ferdi { + overrideUserAgent() { + // TODO: Rather than hardcoding like this, the user should set it for their individual installation of Ferdi + return 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136'; + } +}; diff --git a/recipes/superhuman/package.json b/recipes/superhuman/package.json new file mode 100644 index 0000000..53509cb --- /dev/null +++ b/recipes/superhuman/package.json @@ -0,0 +1,10 @@ +{ + "id": "superhuman", + "name": "superhuman", + "version": "1.1.0", + "license": "MIT", + "repository": "https://github.com/CrystalLarsh/franz-superhuman-recipe", + "config": { + "hasCustomUrl": true + } +} diff --git a/recipes/superhuman/webview.js b/recipes/superhuman/webview.js new file mode 100644 index 0000000..697efa6 --- /dev/null +++ b/recipes/superhuman/webview.js @@ -0,0 +1,8 @@ +module.exports = (Ferdi) => { + const getMessages = () => { + const mentions = document.querySelectorAll('.chat-line .mentioned').length; + Ferdi.setBadge(mentions, 0); + }; + + Ferdi.loop(getMessages); +}; -- cgit v1.2.3-54-g00ecf