|
|
@ -9,7 +9,6 @@ |
|
|
|
const Menu = require('electron').Menu; |
|
|
|
const Menu = require('electron').Menu; |
|
|
|
// Node fs module
|
|
|
|
// Node fs module
|
|
|
|
const fs = require("fs"); |
|
|
|
const fs = require("fs"); |
|
|
|
|
|
|
|
|
|
|
|
var template; |
|
|
|
var template; |
|
|
|
|
|
|
|
|
|
|
|
template = [ |
|
|
|
template = [ |
|
|
@ -76,18 +75,32 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: 'Toggle Developer Tools', |
|
|
|
label: 'Electron Developer Tools', |
|
|
|
accelerator: (function() { |
|
|
|
accelerator: (function() { |
|
|
|
if (process.platform == 'darwin') |
|
|
|
if (process.platform == 'darwin') |
|
|
|
return 'Alt+Command+I'; |
|
|
|
return 'Alt+Command+E'; |
|
|
|
else |
|
|
|
else |
|
|
|
return 'Ctrl+Shift+I'; |
|
|
|
return 'Ctrl+Shift+E'; |
|
|
|
})(), |
|
|
|
})(), |
|
|
|
click: function(item, focusedWindow) { |
|
|
|
click: function(item, focusedWindow) { |
|
|
|
if (focusedWindow) |
|
|
|
if (focusedWindow) |
|
|
|
focusedWindow.toggleDevTools(); |
|
|
|
focusedWindow.toggleDevTools(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: 'Web Developer Tools', |
|
|
|
|
|
|
|
accelerator: (function() { |
|
|
|
|
|
|
|
if (process.platform == 'darwin') |
|
|
|
|
|
|
|
return 'Alt+Command+I'; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return 'Ctrl+Shift+I'; |
|
|
|
|
|
|
|
})(), |
|
|
|
|
|
|
|
click: function(item, focusedWindow) { |
|
|
|
|
|
|
|
if ( focusedWindow ) { |
|
|
|
|
|
|
|
focusedWindow.webContents.send( 'openDevTools' ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -183,7 +196,6 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
app.on('ready', function() { |
|
|
|
app.on('ready', function() { |
|
|
|
|
|
|
|
|
|
|
|
var menu = Menu.buildFromTemplate(template); |
|
|
|
var menu = Menu.buildFromTemplate(template); |
|
|
|
Menu.setApplicationMenu(menu); |
|
|
|
Menu.setApplicationMenu(menu); |
|
|
|
const initPath = __dirname + "/init.json"; |
|
|
|
const initPath = __dirname + "/init.json"; |
|
|
@ -197,7 +209,7 @@ |
|
|
|
console.log('Unable to read init.json: ', e); |
|
|
|
console.log('Unable to read init.json: ', e); |
|
|
|
} |
|
|
|
} |
|
|
|
const bounds = (data && data.bounds) ? data.bounds : {width: 1280, height:800 }; |
|
|
|
const bounds = (data && data.bounds) ? data.bounds : {width: 1280, height:800 }; |
|
|
|
var bwdata = {width: bounds.width, height: bounds.height, 'min-width': 1024, 'min-height': 600, 'autoHideMenuBar': true, 'web-security': true, 'java': false, 'accept-first-mouse': true, defaultEncoding: 'UTF-8', 'icon':'file://'+__dirname + '/assets/img/favicon.png'} |
|
|
|
var bwdata = {width: bounds.width, height: bounds.height, 'min-width': 1024, 'min-height': 600, 'autoHideMenuBar': true, 'web-security': true, 'java': false, 'accept-first-mouse': true, defaultEncoding: 'UTF-8', 'icon':'file://'+__dirname + '/assets/img/favicon.png'}; |
|
|
|
// Remembe window position
|
|
|
|
// Remembe window position
|
|
|
|
if (data && data.bounds.x && data.bounds.y) { |
|
|
|
if (data && data.bounds.x && data.bounds.y) { |
|
|
|
bwdata.x = data.bounds.x; |
|
|
|
bwdata.x = data.bounds.x; |
|
|
|