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/glowingbear/LICENSE | 21 +++++++++++++++++++++ recipes/glowingbear/icon.png | Bin 0 -> 60069 bytes recipes/glowingbear/icon.svg | 1 + recipes/glowingbear/index.js | 4 ++++ recipes/glowingbear/package.json | 14 ++++++++++++++ recipes/glowingbear/webview.js | 15 +++++++++++++++ 6 files changed, 55 insertions(+) create mode 100644 recipes/glowingbear/LICENSE create mode 100644 recipes/glowingbear/icon.png create mode 100644 recipes/glowingbear/icon.svg create mode 100644 recipes/glowingbear/index.js create mode 100644 recipes/glowingbear/package.json create mode 100644 recipes/glowingbear/webview.js (limited to 'recipes/glowingbear') diff --git a/recipes/glowingbear/LICENSE b/recipes/glowingbear/LICENSE new file mode 100644 index 0000000..25b2950 --- /dev/null +++ b/recipes/glowingbear/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/glowingbear/icon.png b/recipes/glowingbear/icon.png new file mode 100644 index 0000000..19f30d7 Binary files /dev/null and b/recipes/glowingbear/icon.png differ diff --git a/recipes/glowingbear/icon.svg b/recipes/glowingbear/icon.svg new file mode 100644 index 0000000..a398f58 --- /dev/null +++ b/recipes/glowingbear/icon.svg @@ -0,0 +1 @@ +glowing-bearCreated with Sketch (http://www.bohemiancoding.com/sketch) \ No newline at end of file diff --git a/recipes/glowingbear/index.js b/recipes/glowingbear/index.js new file mode 100644 index 0000000..2af527c --- /dev/null +++ b/recipes/glowingbear/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = Franz => Franz; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsb3dpbmdiZWFyL2luZGV4LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiJdLCJtYXBwaW5ncyI6Ijs7QUFBQUEsT0FBT0MsT0FBUCxHQUFpQkMsU0FBU0EsS0FBMUIiLCJmaWxlIjoiZ2xvd2luZ2JlYXIvaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IEZyYW56ID0+IEZyYW56OyJdfQ== \ No newline at end of file diff --git a/recipes/glowingbear/package.json b/recipes/glowingbear/package.json new file mode 100644 index 0000000..04cca9c --- /dev/null +++ b/recipes/glowingbear/package.json @@ -0,0 +1,14 @@ +{ + "id": "glowingbear", + "name": "Glowing Bear", + "version": "1.0.0", + "description": "Glowing Bear - WeeChat web frontend", + "main": "index.js", + "author": "Jonathan Juursema ", + "license": "MIT", + "config": { + "serviceURL": "https://www.glowing-bear.org", + "hasNotificationSound": true, + "hasIndirectMessages": true + } +} diff --git a/recipes/glowingbear/webview.js b/recipes/glowingbear/webview.js new file mode 100644 index 0000000..1876a72 --- /dev/null +++ b/recipes/glowingbear/webview.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = Franz => { + const getMessages = function getMessages() { + let indirectElements = document.querySelectorAll('.badge:not(.danger)'); + let direct = document.querySelectorAll('.badge.danger').length - 1; + let indirect = -1; + for (let i = 0; i < indirectElements.length; i += 1) { + if (indirectElements[i].innerHTML.length > 0) indirect++; + } + Franz.setBadge(Math.max(direct, 0), Math.max(indirect, 0)); + }; + Franz.loop(getMessages); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsb3dpbmdiZWFyL3dlYnZpZXcuanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIkZyYW56IiwiZ2V0TWVzc2FnZXMiLCJpbmRpcmVjdEVsZW1lbnRzIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwiZGlyZWN0IiwibGVuZ3RoIiwiaW5kaXJlY3QiLCJpIiwiaW5uZXJIVE1MIiwic2V0QmFkZ2UiLCJNYXRoIiwibWF4IiwibG9vcCJdLCJtYXBwaW5ncyI6Ijs7QUFBQUEsT0FBT0MsT0FBUCxHQUFpQkMsU0FBUztBQUN6QixPQUFNQyxjQUFjLFNBQVNBLFdBQVQsR0FBdUI7QUFDMUMsTUFBSUMsbUJBQW1CQyxTQUFTQyxnQkFBVCxDQUEwQixxQkFBMUIsQ0FBdkI7QUFDQSxNQUFJQyxTQUFTRixTQUFTQyxnQkFBVCxDQUEwQixlQUExQixFQUEyQ0UsTUFBM0MsR0FBb0QsQ0FBakU7QUFDQSxNQUFJQyxXQUFXLENBQUMsQ0FBaEI7QUFDQSxPQUFLLElBQUlDLElBQUksQ0FBYixFQUFnQkEsSUFBSU4saUJBQWlCSSxNQUFyQyxFQUE2Q0UsS0FBSyxDQUFsRCxFQUFxRDtBQUNwRCxPQUFJTixpQkFBaUJNLENBQWpCLEVBQW9CQyxTQUFwQixDQUE4QkgsTUFBOUIsR0FBdUMsQ0FBM0MsRUFBOENDO0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