|
|
@ -26,3 +26,21 @@ window.rambox.setUnreadCount = function(count) { |
|
|
|
window.rambox.clearUnreadCount = function() { |
|
|
|
window.rambox.clearUnreadCount = function() { |
|
|
|
ipcRenderer.sendToHost('rambox.clearUnreadCount'); |
|
|
|
ipcRenderer.sendToHost('rambox.clearUnreadCount'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Override to add notification click event to display Rambox window and activate service tab |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
var NativeNotification = Notification; |
|
|
|
|
|
|
|
Notification = function(title, options) { |
|
|
|
|
|
|
|
var notification = new NativeNotification(title, options); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
notification.addEventListener('click', function() { |
|
|
|
|
|
|
|
ipcRenderer.sendToHost('rambox.showWindowAndActivateTab'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return notification; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notification.prototype = NativeNotification.prototype; |
|
|
|
|
|
|
|
Notification.permission = NativeNotification.permission; |
|
|
|
|
|
|
|
Notification.requestPermission = NativeNotification.requestPermission.bind(Notification); |
|
|
|