Skip to content

Commit

Permalink
More boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
ne-sachirou committed Oct 24, 2015
1 parent be9d145 commit b87ffe4
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 30 deletions.
11 changes: 10 additions & 1 deletion .gitignore
@@ -1,4 +1,13 @@
# Created by https://www.gitignore.io/api/node
Kazinoki.json

# Created by https://www.gitignore.io/api/bower,node

### Bower ###
bower_components
.bower-cache
.bower-registry
.bower-tmp


### Node ###
# Logs
Expand Down
21 changes: 21 additions & 0 deletions bower.json
@@ -0,0 +1,21 @@
{
"name": "Kazinoki",
"main": "browser.js",
"version": "0.1.0",
"homepage": "https://github.com/ne-sachirou/Kazinoki",
"authors": [
"ne_Sachirou <utakata.c4se@gmail.com>"
],
"description": "Kazinoki",
"moduleType": [
"es6"
],
"license": "GPL-3.0+",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
1 change: 1 addition & 0 deletions index.html → browser.html
Expand Up @@ -8,5 +8,6 @@
<h1>Hello World!</h1>
We are using Node.js <script>document.write(process.version)</script>
and Electron <script>document.write(process.versions['electron'])</script>.
<script src="browser.js"></script>
</body>
</html>
Empty file added browser.js
Empty file.
3 changes: 3 additions & 0 deletions gulpfile.babel.js
@@ -0,0 +1,3 @@
var gulp = require('gulp');

gulp.task('default', () => console.log('gulpfile.babel.js'));
37 changes: 9 additions & 28 deletions index.js
@@ -1,39 +1,20 @@
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var app = require('app');
var BrowserWindow = require('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 garbage collected.
var mainWindow = null;

// Quit when all windows are closed.
app.on('window-all-closed', function() {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform != 'darwin') {
require('crash-reporter').start();

app.on('window-all-closed', () => {
if ('darwin' !== process.platform) {
app.quit();
}
});

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', function() {
// Create the browser window.
app.on('ready', () => {
mainWindow = new BrowserWindow({width: 800, height: 600});

// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/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.loadUrl('file://' + __dirname + '/browser.html');
mainWindow.on('closed', () => {
mainWindow = null;
});
});
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -18,6 +18,8 @@
},
"homepage": "https://github.com/ne-sachirou/Kazinoki#readme",
"devDependencies": {
"electron-prebuilt": "^0.34.0"
"babel-core": "^5.8.25",
"electron-prebuilt": "^0.34.0",
"gulp": "^3.9.0"
}
}

0 comments on commit b87ffe4

Please sign in to comment.