mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Rename Taglist -> RawTagEditor
This commit is contained in:
+2
-2
@@ -1346,7 +1346,7 @@ div.combobox {
|
||||
|
||||
/* tag editor */
|
||||
|
||||
.inspector-inner.additional-tags {
|
||||
.raw-tag-editor {
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
|
||||
@@ -1466,7 +1466,7 @@ div.combobox {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.additional-tags .tag-reference-body {
|
||||
.raw-tag-editor .tag-reference-body {
|
||||
border-bottom: 1px solid #ccc;
|
||||
float: left;
|
||||
width: 100%;
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@
|
||||
<script src='js/id/ui/toggle.js'></script>
|
||||
<script src='js/id/ui/undo_redo.js'></script>
|
||||
<script src='js/id/ui/zoom.js'></script>
|
||||
<script src='js/id/ui/taglist.js'></script>
|
||||
<script src='js/id/ui/raw_tag_editor.js'></script>
|
||||
<script src='js/id/ui/preset_list.js'></script>
|
||||
<script src='js/id/ui/entity_editor.js'></script>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ iD.ui.EntityEditor = function(context, entity) {
|
||||
preset,
|
||||
selection_,
|
||||
presetUI,
|
||||
tagList;
|
||||
rawTagEditor;
|
||||
|
||||
function update() {
|
||||
var entity = context.hasEntity(id);
|
||||
@@ -22,7 +22,7 @@ iD.ui.EntityEditor = function(context, entity) {
|
||||
}
|
||||
|
||||
presetUI.change(tags);
|
||||
tagList.tags(tags);
|
||||
rawTagEditor.tags(tags);
|
||||
}
|
||||
|
||||
function entityEditor(selection, newpreset) {
|
||||
@@ -77,7 +77,7 @@ iD.ui.EntityEditor = function(context, entity) {
|
||||
.on('change', changeTags)
|
||||
.on('close', event.close);
|
||||
|
||||
tagList = iD.ui.Taglist(context, entity)
|
||||
rawTagEditor = iD.ui.RawTagEditor(context, entity)
|
||||
.on('change', changeTags);
|
||||
|
||||
var tageditorpreset = editorwrap.append('div')
|
||||
@@ -85,8 +85,8 @@ iD.ui.EntityEditor = function(context, entity) {
|
||||
.call(presetUI);
|
||||
|
||||
editorwrap.append('div')
|
||||
.attr('class', 'inspector-inner col12 additional-tags')
|
||||
.call(tagList, preset.id === 'other');
|
||||
.attr('class', 'inspector-inner raw-tag-editor col12')
|
||||
.call(rawTagEditor, preset.id === 'other');
|
||||
|
||||
if (!entity.isNew()) {
|
||||
var osmLink = tageditorpreset.append('div')
|
||||
@@ -102,7 +102,7 @@ iD.ui.EntityEditor = function(context, entity) {
|
||||
}
|
||||
|
||||
presetUI.change(tags);
|
||||
tagList.tags(tags);
|
||||
rawTagEditor.tags(tags);
|
||||
|
||||
changeTags();
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
iD.ui.Taglist = function(context, entity) {
|
||||
iD.ui.RawTagEditor = function(context, entity) {
|
||||
var event = d3.dispatch('change'),
|
||||
taginfo = iD.taginfo(),
|
||||
collapsebutton,
|
||||
list;
|
||||
|
||||
function taglist(selection, other) {
|
||||
function rawTagEditor(selection, other) {
|
||||
|
||||
collapsebutton = selection.append('a')
|
||||
.attr('href','#')
|
||||
.attr('class','hide-toggle')
|
||||
.text(t('inspector.all_tags'))
|
||||
.on('click', function() {
|
||||
iD.ui.Taglist.expanded = wrap.classed('hide');
|
||||
collapsebutton.classed('expanded', iD.ui.Taglist.expanded);
|
||||
wrap.call(iD.ui.Toggle(iD.ui.Taglist.expanded));
|
||||
iD.ui.RawTagEditor.expanded = wrap.classed('hide');
|
||||
collapsebutton.classed('expanded', iD.ui.RawTagEditor.expanded);
|
||||
wrap.call(iD.ui.Toggle(iD.ui.RawTagEditor.expanded));
|
||||
selection.node().parentNode.scrollTop += 200;
|
||||
})
|
||||
.classed('expanded', iD.ui.Taglist.expanded || other);
|
||||
.classed('expanded', iD.ui.RawTagEditor.expanded || other);
|
||||
|
||||
var wrap = selection.append('div')
|
||||
.classed('hide', !iD.ui.Taglist.expanded && !other);
|
||||
.classed('hide', !iD.ui.RawTagEditor.expanded && !other);
|
||||
|
||||
list = wrap.append('ul')
|
||||
.attr('class', 'tag-list');
|
||||
@@ -72,7 +72,7 @@ iD.ui.Taglist = function(context, entity) {
|
||||
|
||||
function keyChange(d) {
|
||||
d.key = this.value;
|
||||
event.change(taglist.tags());
|
||||
event.change(rawTagEditor.tags());
|
||||
}
|
||||
|
||||
row.append('div')
|
||||
@@ -88,7 +88,7 @@ iD.ui.Taglist = function(context, entity) {
|
||||
|
||||
function valueChange(d) {
|
||||
d.value = this.value;
|
||||
event.change(taglist.tags());
|
||||
event.change(rawTagEditor.tags());
|
||||
}
|
||||
|
||||
row.each(bindTypeahead);
|
||||
@@ -162,21 +162,21 @@ iD.ui.Taglist = function(context, entity) {
|
||||
}
|
||||
|
||||
function addTag() {
|
||||
var tags = taglist.tags();
|
||||
var tags = rawTagEditor.tags();
|
||||
tags[''] = '';
|
||||
drawTags(tags);
|
||||
list.selectAll('li:last-child input.key').node().focus();
|
||||
}
|
||||
|
||||
function removeTag(d) {
|
||||
var tags = taglist.tags();
|
||||
var tags = rawTagEditor.tags();
|
||||
tags[d.key] = '';
|
||||
event.change(tags);
|
||||
delete tags[d.key];
|
||||
drawTags(tags);
|
||||
}
|
||||
|
||||
taglist.tags = function(tags) {
|
||||
rawTagEditor.tags = function(tags) {
|
||||
if (!arguments.length) {
|
||||
tags = {};
|
||||
list.selectAll('li').each(function() {
|
||||
@@ -191,5 +191,5 @@ iD.ui.Taglist = function(context, entity) {
|
||||
}
|
||||
};
|
||||
|
||||
return d3.rebind(taglist, event, 'on');
|
||||
return d3.rebind(rawTagEditor, event, 'on');
|
||||
};
|
||||
+2
-2
@@ -88,7 +88,7 @@
|
||||
<script src='../js/id/ui/toggle.js'></script>
|
||||
<script src='../js/id/ui/undo_redo.js'></script>
|
||||
<script src='../js/id/ui/zoom.js'></script>
|
||||
<script src='../js/id/ui/taglist.js'></script>
|
||||
<script src='../js/id/ui/raw_tag_editor.js'></script>
|
||||
<script src='../js/id/ui/preset_list.js'></script>
|
||||
<script src='../js/id/ui/entity_editor.js'></script>
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
<script src="spec/svg/tag_classes.js"></script>
|
||||
|
||||
<script src="spec/ui/inspector.js"></script>
|
||||
<script src="spec/ui/taglist.js"></script>
|
||||
<script src="spec/ui/raw_tag_editor.js"></script>
|
||||
<script src="spec/ui/geocoder.js"></script>
|
||||
<script src="spec/ui/modal.js"></script>
|
||||
<script src="spec/ui/flash.js"></script>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<script src="spec/svg/tag_classes.js"></script>
|
||||
|
||||
<script src="spec/ui/inspector.js"></script>
|
||||
<script src="spec/ui/taglist.js"></script>
|
||||
<script src="spec/ui/raw_tag_editor.js"></script>
|
||||
<script src="spec/ui/geocoder.js"></script>
|
||||
<script src="spec/ui/modal.js"></script>
|
||||
<script src="spec/ui/flash.js"></script>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
describe('iD.ui.Taglist', function() {
|
||||
describe('iD.ui.RawTagEditor', function() {
|
||||
var taglist, element,
|
||||
tags = {highway: 'residential'},
|
||||
entity, context;
|
||||
|
||||
function render() {
|
||||
taglist = iD.ui.Taglist(context, entity);
|
||||
taglist = iD.ui.RawTagEditor(context, entity);
|
||||
element = d3.select('body')
|
||||
.append('div')
|
||||
.call(taglist);
|
||||
Reference in New Issue
Block a user