Skip to content

Commit

Permalink
fixed warnings from jshint. temporarily removed redrawCharts test spy
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkhill committed Jan 30, 2017
1 parent 5272421 commit e3e4853
Show file tree
Hide file tree
Showing 8 changed files with 205 additions and 516 deletions.
79 changes: 11 additions & 68 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ browserify = require('browserify'),
var renderOutputDir = './javascript/phantomjs/renders';

function compile(prod, watch) {
var bundler = watchify(browserify({
var bundler = browserify({
debug: true,
entries: ['./javascript/src/lava.entry.js'],
cache: {},
packageCache: {}
}));
});

if (watch) {
var bundler = watchify(bundler);
}

if (prod) {
bundler.transform('stripify');
Expand Down Expand Up @@ -100,12 +104,12 @@ function phpServerEnd(done) {
});
}

gulp.task('default', ['build']);

gulp.task('watch', function() { return compile(false, true) });
gulp.task('build', function() { return compile(false, false) });
gulp.task('release', function() { return compile(true, false) });

gulp.task('default', ['watch']);

gulp.task('charts', function() {
getChartTypes(function (charts) {
console.log(charts);
Expand Down Expand Up @@ -141,67 +145,6 @@ gulp.task('render', function (done) {
});
});


/*
gulp.task('render', function (done) {
phpServer('renderer.php', 8081, function() {
getChartTypes(function (charts) {
renders = [];
charts.forEach(function (chart) {
var promise = Q.defer();
var renderer = renderChart(chart);
renderer.stdout.on('data', function (data) {
promise.notify('stdout: ' + data);
});
renderer.stderr.on('data', function (data) {
promise.reject('stderr: ' + data);
});
renderer.on('close', function (code) {
promise.resolve(code);
});
renders.push(promise);
/!*
renderChart(chart, function (error, stdout, stderr) {
if (error) {
deferred.reject(new Error(error));
} else {
deferred.resolve(''+stdout);
console.log(''+stdout)
}
renders.push(deferred);
});*!/
});
Q.all(renders)
.then(function (results) {
results.forEach(function (result) {
if (result.state === "fulfilled") {
console.log(result.value);
} else {
console.log(result.reason);
}
});
}).progress(function (progress) {
console.log(progress);
})
/!*.then(function () {
connect.closeServer(function() {
console.log('Finished renders.')
});
})*!/;
});
});
});
*/

gulp.task('phantom', function() {
gulp.src("./javascript/phantomjs/render.js")
.pipe(phantom({
Expand All @@ -211,9 +154,9 @@ gulp.task('phantom', function() {
});

gulp.task('jshint', function (done) {
gulp.src('./javascript/src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter(stylish));
return gulp.src('./javascript/src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});

gulp.task('bump', function (done) { //-v=1.2.3
Expand Down
8 changes: 4 additions & 4 deletions javascript/dist/lava.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions javascript/src/lava.entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
/**
* Adding the resize event listener for redrawing charts.
*/
window.addEventListener('resize', lava.redrawCharts);
window.addEventListener('resize', window.lava.redrawCharts);

/**
* Let's go!
*/
lava.init();
lava.run();
window.lava.init();
window.lava.run();
});
}.apply(window));

0 comments on commit e3e4853

Please sign in to comment.