1
Fork 0

Initialised project (mainly with filler)

This commit is contained in:
Jake Howard 2015-11-01 19:21:54 +00:00
parent 84a884333f
commit 4d2243e6b5
4 changed files with 57 additions and 10 deletions

View file

@ -4,10 +4,13 @@
"description": "Make your computer keyboard sound like a mechanical keyboard", "description": "Make your computer keyboard sound like a mechanical keyboard",
"main": "build/main.js", "main": "build/main.js",
"scripts": { "scripts": {
"create-build-dirs": "mkdir -p build/lib build/js build/css build/img dist/ ",
"clean": "rm -rf node_modules/ dist/ build/",
"build-js": " bash scripts/build-js.sh", "build-js": " bash scripts/build-js.sh",
"start": "node_modules/.bin/electron build/", "start": "node_modules/.bin/electron .",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint -c node_modules/eslint-config/.eslintrc 'src/'" "lint": "eslint -c node_modules/eslint-config/.eslintrc 'src/'",
"build-html": "cp src/index.html build/index.html"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -2,15 +2,13 @@
set -e set -e
cp node_modules/bootstrap/dist/js/bootstrap.js static/src/js/lib/
echo ">> Building Libraries..." echo ">> Building Libraries..."
uglifyjs node_modules/jquery/dist/jquery.js --compress --screw-ie8 --define --stats --keep-fnames -o build/lib/jquery.js # uglifyjs node_modules/jquery/dist/jquery.js --compress --screw-ie8 --define --stats --keep-fnames -o build/lib/jquery.js
uglifyjs node_modules/bootstrap/dist/js/bootstrap.js --compress --screw-ie8 --define --stats --keep-fnames -o build/lib/bootstrap.js uglifyjs node_modules/bootstrap/dist/js/bootstrap.js --compress --screw-ie8 --define --stats --keep-fnames -o build/lib/bootstrap.js
echo ">> Building Application JS..." echo ">> Building Application JS..."
browserify -t reactify src/page.js -o build/page.js browserify -t reactify src/js/app.js -o build/js/app.js
uglifyjs build/js/app.js --compress --screw-ie8 --define --stats --keep-fnames -o src/js/app.js uglifyjs build/js/app.js --compress --screw-ie8 --define --stats --keep-fnames -o build/js/app.js
echo ">> Building Main JS..." echo ">> Building Main JS..."
uglifyjs build/main.js --compress --screw-ie8 --define --stats --keep-fnames -o src/main.js uglifyjs src/main.js --compress --screw-ie8 --define --stats --keep-fnames -o build/main.js

View file

@ -1 +1,14 @@
index.html <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
<script src="page.js"></script>
</body>
</html>

View file

@ -1 +1,34 @@
main.js var app = require('app');
var BrowserWindow = require('browser-window');
var Menu = require('menu');
var globalShortcut = require('global-shortcut')
var fs = require('fs');
var Tray = require('tray');
require('crash-reporter').start(); // Start crash reporter
// Creating menu
var menu = new Menu();
Menu.setApplicationMenu(menu);
var mainWindow = null;
// Make sure the application closes
app.on('window-all-closed', function () {
app.quit();
});
app.on('ready', function () {
mainWindow = new BrowserWindow({
width: 800,
height: 600
});
console.log(__dirname);
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.toggleDevTools();
mainWindow.on('closed', function() {
mainWindow = undefined;
});
});