Commit graph

683 commits

Author SHA1 Message Date
Henrik Fehlauer
08c8cfa8be Prevent more accidental shortcut triggers
Do not allow browser keyboard shortcuts to trigger route functions,
e.g. pressing Ctrl+P triggers printing in most browsers, but should not
at the same time switch BRouter-Web to POI mode. This can be prevented
by filtering for modifiers.

In the same fashion, when modal dialogs or dropdowns are open it should
not be possible to activate map functions in the background now.

Finally, inhibit shortcuts in number input fields too, as found in the
editable number input fields in the customize profile options.
Previously only regular text input fields were protected.

To make those checks easier to use, they are deduplicated and moved to
Util.js.
2020-05-28 18:00:00 +00:00
Henrik Fehlauer
fbd3d3d383 Add missing shortcut tooltips to control buttons
Those shortcuts were already working before, but not really
discoverable for users.

To achieve a consistent UI and keep the wording in line with existing
conventions and future shortcuts (i.e. no whole sentences, shortcut in
parenthesis), the mute tooltip is changed again to occupy two lines (to
limit the width of the tooltip), to be less wordy (so it is faster to
read), to use the "mute" term (to help memorizing the M shortcut, at
least in English), and to align with the parenthesis style.
2020-05-27 18:00:00 +00:00
Henrik Fehlauer
36d8a207ab Convert all shortcuts to act on keydown already
Contrary to mouse clicks, when pressing keys on a keyboard the
standard behavior is to perform the associated action immediately,
not only when releasing the key again. This should also improve the
perceived performance slightly.

Note that the 'D' shortcut had formerly been handled by Leaflet, which
we now have to do on our own.

While at it, move the character codes over to the options variable, as
found in other parts of the codebase already.

