diff --git a/.prettierrc b/.prettierrc index cd93fd9..af385bc 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, + "printWidth": 120, "tabWidth": 4 } diff --git a/css/style.css b/css/style.css index dd96a07..c0ec359 100644 --- a/css/style.css +++ b/css/style.css @@ -256,13 +256,11 @@ https://css-tricks.com/svg-line-animation-works/ width: 8px; margin-left: 1px; background-image: linear-gradient(to right, #f0f0f0 0%, #e9e9e9 100%); - box-shadow: inset -1px -0px 1px rgba(55, 55, 55, 0.3), - inset 1px 0px 1px rgba(230, 230, 230, 1); + box-shadow: inset -1px -0px 1px rgba(55, 55, 55, 0.3), inset 1px 0px 1px rgba(230, 230, 230, 1); } .slider.slider-horizontal .slider-track { background-image: linear-gradient(to bottom, #f0f0f0 0%, #e9e9e9 100%); - box-shadow: inset -0px -1px 1px rgba(55, 55, 55, 0.3), - inset 0px 1px 1px rgba(230, 230, 230, 1); + box-shadow: inset -0px -1px 1px rgba(55, 55, 55, 0.3), inset 0px 1px 1px rgba(230, 230, 230, 1); } .control-slider:hover #route .slider-track, @@ -291,8 +289,7 @@ https://css-tricks.com/svg-line-animation-works/ /* bootstrap .btn-secondary */ background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%); background-repeat: repeat-x; - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), - 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075); border: 1px solid #adadad; } @@ -467,8 +464,7 @@ table.dataTable.display tbody tr.even:hover { } .tree-code { - font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, - monospace; + font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; margin-right: 7px; color: #666; /* like root nodes, jstree-disabled */ } @@ -497,8 +493,7 @@ table.dataTable.display tbody tr.even:hover { border: 1px solid #ddd; - font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, - monospace; + font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; line-height: 1.2em; } diff --git a/gulpfile.js b/gulpfile.js index 9d853e6..f587d4b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -30,9 +30,7 @@ var debug = false; var paths = { // see overrides in package.json - scriptsConfig: mainNpmFiles().filter(f => - RegExp('url-search-params/.*\\.js', 'i').test(f) - ), + scriptsConfig: mainNpmFiles().filter(f => RegExp('url-search-params/.*\\.js', 'i').test(f)), scripts: [ 'node_modules/jquery/dist/jquery.js', 'node_modules/tether/dist/js/tether.js', @@ -58,18 +56,10 @@ var paths = { 'js/index.js' ]), styles: mainNpmFiles() - .filter( - f => - RegExp('.*\\.css', 'i').test(f) && - !RegExp('.*\\.min\\.css', 'i').test(f) - ) + .filter(f => RegExp('.*\\.css', 'i').test(f) && !RegExp('.*\\.min\\.css', 'i').test(f)) .concat('css/*.css'), - images: mainNpmFiles().filter(f => - RegExp('.*.+(png|gif|svg)', 'i').test(f) - ), - fonts: mainNpmFiles().filter(f => - RegExp('font-awesome/fonts/.*', 'i').test(f) - ), + images: mainNpmFiles().filter(f => RegExp('.*.+(png|gif|svg)', 'i').test(f)), + fonts: mainNpmFiles().filter(f => RegExp('font-awesome/fonts/.*', 'i').test(f)), locales: 'locales/*.json', layers: 'layers/**/*.geojson', layersDestName: 'layers.js', @@ -195,9 +185,7 @@ gulp.task('inject', function() { read: false }); - return target - .pipe(inject(sources, { relative: true })) - .pipe(gulp.dest('.')); + return target.pipe(inject(sources, { relative: true })).pipe(gulp.dest('.')); }); var pkg = require('./package.json'); @@ -215,9 +203,7 @@ gulp.task('release:init', function(cb) { } ghToken = gutil.env.token; if (!ghToken) { - return cb( - new Error('--token is required (github personnal access token') - ); + return cb(new Error('--token is required (github personnal access token')); } if (ghToken.length != 40) { return cb(new Error('--token length must be 40')); @@ -228,11 +214,7 @@ gulp.task('release:init', function(cb) { git.status({ args: '--porcelain', quiet: true }, function(err, stdout) { if (err) return cb(err); if (stdout.length > 0) { - return cb( - new Error( - 'Repository is not clean. Please commit or stash your pending modification' - ) - ); + return cb(new Error('Repository is not clean. Please commit or stash your pending modification')); } cb(); @@ -250,21 +232,14 @@ gulp.task('bump:json', function() { gulp.task('bump:html', function() { return gulp .src('./index.html') - .pipe( - replace( - /(.*)<\/sup>/, - '' + nextVersion + '' - ) - ) + .pipe(replace(/(.*)<\/sup>/, '' + nextVersion + '')) .pipe(gulp.dest('.')); }); gulp.task('bump', gulp.series('bump:json', 'bump:html')); gulp.task('release:commit', function() { - return gulp - .src(['./index.html', './package.json']) - .pipe(git.commit('release: ' + nextVersion)); + return gulp.src(['./index.html', './package.json']).pipe(git.commit('release: ' + nextVersion)); }); gulp.task('release:tag', function(cb) { @@ -277,12 +252,7 @@ gulp.task('release:push', function(cb) { gulp.task('i18next', function() { return gulp - .src([ - 'index.html', - 'locales/keys.js', - 'layers/config/overrides.js', - 'js/**/*.js' - ]) + .src(['index.html', 'locales/keys.js', 'layers/config/overrides.js', 'js/**/*.js']) .pipe(sort()) .pipe( scanner({ @@ -321,12 +291,7 @@ gulp.task('layers', function() { '// Licensed under the MIT License (https://github.com/nrenner/brouter-web#license + Credits and Licenses),\n' + '// except JOSM imagery database (dataSource=JOSM) is licensed under Creative Commons (CC-BY-SA),\n' + '// see https://josm.openstreetmap.de/wiki/Maps#Otherimportantinformation\n'; - return Buffer.from( - header + - 'BR.layerIndex = ' + - JSON.stringify(data, null, 2) + - ';' - ); + return Buffer.from(header + 'BR.layerIndex = ' + JSON.stringify(data, null, 2) + ';'); }) ) .pipe(gulp.dest(paths.dest)) @@ -335,17 +300,7 @@ gulp.task('layers', function() { gulp.task( 'default', - gulp.series( - 'clean', - 'scripts_config', - 'layers_config', - 'layers', - 'scripts', - 'styles', - 'images', - 'fonts', - 'locales' - ) + gulp.series('clean', 'scripts_config', 'layers_config', 'layers', 'scripts', 'styles', 'images', 'fonts', 'locales') ); gulp.task( @@ -359,12 +314,9 @@ gulp.task( gulp.task('release:zip', function() { gutil.log(gutil.colors.green('Build brouter-web.' + nextVersion + '.zip')); return gulp - .src( - ['dist/**', 'index.html', 'config.template.js', 'keys.template.js'], - { - base: '.' - } - ) + .src(['dist/**', 'index.html', 'config.template.js', 'keys.template.js'], { + base: '.' + }) .pipe(zip('brouter-web.' + nextVersion + '.zip')) .pipe(gulp.dest('.')); }); diff --git a/index.html b/index.html index 779a1c1..c2858b5 100644 --- a/index.html +++ b/index.html @@ -3,10 +3,7 @@ - + BRouter web client @@ -27,32 +24,16 @@ > - BRouter-Web 0.10.3