提交 e639ebd9 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #10944 from gero3/editor-electron

Initial electron version of the editor
const electron = require( 'electron' );
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const path = require( 'path' );
const url = require( 'url' );
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow( { webPreferences: {
nodeIntegration: false
} } );
mainWindow.maximize();
mainWindow.setMenu( null );
mainWindow.loadURL( url.format( {
pathname: path.join( __dirname, 'index.html' ),
protocol: 'file:',
slashes: true
} ) );
mainWindow.on( 'closed', function () {
mainWindow = null;
} );
}
app.on( 'ready', createWindow );
app.on( 'window-all-closed', function () {
if ( process.platform !== 'darwin' ) {
app.quit();
}
} );
app.on( 'activate', function () {
if ( mainWindow === null ) {
createWindow();
}
} );
......@@ -33,7 +33,8 @@
"build-closure": "rollup -c && java -jar utils/build/compiler/closure-compiler-v20160713.jar --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs utils/build/externs.js --language_in=ECMASCRIPT5_STRICT --js build/three.js --js_output_file build/three.min.js",
"dev": "rollup -c -w",
"lint": "eslint src",
"test": "rollup -c test/rollup.unit.config.js -w"
"test": "rollup -c test/rollup.unit.config.js -w",
"editor-start": "electron ./editor/main.js"
},
"keywords": [
"three",
......@@ -53,6 +54,7 @@
"qunitjs": "^2.1.1",
"rollup": "^0.41.4",
"rollup-watch": "^3.2.2",
"uglify-js": "^2.6.0"
"uglify-js": "^2.6.0",
"electron": "^1.6.1"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册