mirror of
https://github.com/documize/community.git
synced 2025-07-30 18:49:43 +02:00
experimental electron-based desktop app support
This commit is contained in:
parent
3b3785ba24
commit
43b1a39a5a
29 changed files with 273 additions and 62 deletions
33
app/tests/electron.js
Normal file
33
app/tests/electron.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* jshint undef: false */
|
||||
|
||||
const BrowserWindow = require('electron').BrowserWindow;
|
||||
const app = require('electron').app;
|
||||
|
||||
let mainWindow = null;
|
||||
|
||||
app.on('window-all-closed', function onWindowAllClosed() {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
app.on('ready', function onReady() {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600
|
||||
});
|
||||
|
||||
delete mainWindow.module;
|
||||
|
||||
if (process.env.EMBER_ENV === 'test') {
|
||||
mainWindow.loadURL('file://' + __dirname + '/index.html');
|
||||
} else {
|
||||
mainWindow.loadURL('file://' + __dirname + '/dist/index.html');
|
||||
}
|
||||
|
||||
mainWindow.on('closed', function onClosed() {
|
||||
mainWindow = null;
|
||||
});
|
||||
});
|
||||
|
||||
/* jshint undef: true */
|
Loading…
Add table
Add a link
Reference in a new issue