diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2021-11-01 15:14:04 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2021-11-01 15:14:04 +0530 |
commit | 27ffda874e6808a7815ea7844355802afaad9599 (patch) | |
tree | 194011a66b86e3c603e964426c487813e62e943a /recipes/moodle/webview.js | |
parent | Use PascalCasing for generated backend API class name (#759) (diff) | |
download | ferdium-recipes-27ffda874e6808a7815ea7844355802afaad9599.tar.gz ferdium-recipes-27ffda874e6808a7815ea7844355802afaad9599.tar.zst ferdium-recipes-27ffda874e6808a7815ea7844355802afaad9599.zip |
chore: remove empty 'service.css' from recipes. Remove 'README.md' from the creation script
Diffstat (limited to 'recipes/moodle/webview.js')
-rw-r--r-- | recipes/moodle/webview.js | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/recipes/moodle/webview.js b/recipes/moodle/webview.js index 932d1ec..6439c2c 100644 --- a/recipes/moodle/webview.js +++ b/recipes/moodle/webview.js | |||
@@ -1,18 +1,12 @@ | |||
1 | var _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
4 | |||
5 | module.exports = Ferdi => { | 1 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 2 | const getMessages = () => { |
7 | const directCountSelector = [...document.querySelectorAll('[data-region="count-container"]')]; | 3 | const directCountSelector = [...document.querySelectorAll('[data-region="count-container"]')]; |
8 | const totalMessageCount = directCountSelector.reduce( | 4 | const totalMessageCount = directCountSelector.reduce( |
9 | ((count, item) => count + Number(item.textContent)), | 5 | ((count, item) => count + Ferdi.safeParseInt(item.textContent)), |
10 | 0 | 6 | 0 |
11 | ); | 7 | ); |
12 | 8 | ||
13 | Ferdi.setBadge(totalMessageCount, 0); | 9 | Ferdi.setBadge(totalMessageCount, 0); |
14 | }; | 10 | }; |
15 | Ferdi.loop(getMessages); | 11 | Ferdi.loop(getMessages); |
16 | |||
17 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
18 | }; | 12 | }; |