Also removing the listener from the container does not seem needed
anymore nowadays.
2020-05-26 18:00:00 +00:00
Norbert Renner
38586faca9 Update changelog for 0.12.0 2020-06-18 20:25:56 +02:00
Norbert Renner
309f4bd33b Update leaflet-routing to bumped version commit
Yarn seems not to use latest commit, despite saying so, when version is unchanged.
2020-06-17 18:35:37 +02:00
Norbert Renner
de3d355c0c Add contact language hint to about dialog 2020-06-17 17:51:40 +02:00
Norbert Renner
ebaba664d2 Improve mobile stats (#302)
- flex-wrap instead of hard character break
- minimal margin
- add missing breakpoint for space
2020-06-17 10:39:53 +02:00
Norbert Renner
4ef43652df
Merge pull request #313 from rkflx/pr/polish-and-fix-route-quality-visuals
Polish color coding + analysis tab visuals and fix a couple of related bugs
2020-06-17 10:30:51 +02:00
Marcus Jaschen
8621c4403b add hint for the "M" keyboard shortcut to the opacity slider tooltip 2020-06-14 19:18:43 +02:00
Norbert Renner
71317b84e4 Fix analysis sorting
Return value of the sort compare function is defined as value less, equal or greater than 0, not as boolean.
2020-06-12 10:57:41 +02:00
Michael Scherer
eb0e0d6f1e
-p(ort) is needed for docker-compose run command (#309) 2020-06-08 20:12:59 +02:00
Norbert Renner
a85992d927
Merge pull request #308 from schmic/feature/docker-compose-development
add docker-compose tasks for development
2020-06-08 18:33:07 +02:00
Norbert Renner
42899beb26
Merge pull request #307 from schmic/feature/vs-code-workspace-configuration
add VS Code settings, launch and extension recommendations
2020-06-08 18:27:01 +02:00
Michael Scherer
11917dc7ee add docker-compose tasks for development 2020-06-08 15:11:56 +02:00
Michael Scherer
e161c5c40c add VS Code settings, launch and extension recommondations 2020-06-08 14:34:13 +02:00
Norbert Renner
bed388df40
Merge pull request #305 from bagage/docs/contributing
Add CONTRIBUTING.md
2020-06-08 11:38:15 +02:00
Norbert Renner
fcc902b3f9 Update en.json by i18next
i18next removed new dynamic keys under "sidebar.analysis.data" by PR #304, leaving them off for now; the rest is resorting
2020-06-08 10:58:52 +02:00
Norbert Renner
f37489cf26
Merge pull request #304 from mjaschen/feature/track-analysis
Add sidebar tab with route analysis data
2020-06-08 09:08:03 +02:00
Gautier P
db87c170be Add CONTRIBUTING.md 2020-06-07 22:59:51 +02:00
Marcus Jaschen
fc54c65e23 Add sidebar tab with route analysis data
- adds a new analysis tab in the sidebar
- the analysis tab shows length distribution for different way types, surface, and smoothness
- table rows can be hovered/clicked to highlight the according segments on the map (similar behaviour as the detailed data table)
- localization is implemented for `de` and `en`
- the method for finding segment edges was extracted from `js/control/TrackMessages.js` into `js/util/TrackEdges.js` as it's used in the new analysis class too (the Gulp config was changed to reflect that)

Notes:

I had the idea to use the *DataTable* plugin for rendering the tables but decided against it. The only meaningful way to sort such a table is by the length column and that's already the case. So it's just three plain, old HTML tables, rendered by jQuery.

For meaningful statistics the `processUnusedTags` setting has to be enabled in the routing profile. Only in this case the BRouter backend includes all needed tags (`highway`, `surface`, and `smoothness`) for *every* route segment in the response. I’ve enabled that setting for all profiles at my BRouter-web instance at <https://brouter.m11n.de/>.
2020-06-07 16:56:50 +02:00
Norbert Renner
b181649dff
Merge pull request #303 from stesie/mute-opacity
Allow to mute route display
2020-06-07 14:18:54 +02:00
Stefan Siegl
64202a451c
Allow to mute route 2020-06-06 21:47:58 +02:00
Norbert Renner
32d4a26dfd Fix nogo drawing for mobile Chrome, fixes #259 2020-06-05 20:11:36 +02:00
Norbert Renner
f197fb31be Exclude loaded tracks from URL hash 2020-06-03 20:24:17 +02:00
Norbert Renner
9fd9a52a8c Set track color yellow for CyclOSM (#297) 2020-06-02 22:09:22 +02:00
Norbert Renner
a0fe3c8824 Update translations 2020-05-28 10:54:08 +02:00
Norbert Renner
e5e876f717 Make privacy policy URL configurable (#284) 2020-05-28 10:54:08 +02:00
Norbert Renner
01e7fd7144
Merge pull request #284 from erdmark/patch-1
Privacy link relative path
2020-05-28 10:50:42 +02:00
Norbert Renner
1b66989cfb
Merge pull request #292 from tbsmark86/master
Fix: Profile params of type 'select' ignored default value from profile
2020-05-27 08:27:35 +02:00
Norbert Renner
b11c182a29 Fix route drag on mobile for Leaflet 1.6.0 (#285) 2020-05-26 12:27:32 +02:00
Gautier P
bbaad4f8b3 Hide stats footer by default and collapse elevation chart if needed 2020-05-25 20:22:49 +02:00
Gautier P
341ba4f7a5 Update translations 2020-05-25 20:22:19 +02:00
Henrik Fehlauer
8e65d6a3dd Show analysis table highlight above quality coding layer (#304)
When hovering over rows in the analysis tab, highlighted sections for
the route could only be seen on the regular route, but not when any of
the color-coded route visualisations were selected.

Patch based on a similar fix for data table in d33c795200.
2020-05-25 18:00:00 +00:00
Gautier P
8a610d1e54 Use non breakable space for stats unit separator 2020-05-25 19:24:43 +02:00
Norbert Renner
f077124f66
Merge pull request #298 from nrenner/improve-mobile-stats
Improve mobile stats
2020-05-25 18:50:09 +02:00
Gautier P
92ad30be17 Hide zoom controls on mobile 2020-05-24 21:24:14 +02:00
Henrik Fehlauer
8ca92e260d Improve analysis tab CSS
There are some ways the look of the analysis tab can be polished:
- Properly right-align the length header
  (it had extra margins required for the sorting arrows in the data tab)
- Use the same font size for table header and body (like in the data tab)
- Improve padding of the totals row (to align with the rows above)
- Add missing style for headings, so they look more balanced
  (the CSS was already there, but the wrong class was used in the HTML)
- Fine-tune vertical spacing (to help visual grouping)
- Remove unused and redundant CSS
- Do not show yellow hover effect over table header
2020-05-24 18:00:00 +00:00
Gautier P
a358aed464 Improve stats footer on mobile #296 2020-05-24 19:50:14 +02:00
Gautier P
52be57f5ba Always display 3 digits for distance title, even when ending with zeros 2020-05-24 19:23:00 +02:00
Henrik Fehlauer
9d648fc1d7 Make hotline contrast more pleasant
Colorful routes can conflict visually with colourful maps, therefore
having an outline to make the route stand out more makes sense.

However, using black results in very high contrast levels, which can
become distracting in itself. By using a dark gray, this should look
much more balanced, while still fulfilling the original purpose.
2020-05-23 18:00:00 +00:00
Henrik Fehlauer
900f925276 Improve incline coding visuals and use different colors for going uphill
Currently it is a bit difficult to guess the slope of the route for
planning purposes, since even for routes in very hilly terrain the
colors hardly change. Only extremely steep hills are indicated,
and there is no visual difference between going uphill or downhill.

By cutting off earlier, more of the route will show meaningful
differences in color. Note that BRouter's gradients are already
averaged compared to the maximum gradients shown on road signs, so 15%
should be a good compromise (anything steeper is difficult to ride on
for longer periods anyway, and rightly deserves to be colored with an
alarming red).

By using different colors for the min and max parameters, uphill and
downhill sections should now be easy to distinguish.

By introducing two more color stops, the gradient becomes much smoother,
with flat sections featuring a distinctive green, where they were drawn
in a muddy dark green before.

Note that this approach had been implemented like this in QLandkarte GT
for several years now, with great success.
2020-05-22 18:00:00 +00:00
Norbert Renner
822e49fbf0 Update jQuery to v3.5.1 to fix error expanding elev. profile & navbar 2020-05-22 10:53:46 +02:00
Tobias
3457f92fbf Fix: Profile params of type 'select' ignored default value from profile 2020-05-13 17:14:53 +02:00
Norbert Renner
e5dc5181d8 Update geocoder to official version with fix 2020-05-05 11:01:29 +02:00
Norbert Renner
a02944c0a2
Merge pull request #288 from nrenner/dependabot/npm_and_yarn/jquery-3.5.0
Bump jquery from 3.4.1 to 3.5.0
2020-04-30 18:01:47 +02:00
dependabot[bot]
b7b9941f98
Bump jquery from 3.4.1 to 3.5.0
Bumps [jquery](https://github.com/jquery/jquery) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.4.1...3.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-04-30 01:31:20 +00:00
Norbert Renner
4bd3898f4f Disable opening browser on gulp serve 2020-04-14 18:56:25 +02:00
Gautier P
23b5439159 Keep fallback values in code in case config.js is not updated with new required fields 2020-04-14 18:44:05 +02:00
Robert Sacks
e91b22ede0 Add config option for initial map position and zoom 2020-04-14 18:42:48 +02:00
erdmark
a901a10917
Privacy link relative path
The privacy link now is relative to the site that it is hosted on

When opening the about page at brouter-web the privacy link left down in the corner is a relative one to https://brouter.de/privacypolicy.html. When running an own instance I think it should link the that page, because the operator could have other terms, for example time for saving logs. So you shoud change that to a relative path to /privacypolicy.html so every operator can have another text.
You could also include a standard privacypolicy.html and put it to /brouter-web/privacypolicy.html so it can be customized if needed.
2020-04-06 16:23:45 +02:00