Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  Update France Go area to 10km
  Update bootstrap-select dep to avoid error on mobile
  Improve modal dialogs consistency
  Rename dialog
  Make modals fullscreen on mobile
  Hide expand icon on moblie (nrenner#296)
  Gray out unselectable layers (nrenner#381)
  Update translations
  Translate overlay type and fix width computation (nrenner#379)
  Use plural form when multiple overlays are active (nrenner#378)
  Add message if no elevation data is available (nrenner#373)
  Add missing translatable content (nrenner#376)
  Remove debug code
  Update translations
  Add What's new modal (nrenner#372)
  Add Babel and core-js & regenerator polyfills (nrenner#367)
  • Loading branch information
stefankeidel committed Mar 20, 2021
2 parents 31ee24d + d3e344f commit d952378
Show file tree
Hide file tree
Showing 37 changed files with 2,595 additions and 444 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ layers/collection/extract.js
gulpfile.js
dist/brouter-web.js
dist/turf.min.js
dist/core-js-bundle.min.js
dist/regenerator-runtime.js
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": ["plugin:compat/recommended"],
"env": {
"browser": true
"browser": true,
"es2021": true
},
"settings": {
"polyfills": ["URLSearchParams", "Symbol.iterator", "Promise", "fetch", "Math", "Number", "navigator"]
"polyfills": ["URL", "Promise", "navigator", "Uint8Array", "performance", "location.hostname"]
}
}
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Copyright (c) 2018 Norbert Renner and [contributors](https://github.com/nrenner/
Copyright (c) 2017 i18next; [MIT License](https://github.com/i18next/i18next/blob/master/LICENSE)
- [Leaflet TriangleMarker](https://github.com/themeler/leaflet-triangle-marker)
Copyright (c) 2018 Przemysław Melnarowicz; [MIT License](https://github.com/themeler/leaflet-triangle-marker/blob/master/LICENSE)
- [jsTree ](https://github.com/vakata/jstree)
- [jsTree](https://github.com/vakata/jstree)
Copyright (c) 2014 Ivan Bozhanov; [MIT License](https://github.com/vakata/jstree/blob/master/LICENSE-MIT)
- [Leaflet.snogylop](https://github.com/ebrelsford/leaflet.snogylop)
Copyright (c) 2014 Eric Brelsford; [MIT License](https://github.com/ebrelsford/Leaflet.snogylop/blob/master/LICENSE)
Expand All @@ -114,10 +114,6 @@ Copyright (c) 2018 Norbert Renner and [contributors](https://github.com/nrenner/
Copyright (c) 2016 Eduard <edward17>; [MIT License](https://github.com/Edward17/LayersCollection/blob/gh-pages/LICENSE.md)
- [Leaflet-providers](https://github.com/leaflet-extras/leaflet-providers)
Copyright (c) 2013 Leaflet Providers contributors All rights reserved.; [2-clause BSD License](https://github.com/leaflet-extras/leaflet-providers/blob/master/license.md)
- [Fetch polyfill](https://github.com/Github/fetch)
Copyright (c) 2014-2016 GitHub, Inc.; [MIT License](https://github.com/github/fetch/blob/master/LICENSE)
- [Promise Polyfill](https://github.com/taylorhakes/promise-polyfill)
Copyright (c) 2014 Taylor Hakes, Copyright (c) 2014 Forbes Lindesay; [MIT License](https://github.com/taylorhakes/promise-polyfill/blob/master/LICENSE)
- [Leaflet.FileLayer](https://github.com/makinacorpus/Leaflet.FileLayer)
Copyright (c) 2012 Makina Corpus; [MIT License](https://github.com/makinacorpus/Leaflet.FileLayer/blob/master/LICENSE)
- [togeojson](https://github.com/mapbox/togeojson)
Expand All @@ -127,4 +123,10 @@ Copyright (c) 2018 Norbert Renner and [contributors](https://github.com/nrenner/
- [leaflet-distance-markers](https://github.com/adoroszlai/leaflet-distance-markers)
Copyright (c) 2014- Doroszlai Attila, 2016- Phil Whitehurst; [MIT License](https://github.com/adoroszlai/leaflet-distance-markers/blob/master/LICENSE.md)
- [Leaflet.hotline](https://github.com/iosphere/Leaflet.hotline)
Copyright (c) 2015, iosphere GmbH, Jonas Coch; [Leaflet.hotline](https://github.com/iosphere/Leaflet.hotline/blob/master/LICENSE)
Copyright (c) 2015, iosphere GmbH, Jonas Coch; [3-clause BSD License](https://github.com/iosphere/Leaflet.hotline/blob/master/LICENSE)
- [Babel](https://github.com/babel/babel)
Copyright (c) 2014-present Sebastian McKenzie and other contributors; [MIT License](https://github.com/babel/babel/blob/main/LICENSE)
- [core-js](https://github.com/zloirock/core-js)
Copyright (c) 2014-2021 Denis Pushkarev; [MIT License](https://github.com/zloirock/core-js/blob/master/LICENSE)
- [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime)
Copyright (c) 2014-present, Facebook, Inc.; [MIT License](https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/LICENSE)
5 changes: 5 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [["@babel/preset-env", {}]],
"sourceType": "script",
"exclude": ["node_modules/**"]
}
161 changes: 157 additions & 4 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ input#trackname:focus:invalid {
display: flex;
}

#profile_buttons {
padding-top: 4px;
}

/* track messages (data tab) */
#tab_data,
.CodeMirror {
Expand Down Expand Up @@ -769,3 +765,160 @@ table.dataTable.display tbody tr:hover.selected {
#selectionText {
display: none;
}

.version-new::after {
font-family: FontAwesome;
content: '\f06a'; /* fa-exclamation */
margin-left: 3px;
}

#elevation-chart {
position: relative;
}

#no-elevation-data {
z-index: 1000;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

/* Gray out non selectable layers (zoom out of scope, etc.) */
.leaflet-control-layers-selector[disabled] ~ span {
color: #777;
}

/* make modals fullscreen on small devices (code from bootstrap 5) */
.modal-fullscreen {
width: 100vw;
max-width: none;
height: 100%;
margin: 0;
}
.modal-fullscreen .modal-content {
height: 100%;
border: 0;
border-radius: 0;
}
.modal-fullscreen .modal-header {
border-radius: 0;
}
.modal-fullscreen .modal-body {
overflow-y: auto;
}
.modal-fullscreen .modal-footer {
border-radius: 0;
}

@media (max-width: 575.98px) {
.modal-fullscreen-sm-down {
width: 100vw;
max-width: none;
height: 100%;
margin: 0;
}
.modal-fullscreen-sm-down .modal-content {
height: 100%;
border: 0;
border-radius: 0;
}
.modal-fullscreen-sm-down .modal-header {
border-radius: 0;
}
.modal-fullscreen-sm-down .modal-body {
overflow-y: auto;
}
.modal-fullscreen-sm-down .modal-footer {
border-radius: 0;
}
}
@media (max-width: 767.98px) {
.modal-fullscreen-md-down {
width: 100vw;
max-width: none;
height: 100%;
margin: 0;
}
.modal-fullscreen-md-down .modal-content {
height: 100%;
border: 0;
border-radius: 0;
}
.modal-fullscreen-md-down .modal-header {
border-radius: 0;
}
.modal-fullscreen-md-down .modal-body {
overflow-y: auto;
}
.modal-fullscreen-md-down .modal-footer {
border-radius: 0;
}
}
@media (max-width: 991.98px) {
.modal-fullscreen-lg-down {
width: 100vw;
max-width: none;
height: 100%;
margin: 0;
}
.modal-fullscreen-lg-down .modal-content {
height: 100%;
border: 0;
border-radius: 0;
}
.modal-fullscreen-lg-down .modal-header {
border-radius: 0;
}
.modal-fullscreen-lg-down .modal-body {
overflow-y: auto;
}
.modal-fullscreen-lg-down .modal-footer {
border-radius: 0;
}
}
@media (max-width: 1199.98px) {
.modal-fullscreen-xl-down {
width: 100vw;
max-width: none;
height: 100%;
margin: 0;
}
.modal-fullscreen-xl-down .modal-content {
height: 100%;
border: 0;
border-radius: 0;
}
.modal-fullscreen-xl-down .modal-header {
border-radius: 0;
}
.modal-fullscreen-xl-down .modal-body {
overflow-y: auto;
}
.modal-fullscreen-xl-down .modal-footer {
border-radius: 0;
}
}
@media (max-width: 1399.98px) {
.modal-fullscreen-xxl-down {
width: 100vw;
max-width: none;
height: 100%;
margin: 0;
}
.modal-fullscreen-xxl-down .modal-content {
height: 100%;
border: 0;
border-radius: 0;
}
.modal-fullscreen-xxl-down .modal-header {
border-radius: 0;
}
.modal-fullscreen-xxl-down .modal-body {
overflow-y: auto;
}
.modal-fullscreen-xxl-down .modal-footer {
border-radius: 0;
}
}
38 changes: 34 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ var jsonConcat = require('gulp-json-concat');
var rename = require('gulp-rename');
var browserSync = require('browser-sync');
var merge = require('merge-stream');
var babel = require('gulp-babel');
var marked = require('marked');
var fs = require('fs');

const server = browserSync.create();

Expand All @@ -35,7 +38,12 @@ var debug = false;
var paths = {
// see overrides in package.json
scriptsConfig: mainNpmFiles()
.filter((f) => RegExp('url-search-params/.*\\.js', 'i').test(f))
.filter(
(f) =>
RegExp('url-search-params/.*\\.js', 'i').test(f) ||
RegExp('core-js-bundle/.*\\.js', 'i').test(f) ||
RegExp('regenerator-runtime/.*\\.js', 'i').test(f)
)
.concat([
// large lib as extra file for faster parallel loading (*.min.js already excluded from bundle)
'node_modules/@turf/turf/turf.min.js',
Expand All @@ -50,11 +58,14 @@ var paths = {
(f) =>
RegExp('.*\\.js', 'i').test(f) &&
!RegExp('.*\\.min\\.js', 'i').test(f) &&
!RegExp('url-search-params/.*\\.js', 'i').test(f)
!RegExp('url-search-params/.*\\.js', 'i').test(f) &&
!RegExp('core-js-bundle/.*\\.js', 'i').test(f) &&
!RegExp('regenerator-runtime/.*\\.js', 'i').test(f)
)
)
.concat([
'js/Browser.js',
'js/WhatsNew.js',
'js/Util.js',
'js/Map.js',
'js/LayersConfig.js',
Expand Down Expand Up @@ -92,7 +103,19 @@ gulp.task('clean', function (cb) {
// libs that require loading before config.js
gulp.task('scripts_config', function () {
// just copy for now
return gulp.src(paths.scriptsConfig).pipe(gulp.dest(paths.dest));
return gulp
.src(paths.scriptsConfig)
.pipe(
rename(function (path) {
if (path.basename === 'minified') {
path.basename = 'core-js-bundle.min';
} else if (path.basename === 'runtime') {
path.basename = 'regenerator-runtime';
}
})
)
.pipe(replace('//# sourceMappingURL=minified.js.map', ''))
.pipe(gulp.dest(paths.dest));
});

gulp.task('scripts', function () {
Expand All @@ -103,6 +126,7 @@ gulp.task('scripts', function () {
.src(paths.scripts, { base: '.' })
.pipe(sourcemaps.init())
.pipe(cached('scripts'))
.pipe(gulpif(!debug, babel()))
.pipe(gulpif(!debug, uglify()))
.pipe(remember('scripts'))
.pipe(concat(paths.destName + '.js'))
Expand Down Expand Up @@ -163,6 +187,11 @@ gulp.task('boundaries', function () {
return gulp.src(paths.boundaries).pipe(gulp.dest(paths.dest + '/boundaries'));
});

gulp.task('changelog', function (cb) {
var content = 'BR.changelog = `' + marked(fs.readFileSync('./CHANGELOG.md', 'utf-8')) + '`';
fs.writeFile(paths.dest + '/changelog.js', content, cb);
});

gulp.task('reload', function (done) {
server.reload();
done();
Expand Down Expand Up @@ -329,7 +358,8 @@ gulp.task(
'images',
'fonts',
'locales',
'boundaries'
'boundaries',
'changelog'
)
);

Expand Down
Loading

0 comments on commit d952378

Please sign in to comment.