After invoking a shortcut, some dialogs required pressing `Tab`
or using the mouse until focus was moved to the primary input field.
By moving the focus automatically, users can start typing right away.
This is particularly useful in conjunction with the `Return` key for
confirming the dialog.
Test Plan:
- Press `X` to open "Export" dialog:
"Name" field has focus.
- Press `Shift+O` to open "Load track as route":
"Trackfile" is focussed, file dialog opens with `Space`.
- Check "Load no-go area" dialog.
- Check "POI name" dialog.
After opening the "delete route" dialog the primary action button gets the
current focus. So it's possible to confirm resetting the route by pressing
"Enter".
bootbox had to be updated to to achieve this (in prior versions of bootbox the
needed callback didn't exist).
see #385
- fix the grade calculation
- don't show the grade labels, as they are all over (should be normalized)
- fix the display issues by overridding the heightgraph CSS
- Heightgraph supports resizing; remove the Elevation specific
workaround which was readding the data
- resize the elevation chart on window resize and chart show
Using i18next's "nesting" and "interpolation" features should reduce the
overall number of strings to translate, as well as provide a
standardized pattern for shortcut tooltips (if applicable).
Note that this approach is still allowing for flexibility regarding
differently structured sentences in each language.
Resolves#315
Use 'Backspace' to show the dialog allowing to clear the route.
The 'Del' key could then be used in the future to possibly allow to
delete individual selected items like POIs or no-go areas.
- 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/>.
Press 'F', type a query and press 'Enter' to find places effortlessly.
Note that the button already triggers on mousedown events, even though
by convention it should react on mouseup (i.e. a regular click)
only. However, that's an issue in the external dependency, and can
be worked around for now.