diff options
Diffstat (limited to 'recipes/parro/webview.js')
-rw-r--r-- | recipes/parro/webview.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/recipes/parro/webview.js b/recipes/parro/webview.js new file mode 100644 index 0000000..df9b9fd --- /dev/null +++ b/recipes/parro/webview.js | |||
@@ -0,0 +1,22 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | function getMessages() { | ||
9 | let direct = 0; | ||
10 | let indirect = 0; | ||
11 | const FerdiumData = document.querySelector('#FerdiumMessages').dataset; | ||
12 | if (FerdiumData) { | ||
13 | direct = FerdiumData.direct; | ||
14 | indirect = FerdiumData.indirect; | ||
15 | } | ||
16 | |||
17 | Ferdium.setBadge(direct, indirect); | ||
18 | } | ||
19 | |||
20 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
21 | Ferdium.loop(getMessages); | ||
22 | }; | ||