|
|
@ -9,7 +9,7 @@ const electron = require('electron'), |
|
|
|
os = require('os'), |
|
|
|
spawn = require('child_process').spawn, |
|
|
|
exec = require('child_process').exec, |
|
|
|
{Menu} = require("electron"), |
|
|
|
{ Menu } = require("electron"), |
|
|
|
fixPath = require('fix-path'); |
|
|
|
|
|
|
|
var express = require('express'), |
|
|
@ -62,7 +62,14 @@ process.once('loaded', () => { |
|
|
|
}); |
|
|
|
|
|
|
|
guiapp.use(bodyParser.json({ limit: '50mb' })); // support json encoded bodies
|
|
|
|
<<<<<<< HEAD |
|
|
|
guiapp.use(bodyParser.urlencoded({ limit: '50mb', extended: true })); // support encoded bodies
|
|
|
|
======= |
|
|
|
guiapp.use(bodyParser.urlencoded({ |
|
|
|
limit: '50mb', |
|
|
|
extended: true |
|
|
|
})); // support encoded bodies
|
|
|
|
>>>>>>> 7486433f111614db47f4d49f4a2a77ecd5bfcd68 |
|
|
|
|
|
|
|
guiapp.get('/', function (req, res) { |
|
|
|
res.send('Iguana app server'); |
|
|
@ -172,6 +179,7 @@ fs.copy(iguanaConfsDirSrc, iguanaConfsDir, function (err) { |
|
|
|
|
|
|
|
let mainWindow; |
|
|
|
let loadingWindow; |
|
|
|
var isMainWindowExist; |
|
|
|
|
|
|
|
function createLoadingWindow() { |
|
|
|
mainWindow = null; |
|
|
@ -196,7 +204,8 @@ function createLoadingWindow() { |
|
|
|
// putting them into an window_arr
|
|
|
|
loadingWindow = null; |
|
|
|
createWindow('open'); |
|
|
|
}) |
|
|
|
isMainWindowExist = true; |
|
|
|
}); |
|
|
|
|
|
|
|
//ca333 todo - add os detector to use correct binary - so we can use the same bundle on ALL OS platforms
|
|
|
|
/*if (os.platform() === 'win32') { |
|
|
@ -220,10 +229,8 @@ function createLoadingWindow() { |
|
|
|
|
|
|
|
app.on('ready', createLoadingWindow); |
|
|
|
|
|
|
|
|
|
|
|
function createWindow (status) { |
|
|
|
if ( status === 'open') { |
|
|
|
|
|
|
|
if ( status === 'open' && !isMainWindowExist) { |
|
|
|
require(path.join(__dirname, 'private/mainmenu')); |
|
|
|
|
|
|
|
// initialise window
|
|
|
@ -234,20 +241,20 @@ function createWindow (status) { |
|
|
|
}); |
|
|
|
|
|
|
|
const staticMenu = Menu.buildFromTemplate([ //if static
|
|
|
|
{role: 'copy'}, |
|
|
|
{type: 'separator'}, |
|
|
|
{role: 'selectall'}, |
|
|
|
{ role: 'copy' }, |
|
|
|
{ type: 'separator' }, |
|
|
|
{ role: 'selectall' }, |
|
|
|
]) |
|
|
|
|
|
|
|
const editMenu = Menu.buildFromTemplate([ //if editable
|
|
|
|
{role: 'undo'}, |
|
|
|
{role: 'redo'}, |
|
|
|
{type: 'separator'}, |
|
|
|
{role: 'cut'}, |
|
|
|
{role: 'copy'}, |
|
|
|
{role: 'paste'}, |
|
|
|
{type: 'separator'}, |
|
|
|
{role: 'selectall'}, |
|
|
|
{ role: 'undo' }, |
|
|
|
{ role: 'redo' }, |
|
|
|
{ type: 'separator' }, |
|
|
|
{ role: 'cut' }, |
|
|
|
{ role: 'copy' }, |
|
|
|
{ role: 'paste' }, |
|
|
|
{ type: 'separator' }, |
|
|
|
{ role: 'selectall' }, |
|
|
|
]) |
|
|
|
|
|
|
|
// load our index.html (i.e. easyDEX GUI)
|
|
|
@ -259,6 +266,7 @@ function createWindow (status) { |
|
|
|
|
|
|
|
mainWindow.webContents.on('context-menu', (e, params) => { //context-menu returns params
|
|
|
|
const { selectionText, isEditable } = params; //params obj
|
|
|
|
|
|
|
|
if (isEditable) { |
|
|
|
editMenu.popup(mainWindow); |
|
|
|
} else if (selectionText && selectionText.trim() !== '') { |
|
|
|