-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c1ce8a
commit 0e11261
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
var app = require('app'), // Module to control application life. | ||
cloudcmd = require('cloudcmd'); | ||
|
||
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 atom-shell has done everything | ||
// initialization and ready for creating browser windows. | ||
app.on('ready', function() { | ||
var webContents; | ||
// Create the browser window. | ||
mainWindow = new BrowserWindow({width: 800, height: 600}), | ||
webContents = mainWindow.webContents; | ||
|
||
// and load the index.html of the app. | ||
|
||
mainWindow.loadUrl('http://localhost:31337'); | ||
|
||
webContents.on('did-finish-load', function() { | ||
webContents.executeJavaScript('window.module = undefined'); | ||
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; | ||
}); | ||
}); | ||
})(); |