Browse Source

Merge branch 'master' of git://github.com/SuperNETorg/iguana

all-modes
Petr Balashov 8 years ago
parent
commit
bcf9435b92
  1. BIN
      assets/bin/osx/iguana
  2. BIN
      assets/bin/osx/libnanomsg.5.0.0.dylib
  3. 33
      main.js
  4. 1
      package.json

BIN
assets/bin/osx/iguana

Binary file not shown.

BIN
assets/bin/osx/libnanomsg.5.0.0.dylib

Binary file not shown.

33
main.js

@ -9,15 +9,17 @@ const electron = require('electron'),
os = require('os'),
spawn = require('child_process').spawn,
exec = require('child_process').exec,
{Menu} = require("electron"),
fixPath = require('fix-path');
var express = require('express'),
bodyParser = require('body-parser'),
fs = require('fs'),
fsnode = require('fs'),
fs = require('fs-extra'),
mkdirp = require('mkdirp'),
pm2 = require('pm2');
cluster = require('cluster');
pm2 = require('pm2'),
cluster = require('cluster'),
numCPUs = require('os').cpus().length;
Promise = require('bluebird');
@ -218,6 +220,7 @@ function createLoadingWindow() {
app.on('ready', createLoadingWindow);
function createWindow (status) {
if ( status === 'open') {
@ -230,6 +233,23 @@ function createWindow (status) {
icon: iguanaIcon
});
const staticMenu = Menu.buildFromTemplate([ //if static
{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'},
])
// load our index.html (i.e. easyDEX GUI)
if (appConfig.edexGuiOnly) {
mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.iguanaAppPort + '/gui/EasyDEX-GUI/');
@ -237,6 +257,15 @@ function createWindow (status) {
mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.iguanaAppPort + '/gui/main.html');
}
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() !== '') {
staticMenu.popup(mainWindow);
}
})
// DEVTOOLS - only for dev purposes - ca333
//mainWindow.webContents.openDevTools()

1
package.json

@ -34,6 +34,7 @@
"mkdirp": "^0.5.1",
"pm2": "^2.3.0",
"ps-node": "^0.1.4",
"request": "^2.80.0",
"socket.io": "^1.7.3"
}
}

Loading…
Cancel
Save