Skip to content

Commit

Permalink
Good times
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyelton committed Apr 4, 2016
1 parent bc9b0ae commit f7718eb
Show file tree
Hide file tree
Showing 6 changed files with 679 additions and 31 deletions.
593 changes: 593 additions & 0 deletions Cortex.njsproj

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>OCTGN Cortex</title>
<link rel="stylesheet" type="text/css" href="semantic/dist/semantic.min.css">
<link rel="stylesheet" type="text/css" href="css/semantic.min.css">
</head>
<body>
<div>asdf</div>
Expand All @@ -11,12 +11,10 @@
//https://facebook.github.io/react/docs/getting-started.html
//http://unicorn-ui.com/buttons/
//https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md
window.$ = window.jQuery = require('./bower_components/jquery/dist/jquery.min.js');
$(function(){
});
window.$ = window.jQuery = require('./lib/jquery.min.js');
</script>
<script src="bower_components/react/react-with-addons.min.js"></script>
<script src="bower_components/react/react-dom.min.js"></script>
<script src="semantic/dist/semantic.js"></script
<script src="lib/react-with-addons.min.js"></script>
<script src="lib/react-dom.min.js"></script>
<script src="lib/semantic.min.js"></script>
</body>
</html>
53 changes: 53 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

const electron = require('electron');
// Module to control application life.
const app = electron.app;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;

// 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() {
// Create the browser window.
mainWindow = new BrowserWindow({ width: 1024, height: 768 });

mainWindow.setMenu(null);

// and load the index.html of the app.
mainWindow.loadURL('file://' + __dirname + '/index.html');

// Open the DevTools.
mainWindow.webContents.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;
});
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', createWindow);

// 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') {
app.quit();
}
});

app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow();
}
});
19 changes: 0 additions & 19 deletions app/main.js

This file was deleted.

23 changes: 20 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
/// <binding BeforeBuild='build' />
var gulp = require('gulp');
var bower = require('gulp-bower');
var runElectron = require("gulp-run-electron");

gulp.task('default', function() {
// place code for your default task here
gulp.task("watch", function () {
return gulp.watch("app/**/*", runElectron.rerun);
});

gulp.task("build",['bower'], function () {
return gulp.src("app/**/*").pipe(gulp.dest("build"));
});

gulp.task("run", function () {
return gulp.src("build").pipe(runElectron());
});

gulp.task("default", ["watch", "build", "run"], function () {
});

gulp.task('bower', function() {
return bower();
bower();
gulp.src("semantic/dist/*.min.js").pipe(gulp.dest("build/lib"));
gulp.src("semantic/dist/*.min.css").pipe(gulp.dest("build/css"));
gulp.src("bower_components/jquery/dist/*.min.js").pipe(gulp.dest("build/lib"));
return gulp.src("bower_components/react/*.min.js").pipe(gulp.dest("build/lib"));
});
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"name": "Cortex",
"version": "0.1.0",
"main": "main.js",
"main": "app\\index.js",
"scripts": {
"start": "electron app\\index.js"
},
"dependencies": {
"better-console": "^0.2.4",
"del": "^2.2.0",
"electron-prebuilt": "^0.36.12",
"extend": "^3.0.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
Expand All @@ -26,6 +30,7 @@
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-rtlcss": "^1.0.0",
"gulp-run-electron": "^1.2.2",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"gulp-watch": "^4.3.5",
Expand All @@ -37,6 +42,7 @@
},
"devDependencies": {
"bower": "1.7.7",
"gulp-bower": "0.0.13"
"gulp-bower": "0.0.13",
"electron-prebuilt": "^0.36.0"
}
}

0 comments on commit f7718eb

Please sign in to comment.