From 9c71d74ec9b9b51387e8f384f4077c5af9b94ab6 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 27 Nov 2023 21:45:24 +0100 Subject: [PATCH] WIP --- umap/static/umap/js/umap.core.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index 6631f6ad..15cc3cac 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -434,6 +434,16 @@ L.U.Keys = { } L.U.Help = L.Class.extend({ + + SHORTCUTS: { + 'Ctrl+M': L._('Draw a marker'), + 'Ctrl+L': L._('Draw a polyline'), + 'Ctrl+P': L._('Draw a polygon'), + 'Ctrl+E': L._('Toggle edit mode'), + 'Ctrl+S': L._('Save map'), + 'Ctrl+I': L._('Open import panel'), + }, + initialize: function (map) { this.map = map this.box = L.DomUtil.create( @@ -525,6 +535,10 @@ L.U.Help = L.Class.extend({ for (const id in this.map.helpMenuActions) { addAction(this.map.helpMenuActions[id]) } + const kbdList = L.DomUtil.create('div', 'kbd-list', container) + for (const [kbd, label] of Object.entries(this.SHORTCUTS)) { + L.DomUtil.add('span', '', kbdList, `${kbd} ${label}`) + } return container },