2016-04-02 10:29:06 +02:00
|
|
|
/**
|
|
|
|
* Global functions for electron app
|
|
|
|
*/
|
2016-04-01 21:50:34 +02:00
|
|
|
var ipc = require('electron').ipcRenderer;
|
|
|
|
|
2016-04-02 10:29:06 +02:00
|
|
|
// Set app bagde
|
2016-04-01 21:50:34 +02:00
|
|
|
var setElectronBadge = function(value) {
|
2016-04-03 13:25:54 +02:00
|
|
|
// Check ipc
|
2016-04-01 21:50:34 +02:00
|
|
|
if (ipc && typeof ipc.send === 'function') {
|
2016-04-03 13:25:54 +02:00
|
|
|
// Send new badge value
|
2016-04-01 21:50:34 +02:00
|
|
|
ipc.send('badge', value);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-04-02 10:29:06 +02:00
|
|
|
// Export global variables and functions
|
2016-04-01 21:50:34 +02:00
|
|
|
global.setElectronBadge = setElectronBadge;
|
2016-04-02 18:07:12 +02:00
|
|
|
|
|
|
|
// Let Glowing Bear know it's running as an electron app
|
|
|
|
window.is_electron = 1;
|