Skip to content

Commit

Permalink
upgrade to gulp 4
Browse files Browse the repository at this point in the history
  • Loading branch information
dabeng committed Aug 17, 2019
1 parent b6010a0 commit e739f0f
Show file tree
Hide file tree
Showing 8 changed files with 9,490 additions and 4,020 deletions.
4 changes: 2 additions & 2 deletions demo/js/jquery.min.js

Large diffs are not rendered by default.

224 changes: 104 additions & 120 deletions demo/js/jspdf.min.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions dist/js/jquery.orgchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -1336,10 +1336,9 @@
},
//
removeNodes: function ($node) {
var isVerticalNode = $node.parents('.verticalNodes').length > 0 ? true : false
var $parent = isVerticalNode ? $node.parent() : $node.closest('table').parent();
var $sibs = isVerticalNode ? $parent.siblings() : $parent.parent().siblings();
if ($parent.is('td') || $parent.is('li')) {
var $parent = $node.closest('table').parent();
var $sibs = $parent.parent().siblings();
if ($parent.is('td')) {
if (this.getNodeState($node, 'siblings').exist) {
$sibs.eq(2).children('.topLine:lt(2)').remove();
$sibs.slice(0, 2).children().attr('colspan', $sibs.eq(2).children().length);
Expand Down
2 changes: 1 addition & 1 deletion dist/js/jquery.orgchart.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/jquery.orgchart.min.js.map

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ gulp.task('unit-tests', function () {
.pipe(mocha({reporter: 'spec'}));
});

gulp.task('integration-tests', ['unit-tests'], function () {
gulp.task('integration-tests', gulp.series('unit-tests', function () {
return gulp.src(['test/integration/*.js'], {read: false})
.pipe(mocha({reporter: 'spec'}));
});
}));

gulp.task('addAssets', ['integration-tests'], function () {
gulp.task('addAssets', gulp.series('integration-tests', function () {
var fontawesomeCSS = gulp.src('node_modules/font-awesome/css/font-awesome.min.css')
.pipe(gulp.dest(paths.demoCSSFolder));

Expand All @@ -61,15 +61,15 @@ gulp.task('addAssets', ['integration-tests'], function () {
.pipe(gulp.dest(paths.demoCSSFolder));

return merge(fontawesomeCSS, fontawesomeFonts, jsFiles, cssFiles);
});
}));

gulp.task('e2e-tests', ['addAssets'], function () {
gulp.task('e2e-tests', gulp.series('addAssets', function () {
return gulp.src('test/e2e/**/test.js')
.pipe(testcafe({ browsers: ['chrome:headless', 'firefox:headless'] }));
});
}));

gulp.task('cleanupJS', function() {
del([paths.distJSFolder + '/**']);
return del([paths.distJSFolder + '/**']);
});

gulp.task('eslint', function () {
Expand All @@ -78,22 +78,22 @@ gulp.task('eslint', function () {
.pipe(eslint.failOnError());
});

gulp.task('js', ['cleanupJS', 'eslint', 'e2e-tests'], function () {
gulp.task('js', gulp.series('cleanupJS', 'eslint', 'e2e-tests', function () {
return gulp.src(paths.srcJS)
.pipe(gulp.dest(paths.distJSFolder))
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(rename('jquery.orgchart.min.js'))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.distJSFolder));
});
}));

gulp.task('cleanupCSS', function() {
del([paths.distCSSFolder + '/**']);
return del([paths.distCSSFolder + '/**']);
});

gulp.task('csslint', function() {
gulp.src(paths.srcCSS)
return gulp.src(paths.srcCSS)
.pipe(csslint({
'adjoining-classes': false,
'box-sizing': false,
Expand All @@ -104,27 +104,27 @@ gulp.task('csslint', function() {
.pipe(csslint.formatter());
});

gulp.task('css', ['cleanupCSS', 'csslint'], function () {
gulp.task('css', gulp.series('cleanupCSS', 'csslint', function () {
return gulp.src(paths.srcCSS)
.pipe(gulp.dest(paths.distCSSFolder))
.pipe(cleanCSS())
.pipe(rename('jquery.orgchart.min.css'))
.pipe(gulp.dest(paths.distCSSFolder));
});
}));

gulp.task('build', ['js', 'css']);
gulp.task('build', gulp.series('js', 'css'));

gulp.task('reload', function (done) {
browserSync.reload();
done();
});

gulp.task('serve', ['build'], function () {
gulp.task('serve', gulp.series('build', function () {
browserSync.init({
server: {
baseDir: paths.demo
}
});
gulp.watch(paths.srcFiles, ['build']);
gulp.watch(paths.demoFiles, ['reload']);
});
gulp.watch(paths.srcFiles, gulp.series('build'));
gulp.watch(paths.demoFiles, gulp.series('reload'));
}));
Loading

0 comments on commit e739f0f

Please sign in to comment.