Permalink
Browse files

Setup project for electron support.

  • Loading branch information...
alexkb committed Jul 4, 2015
1 parent 58727b8 commit fe57d6ccbefb7a07ee73952c5eb60fd033f11ee8
Showing with 40 additions and 1 deletion.
  1. +37 −0 main.js
  2. +3 −1 package.json
View
37 main.js
@@ -0,0 +1,37 @@
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the javascript object is GCed.
var mainWindow = null;
// Quit when all windows are closed.
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit();
}
});
// This method will be called when Electron has done everything
// initialization and ready for creating browser windows.
app.on('ready', function() {
// Create the browser window.
mainWindow = new BrowserWindow({width: 800, height: 600});
// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/app/index.html');
// Open the devtools.
//mainWindow.openDevTools();
// Emitted when the window is closed.
mainWindow.on('closed', function() {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
});
View
@@ -1,6 +1,7 @@
{
"name": "Sdc",
"version": "0.1.0",
"main" : "main.js",
"private": true,
"dependencies": {},
"devDependencies": {
@@ -61,6 +62,7 @@
"org.apache.cordova.console"
],
"cordovaPlatforms": [
"ios"
"ios",
"android"
]
}

0 comments on commit fe57d6c

Please sign in to comment.