signal-desktop/js/panel_controller.js

39 lines
952 B
JavaScript
Raw Normal View History

/*global $, Whisper, Backbone, extension*/
/*
* vim: ts=4:sw=4:expandtab
*/
// This script should only be included in background.html
(function () {
'use strict';
window.Whisper = window.Whisper || {};
window.isOpen = function() {
return true;
};
window.clearAttention = function() {
console.log('clear attention');
if (window.keepClear) {
clearInterval(window.keepClear);
delete window.keepClear;
}
window.keepClear = setInterval(function() {
extension.windows.clearAttention(inboxWindowId);
}, 2000);
};
var inboxWindowId = 'inbox';
window.setUnreadCount = function(count) {
if (count > 0) {
window.setBadgeCount(count);
2017-04-12 19:44:22 -07:00
window.document.title = "Signal (" + count + ")";
} else {
window.setBadgeCount(0);
2017-04-12 19:44:22 -07:00
window.document.title = "Signal";
}
};
})();