diff --git a/Cortex.njsproj b/Cortex.njsproj new file mode 100644 index 0000000..1113cf4 --- /dev/null +++ b/Cortex.njsproj @@ -0,0 +1,593 @@ + + + + Debug + 2.0 + {838d20aa-2805-4aff-96db-f0468b5b2eaa} + + ShowAllFiles + build\index.js + C:\Users\itsth\programming\Cortex\build + . + {3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD} + 11.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + C:\Users\itsth\programming\Cortex\node_modules\electron-prebuilt\dist\electron.exe + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + True + 0 + / + http://localhost:48022/ + False + True + http://localhost:1337 + False + + + + + + + CurrentPage + True + False + False + False + + + + + + + + + False + False + + + + + \ No newline at end of file diff --git a/app/index.html b/app/index.html index f3e6e1d..519e819 100644 --- a/app/index.html +++ b/app/index.html @@ -2,7 +2,7 @@ OCTGN Cortex - +
asdf
@@ -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'); - - - + + \ No newline at end of file diff --git a/app/index.js b/app/index.js new file mode 100644 index 0000000..07fa182 --- /dev/null +++ b/app/index.js @@ -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(); + } +}); \ No newline at end of file diff --git a/app/main.js b/app/main.js deleted file mode 100644 index 333387f..0000000 --- a/app/main.js +++ /dev/null @@ -1,19 +0,0 @@ -var app = require('app'); -var BrowserWindow = require('browser-window'); - -var mainWindow = null; - -app.on('window-all-closed', function() { - if (process.platform != 'darwin') - app.quit(); -}); - -app.on('ready', function() { - mainWindow = new BrowserWindow({width: 1024, height: 768}); - mainWindow.setMenu(null); - mainWindow.webContents.openDevTools(); - mainWindow.loadUrl('file://' + __dirname + '/index.html'); - mainWindow.on('closed', function() { - mainWindow = null; - }); -}); \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 887c5e7..34fdb36 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,10 +1,27 @@ +/// 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")); }); \ No newline at end of file diff --git a/package.json b/package.json index 80a05c5..5b5d190 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -37,6 +42,7 @@ }, "devDependencies": { "bower": "1.7.7", - "gulp-bower": "0.0.13" + "gulp-bower": "0.0.13", + "electron-prebuilt": "^0.36.0" } }