From d4582e03bf69fb822ca42bab1cc3eb0a057d283c Mon Sep 17 00:00:00 2001 From: Saman Bemel-Benrud Date: Thu, 20 Jun 2013 17:52:50 -0400 Subject: [PATCH 1/5] fix translation. --- css/app.css | 11 +---------- data/core.yaml | 3 ++- dist/locales/en.json | 3 ++- js/id/ui/entity_editor.js | 16 ++++++++++------ 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/css/app.css b/css/app.css index c1564641a..2afb3ec7a 100644 --- a/css/app.css +++ b/css/app.css @@ -944,6 +944,7 @@ a:hover .icon.out-link { background-position: -500px -14px;} .entity-editor-pane .preset-icon-wrap { border-bottom: 1px solid #ccc; padding: 20px; + height: 100px; } .entity-editor-pane .preset-icon-wrap::after { @@ -960,16 +961,6 @@ a:hover .icon.out-link { background-position: -500px -14px;} border-bottom-color: #ccc; } -.entity-editor-pane .preset-icon-wrap > button { - display: block; - height: 60px; - width: 60px; - margin: auto; - border-radius: 4px; - position: relative; - background-color: transparent; -} - .form-field { margin-bottom: 10px; width: 100%; diff --git a/data/core.yaml b/data/core.yaml index 035f7615f..fdb70da69 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -185,7 +185,8 @@ en: search: Search unknown: Unknown incomplete: - feature_list: Feature List + feature_list: Feature list + edit: edit feature background: title: Background description: Background settings diff --git a/dist/locales/en.json b/dist/locales/en.json index 5e647f930..6ac8a2fb1 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -228,7 +228,8 @@ "search": "Search", "unknown": "Unknown", "incomplete": "", - "feature_list": "Feature List" + "feature_list": "Feature list", + "edit": "edit feature" }, "background": { "title": "Background", diff --git a/js/id/ui/entity_editor.js b/js/id/ui/entity_editor.js index dd6039578..eebdbb18c 100644 --- a/js/id/ui/entity_editor.js +++ b/js/id/ui/entity_editor.js @@ -34,7 +34,7 @@ iD.ui.EntityEditor = function(context) { // Update $header.select('h3') - .text(preset.name()); + .text(t('inspector.edit')); $header.select('.preset-close') .on('click', function() { @@ -49,11 +49,15 @@ iD.ui.EntityEditor = function(context) { $enter = $body.enter().append('div') .attr('class', 'inspector-body'); - $enter.append('div') - .attr('class', 'preset-icon-wrap inspector-inner') - .append('button') - .attr('class', 'preset-reset preset-icon-button') - .call(bootstrap.tooltip() + var headerbutton = $enter.append('div') + .attr('class', 'preset-icon-wrap inspector-inner fillL') + .append('button') + .attr('class', 'preset-list-button preset-reset') + .append('div') + .attr('class', 'label') + .text(preset.name()) + + headerbutton.call(bootstrap.tooltip() .title(t('inspector.back_tooltip')) .placement('right')); From 7b46ccbb6518c585977459120764dbff5157f1c5 Mon Sep 17 00:00:00 2001 From: Saman Bemel-Benrud Date: Thu, 20 Jun 2013 17:55:54 -0400 Subject: [PATCH 2/5] minor refinements. --- data/core.yaml | 2 +- dist/locales/en.json | 2 +- js/id/ui/entity_editor.js | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index fdb70da69..1617207af 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -186,7 +186,7 @@ en: unknown: Unknown incomplete: feature_list: Feature list - edit: edit feature + edit: Edit feature background: title: Background description: Background settings diff --git a/dist/locales/en.json b/dist/locales/en.json index 6ac8a2fb1..563f91472 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -229,7 +229,7 @@ "unknown": "Unknown", "incomplete": "", "feature_list": "Feature list", - "edit": "edit feature" + "edit": "Edit feature" }, "background": { "title": "Background", diff --git a/js/id/ui/entity_editor.js b/js/id/ui/entity_editor.js index eebdbb18c..8bcd992c9 100644 --- a/js/id/ui/entity_editor.js +++ b/js/id/ui/entity_editor.js @@ -19,11 +19,6 @@ iD.ui.EntityEditor = function(context) { var $enter = $header.enter().append('div') .attr('class', 'header fillL cf'); - $enter.append('button') - .attr('class', 'fl preset-reset') - .append('span') - .attr('class', 'icon back'); - $enter.append('button') .attr('class', 'fr preset-close') .append('span') @@ -59,7 +54,7 @@ iD.ui.EntityEditor = function(context) { headerbutton.call(bootstrap.tooltip() .title(t('inspector.back_tooltip')) - .placement('right')); + .placement('bottom')); $enter.append('div') .attr('class', 'inspector-border inspector-preset'); From b277b0da7e9d06b9b8efde4449e2f2ee2ff348a3 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 20 Jun 2013 15:39:10 -0700 Subject: [PATCH 3/5] Update preset name --- js/id/ui/entity_editor.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/js/id/ui/entity_editor.js b/js/id/ui/entity_editor.js index 8bcd992c9..c6c0f9747 100644 --- a/js/id/ui/entity_editor.js +++ b/js/id/ui/entity_editor.js @@ -46,15 +46,14 @@ iD.ui.EntityEditor = function(context) { var headerbutton = $enter.append('div') .attr('class', 'preset-icon-wrap inspector-inner fillL') - .append('button') - .attr('class', 'preset-list-button preset-reset') - .append('div') - .attr('class', 'label') - .text(preset.name()) + .append('button') + .attr('class', 'preset-list-button preset-reset') + .append('div') + .attr('class', 'label'); - headerbutton.call(bootstrap.tooltip() - .title(t('inspector.back_tooltip')) - .placement('bottom')); + headerbutton.call(bootstrap.tooltip() + .title(t('inspector.back_tooltip')) + .placement('bottom')); $enter.append('div') .attr('class', 'inspector-border inspector-preset'); @@ -80,6 +79,9 @@ iD.ui.EntityEditor = function(context) { .geometry(context.geometry(id)) .preset(preset)); + $body.select('.preset-icon-wrap .label') + .text(preset.name()); + $body.select('.inspector-preset') .call(iD.ui.preset(context) .preset(preset) From c84d932c01f30a3811b48107905a22e877d0537d Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 20 Jun 2013 15:56:34 -0700 Subject: [PATCH 4/5] Tooltip --- js/id/ui/entity_editor.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/js/id/ui/entity_editor.js b/js/id/ui/entity_editor.js index c6c0f9747..39e50daeb 100644 --- a/js/id/ui/entity_editor.js +++ b/js/id/ui/entity_editor.js @@ -44,17 +44,16 @@ iD.ui.EntityEditor = function(context) { $enter = $body.enter().append('div') .attr('class', 'inspector-body'); - var headerbutton = $enter.append('div') + $enter.append('div') .attr('class', 'preset-icon-wrap inspector-inner fillL') .append('button') .attr('class', 'preset-list-button preset-reset') + .call(bootstrap.tooltip() + .title(t('inspector.back_tooltip')) + .placement('bottom')) .append('div') .attr('class', 'label'); - headerbutton.call(bootstrap.tooltip() - .title(t('inspector.back_tooltip')) - .placement('bottom')); - $enter.append('div') .attr('class', 'inspector-border inspector-preset'); From 882b134f46c1bcfc2f176d2ce295676b1c06b0dc Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 20 Jun 2013 16:14:08 -0700 Subject: [PATCH 5/5] Reference button --- css/app.css | 5 ++--- js/id/ui/entity_editor.js | 27 ++++++++++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/css/app.css b/css/app.css index 2afb3ec7a..a46452d82 100644 --- a/css/app.css +++ b/css/app.css @@ -941,13 +941,12 @@ a:hover .icon.out-link { background-position: -500px -14px;} padding: 20px; } -.entity-editor-pane .preset-icon-wrap { +.entity-editor-pane .preset-list-item { border-bottom: 1px solid #ccc; padding: 20px; - height: 100px; } -.entity-editor-pane .preset-icon-wrap::after { +.entity-editor-pane .preset-list-item::after { content: ""; position: absolute; height: 0; diff --git a/js/id/ui/entity_editor.js b/js/id/ui/entity_editor.js index 39e50daeb..89d0267f0 100644 --- a/js/id/ui/entity_editor.js +++ b/js/id/ui/entity_editor.js @@ -2,7 +2,8 @@ iD.ui.EntityEditor = function(context) { var event = d3.dispatch('choose'), state = 'select', id, - preset; + preset, + reference; var rawTagEditor = iD.ui.RawTagEditor(context) .on('change', changeTags); @@ -45,7 +46,9 @@ iD.ui.EntityEditor = function(context) { .attr('class', 'inspector-body'); $enter.append('div') - .attr('class', 'preset-icon-wrap inspector-inner fillL') + .attr('class', 'preset-list-item inspector-inner fillL') + .append('div') + .attr('class', 'preset-list-button-wrap') .append('button') .attr('class', 'preset-list-button preset-reset') .call(bootstrap.tooltip() @@ -54,6 +57,12 @@ iD.ui.EntityEditor = function(context) { .append('div') .attr('class', 'label'); + $body.select('.preset-list-button-wrap') + .call(reference.button); + + $body.select('.preset-list-item') + .call(reference.body); + $enter.append('div') .attr('class', 'inspector-border inspector-preset'); @@ -73,12 +82,12 @@ iD.ui.EntityEditor = function(context) { // Update - $body.select('.preset-icon-wrap button') + $body.select('.preset-list-item button') .call(iD.ui.PresetIcon() .geometry(context.geometry(id)) .preset(preset)); - $body.select('.preset-icon-wrap .label') + $body.select('.preset-list-item .label') .text(preset.name()); $body.select('.inspector-preset') @@ -113,7 +122,7 @@ iD.ui.EntityEditor = function(context) { function historyChanged() { var entity = context.hasEntity(id); if (!entity) return; - preset = context.presets().match(entity, context.graph()); + entityEditor.preset(context.presets().match(entity, context.graph())); entityEditor(selection); } @@ -151,13 +160,17 @@ iD.ui.EntityEditor = function(context) { entityEditor.entityID = function(_) { if (!arguments.length) return id; id = _; - preset = context.presets().match(context.entity(id), context.graph()); + entityEditor.preset(context.presets().match(context.entity(id), context.graph())); return entityEditor; }; entityEditor.preset = function(_) { if (!arguments.length) return preset; - preset = _; + if (_ !== preset) { + preset = _; + reference = iD.ui.TagReference(preset.reference()) + .showing(false); + } return entityEditor; };