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/thelounge/LICENSE | 21 +++++++++++++++++++++ recipes/thelounge/README.md | 2 ++ recipes/thelounge/icon.png | Bin 0 -> 61431 bytes recipes/thelounge/icon.svg | 7 +++++++ recipes/thelounge/index.js | 4 ++++ recipes/thelounge/package.json | 14 ++++++++++++++ recipes/thelounge/webview.js | 16 ++++++++++++++++ 7 files changed, 64 insertions(+) create mode 100644 recipes/thelounge/LICENSE create mode 100644 recipes/thelounge/README.md create mode 100644 recipes/thelounge/icon.png create mode 100644 recipes/thelounge/icon.svg create mode 100644 recipes/thelounge/index.js create mode 100644 recipes/thelounge/package.json create mode 100644 recipes/thelounge/webview.js (limited to 'recipes/thelounge') diff --git a/recipes/thelounge/LICENSE b/recipes/thelounge/LICENSE new file mode 100644 index 0000000..25b2950 --- /dev/null +++ b/recipes/thelounge/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Jonathan Juursema + +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/thelounge/README.md b/recipes/thelounge/README.md new file mode 100644 index 0000000..37f97f2 --- /dev/null +++ b/recipes/thelounge/README.md @@ -0,0 +1,2 @@ +# franz-thelounge +A recipe to add "The Lounge - Self-hosted web IRC client" to Franz. diff --git a/recipes/thelounge/icon.png b/recipes/thelounge/icon.png new file mode 100644 index 0000000..cb5ba66 Binary files /dev/null and b/recipes/thelounge/icon.png differ diff --git a/recipes/thelounge/icon.svg b/recipes/thelounge/icon.svg new file mode 100644 index 0000000..dd0d301 --- /dev/null +++ b/recipes/thelounge/icon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/recipes/thelounge/index.js b/recipes/thelounge/index.js new file mode 100644 index 0000000..ef95987 --- /dev/null +++ b/recipes/thelounge/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = Franz => Franz; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZWxvdW5nZS9pbmRleC5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiXSwibWFwcGluZ3MiOiI7O0FBQUFBLE9BQU9DLE9BQVAsR0FBaUJDLFNBQVNBLEtBQTFCIiwiZmlsZSI6InRoZWxvdW5nZS9pbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gRnJhbnogPT4gRnJhbno7Il19 \ No newline at end of file diff --git a/recipes/thelounge/package.json b/recipes/thelounge/package.json new file mode 100644 index 0000000..c5f8fc1 --- /dev/null +++ b/recipes/thelounge/package.json @@ -0,0 +1,14 @@ +{ + "id": "thelounge", + "name": "The Lounge", + "version": "1.0.0", + "description": "The Lounge - Self-hosted web IRC client", + "main": "index.js", + "author": "Jonathan Juursema ", + "license": "MIT", + "config": { + "hasCustomUrl": true, + "hasNotificationSound": true, + "hasIndirectMessages": true + } +} diff --git a/recipes/thelounge/webview.js b/recipes/thelounge/webview.js new file mode 100644 index 0000000..933146c --- /dev/null +++ b/recipes/thelounge/webview.js @@ -0,0 +1,16 @@ +'use strict'; + +module.exports = Franz => { + const getMessages = function getMessages() { + let indirectElements = document.querySelectorAll('.badge:not(.highlight)'); + let direct = document.querySelectorAll('.badge.highlight').length; + let indirect = 0; + for (let i = 0; i < indirectElements.length; i += 1) { + if (indirectElements[i].innerHTML.length > 0) indirect++; + } + console.log(direct, indirect); + Franz.setBadge(direct, indirect); + }; + Franz.loop(getMessages); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRoZWxvdW5nZS93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiIsImdldE1lc3NhZ2VzIiwiaW5kaXJlY3RFbGVtZW50cyIsImRvY3VtZW50IiwicXVlcnlTZWxlY3RvckFsbCIsImRpcmVjdCIsImxlbmd0aCIsImluZGlyZWN0IiwiaSIsImlubmVySFRNTCIsImNvbnNvbGUiLCJsb2ciLCJzZXRCYWRnZSIsImxvb3AiXSwibWFwcGluZ3MiOiI7O0FBQUFBLE9BQU9DLE9BQVAsR0FBaUJDLFNBQVM7QUFDekIsT0FBTUMsY0FBYyxTQUFTQSxXQUFULEdBQXVCO0FBQzFDLE1BQUlDLG1CQUFtQkMsU0FBU0MsZ0JBQVQsQ0FBMEIsd0JBQTFCLENBQXZCO0FBQ0EsTUFBSUMsU0FBU0YsU0FBU0MsZ0JBQVQsQ0FBMEIsa0JBQTFCLEVBQThDRSxNQUEzRDtBQUNBLE1BQUlDLFdBQVcsQ0FBZjtBQUNBLE9BQUssSUFBSUMsSUFBSSxDQUFiLEVBQWdCQSxJQUFJTixpQkFBaUJJLE1BQXJDLEVBQTZDRSxLQUFLLENBQWxELEVBQXFEO0FBQ3BELE9BQUlOLGlCQUFpQk0sQ0FBakIsRUF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