diff options
author | 2021-09-12 13:24:51 +0530 | |
---|---|---|
committer | 2021-09-12 07:54:51 +0000 | |
commit | 6d520ff1ddb74e7257e1d943f8e91117079db675 (patch) | |
tree | 541a784f0c249a1b1ddf29fcac44834752d223da /recipes/dialpad/webview.js | |
parent | New recipe: 'teamweek' (#694) (diff) | |
download | ferdium-recipes-6d520ff1ddb74e7257e1d943f8e91117079db675.tar.gz ferdium-recipes-6d520ff1ddb74e7257e1d943f8e91117079db675.tar.zst ferdium-recipes-6d520ff1ddb74e7257e1d943f8e91117079db675.zip |
New recipe: 'dialpad' (#695)
Diffstat (limited to 'recipes/dialpad/webview.js')
-rw-r--r-- | recipes/dialpad/webview.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/recipes/dialpad/webview.js b/recipes/dialpad/webview.js new file mode 100644 index 0000000..2bf23f3 --- /dev/null +++ b/recipes/dialpad/webview.js | |||
@@ -0,0 +1,16 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
4 | |||
5 | module.exports = (Ferdi) => { | ||
6 | function getMessages() { | ||
7 | var unreadCount = 0; | ||
8 | $.each($('[data-qa-has-unreads]'), (idx, item) => unreadCount += Ferdi.safeParseInt(item.attributes["data-qa-has-unreads"].value)); | ||
9 | |||
10 | Ferdi.setBadge(unreadCount); | ||
11 | } | ||
12 | |||
13 | Ferdi.loop(getMessages); | ||
14 | |||
15 | Ferdi.injectCSS(_path.default.join(__dirname, 'whitemode.css')); | ||
16 | }; | ||