From d5f13d314fd47ed2a0d061a422b566cd90b7ae08 Mon Sep 17 00:00:00 2001 From: Yoga Setiawan Date: Wed, 3 Feb 2021 03:48:59 +0700 Subject: Add recipe for BiP (#429) --- recipes/bip/README.md | 2 ++ recipes/bip/icon.png | Bin 0 -> 102328 bytes recipes/bip/icon.svg | 1 + recipes/bip/index.js | 3 +++ recipes/bip/package.json | 13 +++++++++++++ recipes/bip/service.css | 1 + recipes/bip/webview.js | 22 ++++++++++++++++++++++ 7 files changed, 42 insertions(+) create mode 100644 recipes/bip/README.md create mode 100644 recipes/bip/icon.png create mode 100644 recipes/bip/icon.svg create mode 100644 recipes/bip/index.js create mode 100644 recipes/bip/package.json create mode 100644 recipes/bip/service.css create mode 100644 recipes/bip/webview.js (limited to 'recipes/bip') diff --git a/recipes/bip/README.md b/recipes/bip/README.md new file mode 100644 index 0000000..9ec98ce --- /dev/null +++ b/recipes/bip/README.md @@ -0,0 +1,2 @@ +# BiP for Ferdi +This is a Ferdi recipe for BiP diff --git a/recipes/bip/icon.png b/recipes/bip/icon.png new file mode 100644 index 0000000..0ace1be Binary files /dev/null and b/recipes/bip/icon.png differ diff --git a/recipes/bip/icon.svg b/recipes/bip/icon.svg new file mode 100644 index 0000000..6624082 --- /dev/null +++ b/recipes/bip/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/recipes/bip/index.js b/recipes/bip/index.js new file mode 100644 index 0000000..4507e72 --- /dev/null +++ b/recipes/bip/index.js @@ -0,0 +1,3 @@ +module.exports = Ferdi => class bip extends Ferdi { + +}; diff --git a/recipes/bip/package.json b/recipes/bip/package.json new file mode 100644 index 0000000..de52558 --- /dev/null +++ b/recipes/bip/package.json @@ -0,0 +1,13 @@ +{ + "id": "bip", + "name": "BiP", + "version": "1.0.0", + "description": "bip", + "main": "index.js", + "author": "Yoga Setiawan ", + "license": "MIT", + "config": { + "serviceURL": "https://web.bip.com/", + "hasNotificationSound": true + } +} diff --git a/recipes/bip/service.css b/recipes/bip/service.css new file mode 100644 index 0000000..38dcab0 --- /dev/null +++ b/recipes/bip/service.css @@ -0,0 +1 @@ +/* Insert custom styles you want to insert here */ \ No newline at end of file diff --git a/recipes/bip/webview.js b/recipes/bip/webview.js new file mode 100644 index 0000000..d242716 --- /dev/null +++ b/recipes/bip/webview.js @@ -0,0 +1,22 @@ +"use strict"; + +var _path = _interopRequireDefault(require("path")); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +module.exports = Ferdi => { + const getMessages = function getMessages() { + var elements = document.querySelectorAll(".contact-list__message__unread-badge-counter"); + var count = 0; + for (var i = 0; i < elements.length; i++) { + var countValue = parseInt(elements[i].textContent || '0', 10); + count += countValue; + } + Ferdi.setBadge(count, 0); + }; + + Ferdi.loop(getMessages); + Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); +}; -- cgit v1.2.3-70-g09d2