Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more keyboard shortcuts and fix various shortcut related issues #314

Merged
merged 20 commits into from
Jun 19, 2020
Merged

Add more keyboard shortcuts and fix various shortcut related issues #314

merged 20 commits into from
Jun 19, 2020

Commits on May 26, 2020

  1. 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.
    rkflx committed May 26, 2020
    Configuration menu
    Copy the full SHA
    36d8a20 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2020

  1. 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.
    rkflx committed May 27, 2020
    Configuration menu
    Copy the full SHA
    fbd3d3d View commit details
    Browse the repository at this point in the history

Commits on May 28, 2020

  1. 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.
    rkflx committed May 28, 2020
    Configuration menu
    Copy the full SHA
    08c8cfa View commit details
    Browse the repository at this point in the history

Commits on May 29, 2020

  1. Fix mute shortcut not working for color coded routes

    The mute shortcut would only work for regular routes before.
    
    Note that no-go areas, POIs and tracks continue to be unaffected
    by muting, so e.g. peeking at a track below the route is still possible.
    rkflx committed May 29, 2020
    Configuration menu
    Copy the full SHA
    d6c648d View commit details
    Browse the repository at this point in the history

Commits on May 30, 2020

  1. Add shortcut to toggle color coding button

    Press 'C' repeatedly to switch between the various color coding options.
    When the last one is reached, we show the regular route again.
    rkflx committed May 30, 2020
    Configuration menu
    Copy the full SHA
    8e78c85 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2020

  1. Add shortcut to trigger geolocation

    Press 'L' to initiate the "Show me where I am" function.
    rkflx committed May 31, 2020
    Configuration menu
    Copy the full SHA
    fd97019 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2020

  1. Allow translation of the search field placeholder text

    It was not translated before, since the string was coming from an
    external dependency.
    rkflx committed Jun 1, 2020
    Configuration menu
    Copy the full SHA
    f23e375 View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2020

  1. Add shortcut for geocoder search field

    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.
    rkflx committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    37ab053 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2020

  1. Add shortcut to reverse route

    Press 'R' to swap start and end of the route.
    rkflx committed Jun 3, 2020
    Configuration menu
    Copy the full SHA
    2848e4d View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2020

  1. Add shortcut to create no-go areas

    Press 'N' to initiate drawing a no-go area. 'Escape' will cancel,
    similar to how drawing a route works.
    rkflx committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    a852acb View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2020

  1. Add shortcut to delete last point

    Press 'Z' to undo adding the last point.
    rkflx committed Jun 5, 2020
    Configuration menu
    Copy the full SHA
    48f8fe3 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2020

  1. Stop deleting points once there are no more points left

    Prevents "Uncaught TypeError: Cannot read property 'off' of null"
    in L.Routing.js
    rkflx committed Jun 6, 2020
    Configuration menu
    Copy the full SHA
    2953091 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2020

  1. Add shortcut for clear route dialog

    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.
    rkflx committed Jun 7, 2020
    Configuration menu
    Copy the full SHA
    e4e1c8a View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2020

  1. Add shortcut to toggle Strava layer

    Press 'S' to show the Strava buttons (if the API key has been set) as
    well as the Strava segments layer (once it has been fetched).
    
    Note that fetching and updating data from Strava still needs to be
    triggered manually by clicking the respective biking or running button.
    rkflx committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    ba0bb39 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2020

  1. Add shortcut to toggle profile switcher

    Press 'G' to open the profile switcher, select a profile with the arrow
    keys, apply with 'Enter' and close the switcher with 'Escape'.
    
    While 'T' and 'P' will be / were already taken, 'G' is at least easily
    reachable with the left hand for users using a mouse with their right
    hand at the same time.
    
    Since Bootstrap keeps updating the tooltip when changing options in the
    dropdown (which is useful in case the text is longer than the width of
    the control), the shortcut text needs to be applied dynamically too.
    rkflx committed Jun 9, 2020
    Configuration menu
    Copy the full SHA
    6da520e View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2020

  1. Add shortcut to export route

    Press 'X' to trigger the export route dialog.
    
    Automatically populating the trackname field should work too.
    rkflx committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    a420ad5 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2020

  1. Add shortcuts to load tracks and no-go areas

    Press 'O' or 'Shift+O' to open/load tracks or no-go areas respectively.
    rkflx committed Jun 11, 2020
    Configuration menu
    Copy the full SHA
    d106552 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2020

  1. Add shortcut to show about dialog

    Press 'H' to get to the helpful about dialog.
    rkflx committed Jun 12, 2020
    Configuration menu
    Copy the full SHA
    e56d213 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2020

  1. Add shortcuts to toggle sidebar and switch tabs

    The 'T' key will show/hide the most recent sidebar tab.
    
    Pressing 'Shift+T' will switch to the next sidebar tab, possibly
    wrapping around to the first tab.
    
    If the Itinerary tab is hidden, it will be skipped.
    rkflx committed Jun 13, 2020
    Configuration menu
    Copy the full SHA
    844a903 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2020

  1. Add shortcut to toggle elevation chart

    Press 'E' to show/hide the elevation chart.
    rkflx committed Jun 14, 2020
    Configuration menu
    Copy the full SHA
    b8b1e43 View commit details
    Browse the repository at this point in the history