This commit is contained in:
Kushan Joshi
2017-02-08 17:28:16 +05:30
committed by Bryan Housel
parent ccc438527f
commit 5e8ad595b0
3 changed files with 167 additions and 99 deletions

View File

@@ -1016,3 +1016,29 @@ en:
help: "You're now ready to edit OpenStreetMap!{br}You can replay this walkthrough anytime or view more documentation by clicking the {button} Help button."
save: "Don't forget to regularly save your changes!"
start: "Start mapping!"
shortcuts:
display:
desc: "Changing the display"
shortcuts:
pan_map: "Pan map"
pan_map_screen: "Pan map by one screenful"
zoom: "Zoom in / Zoom out"
zoom_large: "Zoom in / Zoom out by a lot"
bg_switcher: "Display background layer switcher"
bg: "Switch between previous and current backgrounds"
wireframe: "Toggle wireframe mode"
help: "Show in-editor help/documentation"
minimap: "Toggle minimap"
infobox: "Toggle info/measurements box"
radial_menu: "Toggle radial menu for currently selected object"
edit:
desc: "Editing mode"
shortcuts:
add_point: "Switch to 'add point' mode"
add_line: "Switch to 'add line' mode"
add_area: "Switch to 'add area' mode"
continue_line: "Continue drawing a line at the selected node"
stop_line: "Stop drawing of a line or area"
undo: "Undo last action"
redo: "Redo last action"
save: "Save changes"

View File

@@ -1,95 +1,137 @@
{
"dataShortcuts": [
{
"desc": "Changing the display",
"shortcuts": [
{
"keys": ["↓", "↑", "←", "→"],
"desc": "Pan map"
},
{
"keys": ["⇧↓", "⇧↑", "⇧←", "⇧→"],
"desc": "Pan map by one screenful"
},
{
"keys": ["+", "-"],
"desc": "Zoom in / Zoom out"
},
{
"keys": ["⌘+", "⌘-"],
"desc": "Zoom in / Zoom out by a lot"
},
{
"keys": ["B"],
"desc": "Display background layer switcher"
},
{
"keys": ["⌘B"],
"desc": "Switch between previous and current backgrounds"
},
{
"keys": ["W"],
"desc": "Toggle wireframe mode"
},
{
"keys": ["H"],
"desc": "Show in-editor help/documentation"
},
{
"keys": ["/"],
"desc": "Toggle minimap"
},
{
"keys": ["⌘I"],
"desc": "Toggle info/measurements box"
},
{
"keys": ["Spacebar"],
"desc": "Toggle radial menu for currently selected object"
}
]
},
{
"desc": "Editing mode",
"shortcuts": [
{
"keys": ["1"],
"desc": "Switch to 'add point' mode"
},
{
"keys": ["2"],
"desc": "Switch to 'add line' mode"
},
{
"keys": ["3"],
"desc": "Switch to 'add area' mode"
},
{
"keys": ["A"],
"desc": "Continue drawing a line at the selected node"
},
{
"keys": ["↵ Enter", "Esc"],
"desc": "Stop drawing of a line or area"
}
]
},
{
"desc": "Undoing or saving changes",
"shortcuts": [
{
"keys": ["⌘Z"],
"desc": "Undo last action"
},
{
"keys": ["⌘⇧Z"],
"desc": "Redo last action"
},
{
"keys": ["⌘S"],
"desc": "Save changes"
}
]
}
]
}
[
{
"key": "display",
"desc": "Changing the display",
"shortcuts": [
{
"shortcut": [
"↓",
"↑",
"←",
"→"
],
"key": "pan_map"
},
{
"shortcut": [
"⇧↓",
"⇧↑",
"⇧←",
"⇧→"
],
"key": "pan_map_screen"
},
{
"shortcut": [
"+",
"-"
],
"key": "zoom"
},
{
"shortcut": [
"⌘+",
"⌘-"
],
"key": "zoom_large"
},
{
"shortcut": [
"B"
],
"key": "bg_switcher"
},
{
"shortcut": [
"⌘B"
],
"key": "bg"
},
{
"shortcut": [
"W"
],
"key": "wireframe"
},
{
"shortcut": [
"H"
],
"key": "help"
},
{
"shortcut": [
"/"
],
"key": "minimap"
},
{
"shortcut": [
"⌘I"
],
"key": "infobox"
},
{
"shortcut": [
"Spacebar"
],
"key": "radial_menu"
}
]
},
{
"key": "edit",
"desc": "Editing mode",
"shortcuts": [
{
"shortcut": [
"1"
],
"key": "add_point"
},
{
"shortcut": [
"2"
],
"desc": "add_line"
},
{
"shortcut": [
"3"
],
"key": "add_area"
},
{
"shortcut": [
"A"
],
"key": "continue_line"
},
{
"shortcut": [
"↵ Enter",
"Esc"
],
"key": "stop_line"
},
{
"shortcut": [
"⌘Z"
],
"key": "undo"
},
{
"shortcut": [
"⌘⇧Z"
],
"key": "redo"
},
{
"shortcut": [
"⌘S"
],
"save": "save"
}
]
}
]

View File

@@ -2,7 +2,7 @@ import * as d3 from 'd3';
import { uiCmd } from './cmd';
import { uiModal } from './modal';
import { d3keybinding } from '../lib/d3.keybinding.js';
import { dataShortcuts } from '../../data/shortcuts.json';
import shortcuts from '../../data/shortcuts.json';
export function uiShortcuts(context) {
var key = uiCmd('⇧/');
@@ -29,7 +29,7 @@ export function uiShortcuts(context) {
var section = shortcutsModal
.selectAll('section')
.data(dataShortcuts)
.data(shortcuts)
.enter().append('section')
.attr('class', 'modal-section modal-shortcuts cf');
@@ -48,14 +48,14 @@ export function uiShortcuts(context) {
shortcuts
.selectAll('kbd')
.data(function(d) { return d.keys; })
.data(function(d) { return d.shortcut; })
.enter().append('kbd')
.text(function(d) { return uiCmd(d); });
var description = p
.append('span')
.attr('class', 'col8')
.text(function(d) { return d.desc; });
.text(function(d) { return t('shortcuts.' });
}
var keybinding = d3keybinding('shortcuts')