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/jitsi/LICENSE | 21 +++++++++++++++++++++ recipes/jitsi/README.md | 6 ++++++ recipes/jitsi/icon.png | Bin 0 -> 105291 bytes recipes/jitsi/icon.svg | 21 +++++++++++++++++++++ recipes/jitsi/index.js | 6 ++++++ recipes/jitsi/package.json | 15 +++++++++++++++ recipes/jitsi/webview.js | 14 ++++++++++++++ 7 files changed, 83 insertions(+) create mode 100644 recipes/jitsi/LICENSE create mode 100644 recipes/jitsi/README.md create mode 100644 recipes/jitsi/icon.png create mode 100644 recipes/jitsi/icon.svg create mode 100644 recipes/jitsi/index.js create mode 100644 recipes/jitsi/package.json create mode 100644 recipes/jitsi/webview.js (limited to 'recipes/jitsi') diff --git a/recipes/jitsi/LICENSE b/recipes/jitsi/LICENSE new file mode 100644 index 0000000..db188a7 --- /dev/null +++ b/recipes/jitsi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Sampath Kumar Krishnan + +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/jitsi/README.md b/recipes/jitsi/README.md new file mode 100644 index 0000000..a88c256 --- /dev/null +++ b/recipes/jitsi/README.md @@ -0,0 +1,6 @@ +# Jitsi Ferdi Plugin + +This is unofficial [Jitsi](https://meet.jit.si) recipe for Ferdi + +Follow instructions [here](https://github.com/getferdi/recipes/blob/master/docs/integration.md) for installation of this plugin. + diff --git a/recipes/jitsi/icon.png b/recipes/jitsi/icon.png new file mode 100644 index 0000000..c5d54e1 Binary files /dev/null and b/recipes/jitsi/icon.png differ diff --git a/recipes/jitsi/icon.svg b/recipes/jitsi/icon.svg new file mode 100644 index 0000000..5e641b5 --- /dev/null +++ b/recipes/jitsi/icon.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/recipes/jitsi/index.js b/recipes/jitsi/index.js new file mode 100644 index 0000000..6e3a728 --- /dev/null +++ b/recipes/jitsi/index.js @@ -0,0 +1,6 @@ +"use strict"; +module.exports = Franz => class Jitsi extends Franz { + overrideUserAgent() { + return window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(); + } +} \ No newline at end of file diff --git a/recipes/jitsi/package.json b/recipes/jitsi/package.json new file mode 100644 index 0000000..4a6908a --- /dev/null +++ b/recipes/jitsi/package.json @@ -0,0 +1,15 @@ +{ + "id": "jitsi", + "name": "Jitsi Meet", + "version": "1.0.3", + "description": "Jitsi Meet", + "main": "index.js", + "author": "Sampath Kumar Krishnan ", + "license": "MIT", + "repository": "https://github.com/sampathBlam/ferdi-jitsi", + "config": { + "serviceURL": "https://meet.jit.si/", + "hasCustomUrl": true, + "message": "For the public instance, use https://meet.jit.si/ for the Custom server" + } +} diff --git a/recipes/jitsi/webview.js b/recipes/jitsi/webview.js new file mode 100644 index 0000000..563a3cf --- /dev/null +++ b/recipes/jitsi/webview.js @@ -0,0 +1,14 @@ +"use strict"; + +const NOTIFICATION_BADGE_CLASS = '.badge-round'; + +module.exports = Ferdi => { + const getMessages = () => { + const badges = [...document.querySelectorAll(NOTIFICATION_BADGE_CLASS)]; + const messages = badges.reduce((currentValue, element) => currentValue + Number(element.innerText), 0); + + Ferdi.setBadge(messages); + } + + Ferdi.loop(getMessages); +} \ No newline at end of file -- cgit v1.2.3-70-g09d2