-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.js
46 lines (37 loc) · 1.38 KB
/
default.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(function () {
var remote = require('remote');
var BrowserWindow = remote.require('browser-window');
var edge = remote.require('electron-edge');
var helloWorld = edge.func(`
async (input) => { \
return ".NET Welcomes " + input.ToString(); \
}
`);
helloWorld('JavaScript', function(error, result) {
if(error) throw error;
console.log(result);
});
function init() {
document.getElementById("min-btn").addEventListener("click", function (e) {
var window = BrowserWindow.getFocusedWindow();
window.minimize();
});
document.getElementById("max-btn").addEventListener("click", function (e) {
var window = BrowserWindow.getFocusedWindow();
if(window.isMaximized() === false){
window.maximize();
} else {
window.unmaximize();
}
});
document.getElementById("close-btn").addEventListener("click", function (e) {
var window = BrowserWindow.getFocusedWindow();
window.close();
});
};
document.onreadystatechange = function () {
if (document.readyState == "complete") {
init();
}
};
})();