From 416dbb944567306424fd02831e3f4f1dfeb71da1 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Sun, 12 Sep 2021 08:08:52 +0530 Subject: New recipe: 'yandex-mail' (fixes #421) (#685) --- recipes/yandex-mail/LICENSE | 21 +++++++++++++++++++++ recipes/yandex-mail/icon.svg | 26 ++++++++++++++++++++++++++ recipes/yandex-mail/index.js | 1 + recipes/yandex-mail/package.json | 9 +++++++++ recipes/yandex-mail/webview.js | 13 +++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 recipes/yandex-mail/LICENSE create mode 100644 recipes/yandex-mail/icon.svg create mode 100644 recipes/yandex-mail/index.js create mode 100644 recipes/yandex-mail/package.json create mode 100644 recipes/yandex-mail/webview.js (limited to 'recipes/yandex-mail') diff --git a/recipes/yandex-mail/LICENSE b/recipes/yandex-mail/LICENSE new file mode 100644 index 0000000..8abf7a7 --- /dev/null +++ b/recipes/yandex-mail/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Mikhail Konovalov + +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/yandex-mail/icon.svg b/recipes/yandex-mail/icon.svg new file mode 100644 index 0000000..0ce362b --- /dev/null +++ b/recipes/yandex-mail/icon.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/recipes/yandex-mail/index.js b/recipes/yandex-mail/index.js new file mode 100644 index 0000000..23607bd --- /dev/null +++ b/recipes/yandex-mail/index.js @@ -0,0 +1 @@ +module.exports = Ferdi => Ferdi; diff --git a/recipes/yandex-mail/package.json b/recipes/yandex-mail/package.json new file mode 100644 index 0000000..356c1b9 --- /dev/null +++ b/recipes/yandex-mail/package.json @@ -0,0 +1,9 @@ +{ + "id": "yandex-mail", + "name": "Yandex Mail", + "version": "1.0.0", + "license": "MIT", + "config": { + "serviceURL": "https://mail.yandex.ru" + } +} diff --git a/recipes/yandex-mail/webview.js b/recipes/yandex-mail/webview.js new file mode 100644 index 0000000..2c039a1 --- /dev/null +++ b/recipes/yandex-mail/webview.js @@ -0,0 +1,13 @@ +module.exports = Ferdi => { + const getMessages = function getMessages() { + let count = 0; + + if (document.getElementsByClassName('mail-LabelList-Item_count').length > 1) { + count = Ferdi.safeParseInt(document.getElementsByClassName('mail-LabelList-Item_count')[1].textContent); + } + + Ferdi.setBadge(count); + }; + + Ferdi.loop(getMessages); +}; -- cgit v1.2.3-54-g00ecf