diff options
author | Silenio Quarti <Silenio_Quarti@ca.ibm.com> | 2016-05-20 14:46:19 -0400 |
---|---|---|
committer | Silenio Quarti <Silenio_Quarti@ca.ibm.com> | 2016-05-20 14:46:19 -0400 |
commit | edad50dfcfbbce1509c6dcefcb7c51258a4fdd09 (patch) | |
tree | 8237024127babc6113ca2dc409aee75b8188e4b2 | |
parent | 78f17bd31a826d7cd88680d062c5f2009bd5f7f8 (diff) | |
download | org.eclipse.orion.client-origin/stable_20160524.zip org.eclipse.orion.client-origin/stable_20160524.tar.gz org.eclipse.orion.client-origin/stable_20160524.tar.bz2 |
electron: fix copy/cut/paste on Macorigin/stable_20160524
-rw-r--r-- | modules/orionode/server.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/orionode/server.js b/modules/orionode/server.js index 0eb53a8..2adf471 100644 --- a/modules/orionode/server.js +++ b/modules/orionode/server.js @@ -113,6 +113,30 @@ if (process.versions.electron) { var electron = require('electron'); var mainWindow = null; electron.app.on('ready', function() { + if (process.platform === 'darwin') { + var Menu = require("menu"); + if (!Menu.getApplicationMenu()) { + var template = [{ + label: "Application", + submenu: [ + { label: "About Application", selector: "orderFrontStandardAboutPanel:" }, + { type: "separator" }, + { label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }} + ]}, { + label: "Edit", + submenu: [ + { label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" }, + { label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" }, + { type: "separator" }, + { label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" }, + { label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" }, + { label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" }, + { label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" } + ]} + ]; + Menu.setApplicationMenu(Menu.buildFromTemplate(template)); + } + } function createWindow(url){ var nextWindow = new electron.BrowserWindow({width: 1024, height: 800, title: "Orion", icon: "icon/256x256/orion.png"}); nextWindow.loadURL("file:///" + __dirname + "/lib/main.html#" + encodeURI(url)); |