kopia lustrzana https://github.com/dceejay/electron-node-red
Tidy up
rodzic
1889d4d0a7
commit
90004fa701
|
@ -25,6 +25,8 @@ Run `npm run pack` to create packages for all platforms - these are the files re
|
||||||
|
|
||||||
Builds are created in the `build` directory. Runtimes are created in the `../electron-bin` directory.
|
Builds are created in the `build` directory. Runtimes are created in the `../electron-bin` directory.
|
||||||
|
|
||||||
|
**Note**: this was written to work on a Mac... other tools may/will be needed on other platforms.
|
||||||
|
|
||||||
## Packaging your application
|
## Packaging your application
|
||||||
|
|
||||||
If you want to distribute executables of this project, the easiest way is to use electron-packager:
|
If you want to distribute executables of this project, the easiest way is to use electron-packager:
|
||||||
|
|
63
main.js
63
main.js
|
@ -77,35 +77,6 @@ var template = [{
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{ role: 'quit' }
|
{ role: '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:" }
|
|
||||||
]}, {
|
|
||||||
label: 'View',
|
|
||||||
submenu: [
|
|
||||||
{ label: 'Reload',
|
|
||||||
accelerator: 'CmdOrCtrl+R',
|
|
||||||
click (item, focusedWindow) { if (focusedWindow) focusedWindow.reload() }
|
|
||||||
},
|
|
||||||
{ label: 'Toggle Developer Tools',
|
|
||||||
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
|
|
||||||
click (item, focusedWindow) { if (focusedWindow) focusedWindow.webContents.toggleDevTools() }
|
|
||||||
},
|
|
||||||
{ type: 'separator' },
|
|
||||||
{ role: 'resetzoom' },
|
|
||||||
{ role: 'zoomin' },
|
|
||||||
{ role: 'zoomout' },
|
|
||||||
{ type: 'separator' },
|
|
||||||
{ role: 'togglefullscreen' },
|
|
||||||
{ role: 'minimize' }
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
label: 'Node-RED',
|
label: 'Node-RED',
|
||||||
submenu: [
|
submenu: [
|
||||||
{ label: 'Editor',
|
{ label: 'Editor',
|
||||||
|
@ -120,11 +91,41 @@ var template = [{
|
||||||
{ label: 'Documentation',
|
{ label: 'Documentation',
|
||||||
click() { require('electron').shell.openExternal('http://nodered.org/docs') }
|
click() { require('electron').shell.openExternal('http://nodered.org/docs') }
|
||||||
},
|
},
|
||||||
|
{ label: 'Flows and Nodes',
|
||||||
|
click() { require('electron').shell.openExternal('http://flows.nodered.org') }
|
||||||
|
},
|
||||||
{ label: 'Google group',
|
{ label: 'Google group',
|
||||||
click() { require('electron').shell.openExternal('https://groups.google.com/forum/#!forum/node-red') }
|
click() { require('electron').shell.openExternal('https://groups.google.com/forum/#!forum/node-red') }
|
||||||
}
|
}
|
||||||
]
|
]}, {
|
||||||
}
|
// 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:" }
|
||||||
|
// ]}, {
|
||||||
|
label: 'View',
|
||||||
|
submenu: [
|
||||||
|
{ label: 'Reload',
|
||||||
|
accelerator: 'CmdOrCtrl+R',
|
||||||
|
click(item, focusedWindow) { if (focusedWindow) focusedWindow.reload(); }
|
||||||
|
},
|
||||||
|
{ label: 'Toggle Developer Tools',
|
||||||
|
accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I',
|
||||||
|
click(item, focusedWindow) { if (focusedWindow) focusedWindow.webContents.toggleDevTools(); }
|
||||||
|
},
|
||||||
|
{ type: 'separator' },
|
||||||
|
{ role: 'resetzoom' },
|
||||||
|
{ role: 'zoomin' },
|
||||||
|
{ role: 'zoomout' },
|
||||||
|
{ type: 'separator' },
|
||||||
|
{ role: 'togglefullscreen' },
|
||||||
|
{ role: 'minimize' }
|
||||||
|
]}
|
||||||
];
|
];
|
||||||
|
|
||||||
// Keep a global reference of the window object, if you don't, the window will
|
// Keep a global reference of the window object, if you don't, the window will
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron main.js",
|
"start": "electron main.js",
|
||||||
"test": "echo \" Warning: no test specified \"",
|
"test": "echo \" Warning: no test specified \"",
|
||||||
|
"watch": "nodemon --exec \"npm run start\" --ext js,css,json --ignore build/",
|
||||||
|
|
||||||
"clean": "rm -rf ./build ../electron-bin && mkdir -p ./build ../electron-bin",
|
"clean": "rm -rf ./build ../electron-bin && mkdir -p ./build ../electron-bin",
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue