mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-30 11:49:39 +02:00
Split up all help sections and titles, assemble markdown from keys
(also incorporate some of @1ec5's copyedits, and adjust icon styles)
This commit is contained in:
+206
-63
@@ -19,79 +19,222 @@ export function uiHelp(context) {
|
||||
var key = t('help.key');
|
||||
|
||||
var docKeys = [
|
||||
['help.help.',['intro','open_data','before_start','open_source']],
|
||||
['help.overview.',['intro','features','navigation']],
|
||||
['help.editing.',['intro','multiselect','undo_redo','save','upload','backups','keyboard']],
|
||||
['help.feature_editor.',['intro','select','fields','tags']],
|
||||
['help.points.',['intro','add_point','move_point','delete_point']],
|
||||
['help.lines.',['intro','add_line','modify_line','connect_line','disconnect_line','move_line','delete_line']],
|
||||
['help.areas.',['intro','point_or_area','add_area','square_area','modify_area','delete_area']],
|
||||
['help.relations.',['intro','edit','maintain','types','multipolygons','turn_restrictions','routes','boundaries']],
|
||||
['help.imagery.',['intro','sources','offset']],
|
||||
['help.streetlevel.',['intro','using','viewer']],
|
||||
['help.gps.',['intro','using']]
|
||||
['help', [
|
||||
'welcome',
|
||||
'open_data_h',
|
||||
'open_data',
|
||||
'before_start_h',
|
||||
'before_start',
|
||||
'open_source_h',
|
||||
'open_source',
|
||||
'open_source_help'
|
||||
]],
|
||||
['overview', [
|
||||
'navigation_h',
|
||||
'navigation_drag',
|
||||
'navigation_zoom',
|
||||
'features_h',
|
||||
'features',
|
||||
'nodes_ways'
|
||||
]],
|
||||
['editing', [
|
||||
'select_h',
|
||||
'select_left_click',
|
||||
'select_right_click',
|
||||
'multiselect_h',
|
||||
'multiselect_shift_click',
|
||||
'multiselect_lasso',
|
||||
'undo_redo_h',
|
||||
'undo_redo',
|
||||
'save_h',
|
||||
'save',
|
||||
'save_validation',
|
||||
'upload_h',
|
||||
'upload',
|
||||
'backups_h',
|
||||
'backups',
|
||||
'keyboard_h',
|
||||
'keyboard'
|
||||
]],
|
||||
['feature_editor', [
|
||||
'intro',
|
||||
'definitions',
|
||||
'type_h',
|
||||
'type',
|
||||
'type_picker',
|
||||
'fields_h',
|
||||
'fields_all_fields',
|
||||
'fields_example',
|
||||
'fields_add_field',
|
||||
'tags_h',
|
||||
'tags_all_tags',
|
||||
'tags_resources'
|
||||
]],
|
||||
['points', [
|
||||
'intro',
|
||||
'add_point_h',
|
||||
'add_point',
|
||||
'add_point_finish',
|
||||
'move_point_h',
|
||||
'move_point',
|
||||
'delete_point_h',
|
||||
'delete_point',
|
||||
'delete_point_command'
|
||||
]],
|
||||
['lines', [
|
||||
'intro',
|
||||
'add_line_h',
|
||||
'add_line',
|
||||
'add_line_draw',
|
||||
'add_line_finish',
|
||||
'modify_line_h',
|
||||
'modify_line_dragnode',
|
||||
'modify_line_addnode',
|
||||
'connect_line_h',
|
||||
'connect_line',
|
||||
'connect_line_display',
|
||||
'connect_line_drag',
|
||||
'connect_line_tag',
|
||||
'disconnect_line_h',
|
||||
'disconnect_line_command',
|
||||
'move_line_h',
|
||||
'move_line_command',
|
||||
'move_line_connected',
|
||||
'delete_line_h',
|
||||
'delete_line',
|
||||
'delete_line_command'
|
||||
]],
|
||||
['areas', [
|
||||
'intro',
|
||||
'point_or_area_h',
|
||||
'point_or_area',
|
||||
'add_area_h',
|
||||
'add_area_command',
|
||||
'add_area_draw',
|
||||
'add_area_finish',
|
||||
'square_area_h',
|
||||
'square_area_command',
|
||||
'modify_area_h',
|
||||
'modify_area_dragnode',
|
||||
'modify_area_addnode',
|
||||
'delete_area_h',
|
||||
'delete_area',
|
||||
'delete_area_command'
|
||||
]],
|
||||
['relations', [
|
||||
'intro',
|
||||
'edit_relation_h',
|
||||
'edit_relation',
|
||||
'edit_relation_add',
|
||||
'edit_relation_delete',
|
||||
'maintain_relation_h',
|
||||
'maintain_relation',
|
||||
'relation_types_h',
|
||||
'multipolygon_h',
|
||||
'multipolygon',
|
||||
'multipolygon_create',
|
||||
'multipolygon_merge',
|
||||
'turn_restriction_h',
|
||||
'turn_restriction',
|
||||
'turn_restriction_field',
|
||||
'turn_restriction_editing',
|
||||
'route_h',
|
||||
'route',
|
||||
'route_add',
|
||||
'boundary_h',
|
||||
'boundary',
|
||||
'boundary_add'
|
||||
]],
|
||||
['imagery', [
|
||||
'intro',
|
||||
'choosing',
|
||||
'sources_h',
|
||||
'sources',
|
||||
'offsets_h',
|
||||
'offset',
|
||||
'offset_change'
|
||||
]],
|
||||
['streetlevel', [
|
||||
'intro',
|
||||
'using_h',
|
||||
'using',
|
||||
'photos',
|
||||
'viewer'
|
||||
]],
|
||||
['gps', [
|
||||
'intro',
|
||||
'survey',
|
||||
'using_h',
|
||||
'using',
|
||||
'tracing',
|
||||
'upload'
|
||||
]]
|
||||
];
|
||||
|
||||
var replacements = {
|
||||
more: icon('#icon-more'),
|
||||
apply: icon('#icon-apply'),
|
||||
alert: icon('#icon-alert'),
|
||||
avatar: icon('#icon-avatar'),
|
||||
forward: icon('#icon-forward'),
|
||||
backward: icon('#icon-backward'),
|
||||
fullscreen: icon('#icon-full-screen'),
|
||||
collapsescreen: icon('#icon-collapse-screen'),
|
||||
geolocate: icon('#icon-geolocate'),
|
||||
load: icon('#icon-load'),
|
||||
search: icon('#icon-search'),
|
||||
bug: icon('#icon-bug'),
|
||||
point: icon('#icon-point'),
|
||||
line: icon('#icon-line'),
|
||||
area: icon('#icon-area'),
|
||||
help: icon('#icon-help'),
|
||||
plus: icon('#icon-plus'),
|
||||
minus: icon('#icon-minus'),
|
||||
nearby: icon('#icon-nearby'),
|
||||
outlink: icon('#icon-out-link'),
|
||||
relation: icon('#icon-relation'),
|
||||
translate: icon('#icon-translate'),
|
||||
circularize: icon('#operation-circularize'),
|
||||
orthogonalize: icon('#operation-orthogonalize'),
|
||||
split: icon('#operation-split'),
|
||||
reflect_long: icon('#operation-reflect-long'),
|
||||
reflect_short: icon('#operation-reflect-short'),
|
||||
simplify: icon('#operation-simplify'),
|
||||
smooth: icon('#operation-smooth'),
|
||||
straighten: icon('#operation-straighten'),
|
||||
rotate: icon('#operation-rotate'),
|
||||
reverse: icon('#operation-reverse'),
|
||||
continue: icon('#operation-continue'),
|
||||
disconnect: icon('#operation-disconnect'),
|
||||
layers: icon('#icon-layers'),
|
||||
vertex: icon('#icon-vertex'),
|
||||
data: icon('#icon-data'),
|
||||
down: icon('#icon-down'),
|
||||
up: icon('#icon-up'),
|
||||
inspect: icon('#icon-inspect'),
|
||||
move: icon('#operation-move'),
|
||||
merge: icon('#operation-merge'),
|
||||
copy: icon('#operation-copy'),
|
||||
paste: icon('#operation-paste'),
|
||||
delete: icon('#operation-delete'),
|
||||
close: icon('#icon-close'),
|
||||
undo: icon(textDirection === 'rtl' ? '#icon-redo' : '#icon-undo'),
|
||||
redo: icon(textDirection === 'rtl' ? '#icon-undo' : '#icon-redo'),
|
||||
save: icon('#icon-save'),
|
||||
more: icon('#icon-more', 'pre-text'),
|
||||
apply: icon('#icon-apply', 'pre-text'),
|
||||
alert: icon('#icon-alert', 'pre-text'),
|
||||
avatar: icon('#icon-avatar', 'pre-text'),
|
||||
forward: icon('#icon-forward', 'pre-text'),
|
||||
backward: icon('#icon-backward', 'pre-text'),
|
||||
fullscreen: icon('#icon-full-screen', 'pre-text'),
|
||||
collapsescreen: icon('#icon-collapse-screen', 'pre-text'),
|
||||
geolocate: icon('#icon-geolocate', 'pre-text'),
|
||||
load: icon('#icon-load', 'pre-text'),
|
||||
search: icon('#icon-search', 'pre-text'),
|
||||
bug: icon('#icon-bug', 'pre-text'),
|
||||
point: icon('#icon-point', 'pre-text'),
|
||||
line: icon('#icon-line', 'pre-text'),
|
||||
area: icon('#icon-area', 'pre-text'),
|
||||
help: icon('#icon-help', 'pre-text'),
|
||||
plus: icon('#icon-plus', 'pre-text'),
|
||||
minus: icon('#icon-minus', 'pre-text'),
|
||||
nearby: icon('#icon-nearby', 'pre-text'),
|
||||
outlink: icon('#icon-out-link', 'pre-text'),
|
||||
relation: icon('#icon-relation', 'pre-text'),
|
||||
translate: icon('#icon-translate', 'pre-text'),
|
||||
circularize: icon('#operation-circularize', 'pre-text'),
|
||||
orthogonalize: icon('#operation-orthogonalize', 'pre-text'),
|
||||
split: icon('#operation-split', 'pre-text'),
|
||||
reflect_long: icon('#operation-reflect-long', 'pre-text'),
|
||||
reflect_short: icon('#operation-reflect-short', 'pre-text'),
|
||||
simplify: icon('#operation-simplify', 'pre-text'),
|
||||
smooth: icon('#operation-smooth', 'pre-text'),
|
||||
straighten: icon('#operation-straighten', 'pre-text'),
|
||||
rotate: icon('#operation-rotate', 'pre-text'),
|
||||
reverse: icon('#operation-reverse', 'pre-text'),
|
||||
continue: icon('#operation-continue', 'pre-text'),
|
||||
disconnect: icon('#operation-disconnect', 'pre-text'),
|
||||
layers: icon('#icon-layers', 'pre-text'),
|
||||
vertex: icon('#icon-vertex', 'pre-text'),
|
||||
data: icon('#icon-data', 'pre-text'),
|
||||
down: icon('#icon-down', 'pre-text'),
|
||||
up: icon('#icon-up', 'pre-text'),
|
||||
inspect: icon('#icon-inspect', 'pre-text'),
|
||||
move: icon('#operation-move', 'pre-text'),
|
||||
merge: icon('#operation-merge', 'pre-text'),
|
||||
copy: icon('#operation-copy', 'pre-text'),
|
||||
paste: icon('#operation-paste', 'pre-text'),
|
||||
delete: icon('#operation-delete', 'pre-text'),
|
||||
close: icon('#icon-close', 'pre-text'),
|
||||
undo: icon(textDirection === 'rtl' ? '#icon-redo' : '#icon-undo', 'pre-text'),
|
||||
redo: icon(textDirection === 'rtl' ? '#icon-undo' : '#icon-redo', 'pre-text'),
|
||||
save: icon('#icon-save', 'pre-text'),
|
||||
version: context.version
|
||||
};
|
||||
|
||||
// For each section, squash all the texts into a single markdown document
|
||||
var docs = docKeys.map(function(key) {
|
||||
var tkey = 'help.' + key[0];
|
||||
var title = t(tkey + '.title');
|
||||
var text = key[1].reduce(function(all, part) {
|
||||
return all + t(key[0].concat(part), replacements);
|
||||
return all + t(tkey + '.' + part, replacements) + '\n\n';
|
||||
}, '');
|
||||
|
||||
return {
|
||||
title: text.split('\n')[0].replace('#', '').trim(),
|
||||
html: marked(text.split('\n').slice(1).join('\n'))
|
||||
title: title,
|
||||
html: marked(text.trim())
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user