Skip to content

Commit

Permalink
fix for remote pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Schmitt committed Aug 23, 2016
1 parent 6159901 commit aaa7b20
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.env
.npm
.publish
node_modules
bower_components
certs
Expand Down
3 changes: 3 additions & 0 deletions app/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ body, html, .content {
right: 0; }

.message {
box-sizing: content-box;
background-color: rgba(255, 255, 255, 0.9);
color: #436a6b;
max-width: 350px;
Expand All @@ -111,6 +112,8 @@ body, html, .content {
z-index: 2000; }
.message .data {
line-height: 100%; }
.message .close {
top: 10px; }

.inventory {
box-sizing: content-box;
Expand Down
5 changes: 5 additions & 0 deletions app/assets/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ body, html, .content {
}

.message {
box-sizing: content-box;
background-color: rgba(255,255,255,0.9);
color: #436a6b;
max-width: 350px;
Expand All @@ -103,6 +104,10 @@ body, html, .content {
.data {
line-height: 100%;
}

.close {
top: 10px;
}
}

.inventory {
Expand Down
7 changes: 6 additions & 1 deletion app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ let mainWindow
function createWindow () {
mainWindow = new BrowserWindow({width: 1200, height: 900})

mainWindow.loadURL(`file://${__dirname}/index.html`);
if (process.argv.indexOf("--local") >= 0) {
console.log("Using local version.");
mainWindow.loadURL(`file://${__dirname}/index.html`);
} else {
mainWindow.loadURL(`http://necrovisualizer.nicontoso.eu`);
}

mainWindow.on('closed', function () {
mainWindow = null
Expand Down
9 changes: 8 additions & 1 deletion app/scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@

var configfile = path.join(remote.app.getPath("userData"), "settings.json");

const { version } = require("./package.json");
$.ajax({
url: `package.json`,
async: false,
success: (result) => {
result = (typeof result == "string" ? JSON.parse(result) : result);
version = "v" + result.version;
}
});

service.save = function(config) {
fs.writeFileSync(configfile, JSON.stringify(config));
Expand Down
12 changes: 7 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,34 @@ var rename = require("gulp-rename");
var concat = require("gulp-concat");
var cssnano = require("gulp-cssnano");
var sass = require('gulp-sass');
var file = require('gulp-file');
var ghPages = require('gulp-gh-pages');

// Watch

gulp.task('dev-styles', function() {
return gulp.src('src/assets/css/*.scss')
return gulp.src('app/assets/css/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest(function(f) {
return f.base;
}));
});

gulp.task('watch-styles', function() {
return gulp.watch('src/assets/css/*.scss', ['dev-styles']);
return gulp.watch('app/assets/css/*.scss', ['dev-styles']);
});

gulp.task('watch', [ 'dev-styles', 'watch-styles' ]);

// Deploy

gulp.task('deploy', ['build'], function() {
gulp.task('deploy', ['dev-styles'], function() {
return gulp.src([
'./app/**/*',
'!./app/node_modules'
'!./app/node_modules/**/*'
])
.pipe(file('CNAME', "necrovisualizer.nicontoso.eu"))
.pipe(ghPages({remoteUrl: "https://github.com/nicoschmitt/necrovisualizer"}));
.pipe(ghPages({remoteUrl: "https://github.com/nicoschmitt/necrobotvisualizer"}));
});

// Main tasks
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
"del": "^2.2.2",
"dotenv": "^2.0.0",
"electron-builder": "^5.30.0",
"electron-prebuilt": "^1.3.3",
"electron-prebuilt": "^1.3.4",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.1.2",
"gulp-file": "^0.3.0",
"gulp-gh-pages": "^0.5.4",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.3.2",
"gulp-uglify": "^2.0.0"
Expand Down

0 comments on commit aaa7b20

Please sign in to comment.