|
|
|
@ -38,6 +38,35 @@ $(document).ready(function () {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (typeof require !== "undefined") {
|
|
|
|
|
// Load native UI library
|
|
|
|
|
var gui = require('nw.gui');
|
|
|
|
|
var win = gui.Window.get();
|
|
|
|
|
//Get saved size and position
|
|
|
|
|
chrome.storage.local.get('windowSize', function (result) {
|
|
|
|
|
if (result.windowSize) {
|
|
|
|
|
win.height = result.windowSize.height;
|
|
|
|
|
win.width = result.windowSize.width;
|
|
|
|
|
win.x = result.windowSize.x;
|
|
|
|
|
win.y = result.windowSize.y;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
win.on('close', function () {
|
|
|
|
|
//Save window size and position
|
|
|
|
|
var currentWin = this;
|
|
|
|
|
chrome.storage.local.set({'windowSize': {height: win.height, width: win.width, x: win.x, y: win.y}}, function () {
|
|
|
|
|
// Notify that we saved.
|
|
|
|
|
console.log('Settings saved');
|
|
|
|
|
});
|
|
|
|
|
this.hide(); // Pretend to be closed already
|
|
|
|
|
console.log("We're closing...");
|
|
|
|
|
this.close(true);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
console.log('Not load require');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chrome.storage.local.get('logopen', function (result) {
|
|
|
|
|
if (result.logopen) {
|
|
|
|
|
$("#showlog").trigger('click');
|
|
|
|
|