aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/dialpad/webview.js
blob: 2bf23f3c44cb5a806e8fcbbc00588728fd910407 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const _path = _interopRequireDefault(require('path'));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = (Ferdi) => {
  function getMessages() {
    var unreadCount = 0;
    $.each($('[data-qa-has-unreads]'), (idx, item) => unreadCount += Ferdi.safeParseInt(item.attributes["data-qa-has-unreads"].value));

    Ferdi.setBadge(unreadCount);
  }

  Ferdi.loop(getMessages);

  Ferdi.injectCSS(_path.default.join(__dirname, 'whitemode.css'));
};