diff options
Diffstat (limited to 'recipes/pipefy/webview.js')
-rw-r--r-- | recipes/pipefy/webview.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/recipes/pipefy/webview.js b/recipes/pipefy/webview.js new file mode 100644 index 0000000..a3564c0 --- /dev/null +++ b/recipes/pipefy/webview.js | |||
@@ -0,0 +1,18 @@ | |||
1 | var _path = _interopRequireDefault(require('path')); | ||
2 | |||
3 | function _interopRequireDefault(obj) { | ||
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
6 | |||
7 | module.exports = Ferdi => { | ||
8 | const getMessages = function getMessages() { | ||
9 | const getNotificationButton = document.querySelector( | ||
10 | '#notifications_button', | ||
11 | ); | ||
12 | let hasNotification = getNotificationButton.classList.contains('pp-active'); | ||
13 | Ferdi.setBadge(0, hasNotification ? 1 : 0); | ||
14 | }; | ||
15 | Ferdi.loop(getMessages); | ||
16 | |||
17 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
18 | }; | ||