Port core features from index.js (Open link, Unread count, Font)

This commit is contained in:
Yuya Ochiai
2015-12-23 15:53:34 +09:00
parent 7f8ba9fd56
commit c016c03741
2 changed files with 80 additions and 6 deletions

View File

@@ -4,10 +4,16 @@ const electron = require('electron');
const ipc = electron.ipcRenderer;
const NativeNotification = Notification;
ipc.on('retrieveUnreadCount', function() {
var unreadCountTimer = setInterval(function() {
if (!this.count) {
this.count = 0;
}
var unreadCount = document.getElementsByClassName('unread-title').length;
ipc.sendToHost('retrieveUnreadCount', unreadCount);
});
if (this.count != unreadCount) {
ipc.sendToHost('onUnreadCountChange', unreadCount);
}
this.count = unreadCount;
}, 1000);
// On Windows 8.1 and Windows 8, a shortcut with a Application User Model ID must be installed to the Start screen.
// In current version, use tray balloon for notification