diff --git a/index.html b/index.html
index 3ecb010..a456a1b 100644
--- a/index.html
+++ b/index.html
@@ -78,6 +78,8 @@
id="navbarLoadDropdown"
aria-haspopup="true"
aria-expanded="false"
+ data-i18n="[title]navbar.load.tooltip"
+ title="Load route"
>
Load
diff --git a/js/plugin/TracksLoader.js b/js/plugin/TracksLoader.js
index 440b60d..ab84422 100644
--- a/js/plugin/TracksLoader.js
+++ b/js/plugin/TracksLoader.js
@@ -22,7 +22,10 @@ BR.tracksLoader = function(map, layersControl, routing) {
},
addToMap: false,
// File size limit in kb (default: 1024) ?
- fileSizeLimit: 1024
+ fileSizeLimit: 1024,
+ shortcut: {
+ open: 79 // char code for 'o'
+ }
},
_initContainer: function() {
@@ -31,6 +34,8 @@ BR.tracksLoader = function(map, layersControl, routing) {
var fileInput;
var container = L.DomUtil.get('navbarLoadTracksContainer');
+ L.DomEvent.addListener(document, 'keydown', this._keydownListener, this);
+
// Create an invisible file input
fileInput = L.DomUtil.create('input', 'hidden', container);
fileInput.type = 'file';
@@ -62,6 +67,16 @@ BR.tracksLoader = function(map, layersControl, routing) {
var dummy = L.DomUtil.create('div');
dummy.hidden = true;
return dummy;
+ },
+
+ _keydownListener: function(e) {
+ if (BR.Util.keyboardShortcutsAllowed(e) && e.keyCode === this.options.shortcut.open) {
+ if (e.shiftKey) {
+ $('#loadNogos').modal('show');
+ } else {
+ $('#navbarLoadTracks')[0].click();
+ }
+ }
}
});
var tracksLoaderControl = new TracksLoader();
diff --git a/locales/en.json b/locales/en.json
index 8442805..cbffae6 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -149,6 +149,7 @@
"load": {
"nogos": "No-go areas",
"title": "Load",
+ "tooltip": "Load tracks (O key)\nLoad No-go areas (Shift+O)",
"tracks": "Tracks"
},
"profile": {