diff --git a/.prettierignore b/.prettierignore index cc6dedb..8228df2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ LICENSE +Dockerfile dist/ *.zip yarn.lock @@ -10,8 +11,7 @@ yarn.lock layers/ locales/*.json resources/boundaries/ -*.sh +resources/standalone/*.sh profiles2/ -Dockerfile tests/**/*.json tests/**/*.gpx diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ec7de6..3de89b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # BRouter-Web Changelog +## 0.16.0 (2021-03-30) + +### New Features + +- Locations (POIs) layers powered by Overpass API available in optional layers (under "More") and as custom query in "Custom layers" - by [@stesie](https://github.com/stesie) ([#106](https://github.com/nrenner/brouter-web/issues/106), [#384](https://github.com/nrenner/brouter-web/pull/384)) +- Message informs about new versions since last visit, "What's new?" button in "About" - by [@bagage](https://github.com/bagage) ([#372](https://github.com/nrenner/brouter-web/pull/372)) + +### Improvements + +- Confirm "Delete Route" with Enter key (after opening "Clear" dialog with Backspace key) - by [@mjaschen](https://github.com/mjaschen) ([#385](https://github.com/nrenner/brouter-web/issues/385)) +- Improve mobile responsivity (full screen dialogs and more) - by [@bagage](https://github.com/bagage) ([#296](https://github.com/nrenner/brouter-web/issues/296)) +- Gray out unselectable layers below minimum zoom - by [@bagage](https://github.com/bagage) ([#381](https://github.com/nrenner/brouter-web/pull/381)) +- Add message if no elevation data is available - by [@bagage](https://github.com/bagage) ([#365](https://github.com/nrenner/brouter-web/issues/365)) +- Size limit for loading a track increased to 10 MiB ([dd34064](https://github.com/nrenner/brouter-web/commit/dd34064e8c09f1bc6b11e2e14e1bb83d41a61ed9)) +- Update France Go area to 10km - by [@bagage](https://github.com/bagage) ([1c13587](https://github.com/nrenner/brouter-web/commit/1c135879746f670b1a854fcbe55ab5dabacfa0a9)) + +### Bugfixes + +- Flickering search field on Firefox @ Android - by [@mjaschen](https://github.com/mjaschen) ([#393](https://github.com/nrenner/brouter-web/issues/393)) +- Custom layers table width and type translations added - by [@bagage](https://github.com/bagage) ([#379](https://github.com/nrenner/brouter-web/pull/379)) + +### Local installation / development + +- New config entries `overpassBaseUrl` and `trackSizeLimit` ([config.template.js](https://github.com/nrenner/brouter-web/blob/a2717ac10298f5e9689b420a0af0eb310eababd3/config.template.js#L131-L134)) + ## 0.15.1 (2021-01-25) ### Improvements [de, fr] diff --git a/README.md b/README.md index 269d120..a04fd0c 100644 --- a/README.md +++ b/README.md @@ -134,3 +134,9 @@ Copyright (c) 2018 Norbert Renner and [contributors](https://github.com/nrenner/ Copyright (c) 2015, Mapbox All rights reserved; [BSD-2-Clause License](https://github.com/mapbox/tokml/blob/master/LICENSE.md) - [Jest](https://github.com/facebook/jest) Copyright (c) Facebook, Inc. and its affiliates; [MIT License](https://github.com/facebook/jest/blob/master/LICENSE) +- [overpass-layer](https://github.com/plepe/overpass-layer) + Copyright (c) 2020 Stephan Bösch-Plepelits; [MIT License](https://github.com/plepe/overpass-layer/blob/master/LICENSE) +- [maki](https://github.com/mapbox/maki) + [CC0-1.0 License](https://github.com/mapbox/maki/blob/master/LICENSE.txt) +- [temaki](https://github.com/ideditor/temaki) + [CC0-1.0 License](https://github.com/ideditor/temaki/blob/main/LICENSE.md) diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..98814cd --- /dev/null +++ b/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [['@babel/preset-env', {}]], + sourceType: 'script', + exclude: [/node_modules\/(?!overpass-layer\/).*/], +}; diff --git a/babel.config.json b/babel.config.json deleted file mode 100644 index ff0cf28..0000000 --- a/babel.config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "presets": [["@babel/preset-env", {}]], - "sourceType": "script", - "exclude": ["node_modules/**"] -} diff --git a/config.template.js b/config.template.js index 4604bf0..09a97e6 100644 --- a/config.template.js +++ b/config.template.js @@ -127,4 +127,9 @@ // regex needs to be in sync with server, see ServerHandler.getTrackName() BR.conf.tracknameAllowedChars = 'a-zA-Z0-9 \\._\\-'; + + BR.conf.overpassBaseUrl = 'https://overpass.kumi.systems/api/interpreter'; + + // File size limit in kb for loading tracks + BR.conf.trackSizeLimit = 1024 * 10; })(); diff --git a/css/style.css b/css/style.css index 2dbf8c2..de47a03 100644 --- a/css/style.css +++ b/css/style.css @@ -45,6 +45,37 @@ table.dataTable { flex: auto; } +/* reduce title font size in overpass popups */ +.leaflet-popup-content h1 { + font-size: 1.2rem; +} + +.overpass-tags th { + vertical-align: top; +} + +.overpass-layer-icon .sign > * { + position: absolute; + top: -34px; + margin: auto; + display: inline-block; + font-size: 11px; +} + +.overpass-layer-icon .icon-white { + color: white; +} + +.overpass-layer-icon .icon-invert { + -webkit-filter: invert(1); + filter: invert(1); +} + +.jstree-themeicon-custom { + background-size: 11px !important; + width: 15px !important; +} + /* wrap toolbar controls */ .leaflet-top.leaflet-left { bottom: 0; @@ -215,11 +246,14 @@ input#trackname:focus:invalid { /* map click/drag selects text in controls in Firefox because of display flex */ -moz-user-select: none; } -.leaflet-control-container, -#message .alert { +.leaflet-control-container { -moz-user-select: text; } -#message { +#notification_jar .alert { + -moz-user-select: text; + margin-bottom: 10px; +} +#notification_jar { position: absolute; margin: 10px 46px; /* 10 + 26 + 10 */ z-index: 3001; @@ -242,10 +276,6 @@ input#trackname:focus:invalid { display: flex; } -#profile_buttons { - padding-top: 4px; -} - /* track messages (data tab) */ #tab_data, .CodeMirror { @@ -438,6 +468,19 @@ button.btn { margin: -6px 0 6px 20px; } +/* "What's new?" (Change Log) */ +#whatsnew h2 { + margin: 2rem 0; + border-bottom: 1px solid #dee2e6; + padding-bottom: 0.5rem; + font-size: 1.3rem; +} + +#whatsnew h3 { + margin-bottom: 1rem; + font-size: 1.1rem; +} + /* * DataTables */ @@ -783,3 +826,141 @@ table.dataTable.display tbody tr:hover.selected { 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; + } +} diff --git a/gulpfile.js b/gulpfile.js index 3888315..5c56204 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -81,6 +81,7 @@ var paths = { .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)), + changelog: 'CHANGELOG.md', locales: 'locales/*.json', layers: 'layers/**/*.geojson', layersDestName: 'layers.js', @@ -189,7 +190,8 @@ gulp.task('boundaries', function () { }); gulp.task('changelog', function (cb) { - var content = 'BR.changelog = `' + marked(fs.readFileSync('./CHANGELOG.md', 'utf-8')) + '`'; + var content = 'BR.changelog = `' + marked(fs.readFileSync(paths.changelog, 'utf-8')) + '`'; + content = content.replace(/