Special case 'yes' values for type fields (#1876)

This commit is contained in:
John Firebaugh
2013-10-09 17:10:49 -07:00
parent d1b4e04ee4
commit b5f0ae596f
21 changed files with 47 additions and 40 deletions
+18 -18
View File
@@ -86,12 +86,12 @@
},
"aeroway": {
"key": "aeroway",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"amenity": {
"key": "amenity",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"artist": {
@@ -116,7 +116,7 @@
},
"barrier": {
"key": "barrier",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"bicycle_parking": {
@@ -131,7 +131,7 @@
},
"building": {
"key": "building",
"type": "combo",
"type": "typeCombo",
"label": "Building"
},
"building_area": {
@@ -245,7 +245,7 @@
},
"entrance": {
"key": "entrance",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"fax": {
@@ -292,12 +292,12 @@
},
"highway": {
"key": "highway",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"historic": {
"key": "historic",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"iata": {
@@ -338,7 +338,7 @@
},
"landuse": {
"key": "landuse",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"lanes": {
@@ -354,7 +354,7 @@
},
"leisure": {
"key": "leisure",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"levels": {
@@ -375,7 +375,7 @@
},
"man_made": {
"key": "man_made",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"maxspeed": {
@@ -392,7 +392,7 @@
},
"natural": {
"key": "natural",
"type": "combo",
"type": "typeCombo",
"label": "Natural"
},
"network": {
@@ -409,7 +409,7 @@
},
"office": {
"key": "office",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"oneway": {
@@ -462,17 +462,17 @@
},
"place": {
"key": "place",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"power": {
"key": "power",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"railway": {
"key": "railway",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"ref": {
@@ -549,7 +549,7 @@
},
"shop": {
"key": "shop",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"source": {
@@ -600,7 +600,7 @@
},
"tourism": {
"key": "tourism",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"towertype": {
@@ -630,7 +630,7 @@
},
"waterway": {
"key": "waterway",
"type": "combo",
"type": "typeCombo",
"label": "Type"
},
"website": {
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "aeroway",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "amenity",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "barrier",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "building",
"type": "combo",
"type": "typeCombo",
"label": "Building"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "entrance",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "highway",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "historic",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "landuse",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "leisure",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "man_made",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "natural",
"type": "combo",
"type": "typeCombo",
"label": "Natural"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "office",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "place",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "power",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "railway",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "shop",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "tourism",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"key": "waterway",
"type": "combo",
"type": "typeCombo",
"label": "Type"
}
+2 -1
View File
@@ -32,7 +32,8 @@
"radio",
"textarea",
"localized",
"wikipedia"
"wikipedia",
"typeCombo"
],
"required": true
},
+9 -3
View File
@@ -1,4 +1,5 @@
iD.ui.preset.combo = function(field) {
iD.ui.preset.combo =
iD.ui.preset.typeCombo = function(field) {
var event = d3.dispatch('change'),
input;
@@ -43,13 +44,18 @@ iD.ui.preset.combo = function(field) {
}
function change() {
var value = input.value().replace(' ', '_');
if (field.type === 'typeCombo' && !value) value = 'yes';
var t = {};
t[field.key] = input.value().replace(' ', '_') || undefined;
t[field.key] = value || undefined;
event.change(t);
}
combo.tags = function(tags) {
input.value(tags[field.key] || '');
var value = tags[field.key] || '';
if (field.type === 'typeCombo' && value === 'yes') value = '';
input.value(value);
};
combo.focus = function() {