diff --git a/css/app.css b/css/app.css index d1348a0f7..06b897d74 100644 --- a/css/app.css +++ b/css/app.css @@ -912,18 +912,8 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;} .tag-wrap .grid-button-wrap .grid-entry .label { background: #eef0ff; - } - -.inspector-body .name { - padding-bottom: 0; } -.name input.major { - padding-top: 35px; - height: 70px; -} - -.inspector-body .name h4, .preset-field h4[for*="input-"] { border: 1px solid #cfcfcf; padding: 5px 10px; @@ -951,7 +941,15 @@ h4 + .preset-input input:first-child { .preset-field h4[for="input-building:levels"], .preset-field h4[for="input-ele"], .preset-field.checkselect h4 { - right: 50%;} + right: 50%; +} + +.preset-field-name h4 + input { + padding-top: 35px; + height: 70px; + font-size: 18px; + font-weight: bold; +} /* adding additional preset fields */ diff --git a/data/core.yaml b/data/core.yaml index ff65d5278..bf65bff04 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -135,10 +135,7 @@ en: no_documentation_key: There is no documentation available for this key show_more: Show More new_tag: New tag - edit_tags: Edit tags - okay: Okay view_on_osm: View on OSM - name: Name editing_feature: "Editing {feature}" additional: Additional tags choose: Select feature type diff --git a/data/locales.js b/data/locales.js index fc6a0dd2d..8dba73d28 100644 --- a/data/locales.js +++ b/data/locales.js @@ -345,6 +345,9 @@ locale.en = { "maxspeed": { "label": "Speed Limit" }, + "name": { + "label": "Name" + }, "natural": { "label": "Natural" }, diff --git a/data/presets.yaml b/data/presets.yaml index 8c4a42d36..39ac13f76 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -76,6 +76,8 @@ en: label: Type maxspeed: label: Speed Limit + name: + label: Name natural: label: Natural network: diff --git a/data/presets/fields.json b/data/presets/fields.json index 42489382c..bf31d2fe1 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -196,6 +196,11 @@ "type": "combo", "label": "Speed Limit" }, + "name": { + "key": "name", + "type": "text", + "label": "Name" + }, "natural": { "key": "natural", "type": "combo", diff --git a/data/presets/fields/name.json b/data/presets/fields/name.json new file mode 100644 index 000000000..7eee07a8e --- /dev/null +++ b/data/presets/fields/name.json @@ -0,0 +1,5 @@ +{ + "key": "name", + "type": "text", + "label": "Name" +} \ No newline at end of file diff --git a/js/id/presets.js b/js/id/presets.js index 0f43ddf31..e1a8cc97d 100644 --- a/js/id/presets.js +++ b/js/id/presets.js @@ -52,6 +52,10 @@ iD.presets = function(context) { return all; }; + all.field = function(id) { + return fields[id]; + }; + all.universal = function() { return universal; }; @@ -69,6 +73,5 @@ iD.presets = function(context) { return all; }; - return all; }; diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js index ceb73734e..7d3fb412b 100644 --- a/js/id/ui/preset.js +++ b/js/id/ui/preset.js @@ -12,10 +12,14 @@ iD.ui.preset = function(context, entity) { keys = []; formwrap = selection.append('div'); - var geometry = entity.geometry(context.graph()); - draw(formwrap, preset.fields.filter(function(f) { - return f.matchGeometry(geometry); - })); + var geometry = entity.geometry(context.graph()), + fields = preset.fields.filter(function(f) { + return f.matchGeometry(geometry); + }); + + fields.unshift(context.presets().field('name')); + + draw(formwrap, fields); var wrap = selection.append('div') .attr('class', 'col12 more-buttons inspector-inner'); diff --git a/js/id/ui/tag_editor.js b/js/id/ui/tag_editor.js index fb17db865..b9881f682 100644 --- a/js/id/ui/tag_editor.js +++ b/js/id/ui/tag_editor.js @@ -2,7 +2,6 @@ iD.ui.TagEditor = function(context, entity) { var event = d3.dispatch('changeTags', 'choose', 'close'), presets = context.presets(), tags, - name, preset, selection_, presetUI, @@ -58,21 +57,6 @@ iD.ui.TagEditor = function(context, entity) { var editorwrap = selection.append('div') .attr('class', 'tag-wrap inspector-body fillL2 inspector-body-' + geometry); - var namewrap = editorwrap.append('div') - .attr('class', 'name fillL inspector-inner col12'); - - namewrap.append('h4') - .text(t('inspector.name')); - - name = namewrap.append('input') - .attr('placeholder', 'unknown') - .attr('class', 'major') - .attr('type', 'text') - .property('value', entity.tags.name || '') - .on('blur', function() { - changeTags({ name: name.property('value') }); - }); - presetUI = iD.ui.preset(context, entity) .preset(preset) .on('change', changeTags) @@ -127,9 +111,8 @@ iD.ui.TagEditor = function(context, entity) { return tageditor(selection_, newmatch); } - name.property('value', tags.name || ''); presetUI.change(tags); - var rendered = ['name'] + var rendered = [] .concat(Object.keys(preset.tags)) .concat(presetUI.rendered()); tagList.tags(_.omit(tags, rendered));