form/forms -> field/fields

This commit is contained in:
John Firebaugh
2013-03-13 11:29:04 -07:00
parent a5c4d54b9d
commit c1aa8e0270
166 changed files with 179 additions and 182 deletions
+5 -5
View File
@@ -14,11 +14,11 @@ function rp(f) {
return r('presets/' + f);
}
var forms = {};
glob.sync(__dirname + '/data/presets/forms/*.json').forEach(function(file) {
forms[path.basename(file, '.json')] = read(file);
var fields = {};
glob.sync(__dirname + '/data/presets/fields/*.json').forEach(function(file) {
fields[path.basename(file, '.json')] = read(file);
});
fs.writeFileSync('data/presets/forms.json', JSON.stringify(forms));
fs.writeFileSync('data/presets/fields.json', JSON.stringify(fields));
fs.writeFileSync('data/presets/presets.json', JSON.stringify(
glob.sync(__dirname + '/data/presets/presets/**/*.json').map(function(file) {
@@ -34,6 +34,6 @@ fs.writeFileSync('data/data.js', 'iD.data = ' + JSON.stringify({
presets: rp('presets.json'),
defaults: rp('defaults.json'),
categories: rp('categories.json'),
forms: rp('forms.json')
fields: rp('fields.json')
}
}, null, 4) + ';');
+1 -1
View File
@@ -702,7 +702,7 @@ input[type=number] {
right: 50%;
}
button.preset-add-form {
button.preset-add-field {
width: 40px;
height: 40px;
margin-right: 10px;
+2 -2
View File
@@ -12,7 +12,7 @@ iD.data = {
path + 'data/presets/presets.json',
path + 'data/presets/defaults.json',
path + 'data/presets/categories.json',
path + 'data/presets/forms.json'], d3.json, function (err, data) {
path + 'data/presets/fields.json'], d3.json, function (err, data) {
iD.data = {
deprecated: data[0],
@@ -23,7 +23,7 @@ iD.data = {
presets: data[4],
defaults: data[5],
categories: data[6],
forms: data[7]
fields: data[7]
}
};
+5 -6
View File
@@ -40,17 +40,16 @@ A basic preset is of the form:
},
// the icon in iD which represents this feature
"icon": "park",
// A form. See the forms documentation for details of what's valid here.
// Forms are arrays of form field types
"form": [
// An array of field names. See the fields documentation for details of what's valid here.
"fields": [
"address"
]
}
```
## Forms
## Fields
Forms are, like presets, defined in JSON structures. A typical form is
Fields are, like presets, defined in JSON structures. A typical field is
```js
{
@@ -59,7 +58,7 @@ Forms are, like presets, defined in JSON structures. A typical form is
}
```
In which `type` is the form's type. Valid form types are
In which `type` is the fields's type. Valid field types are
* textarea
* radio
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -11,7 +11,7 @@
"aeroway": "*"
}
},
"form": [
"fields": [
"aeroway"
]
}
+1 -1
View File
@@ -15,6 +15,6 @@
}
},
"icon": "airport",
"form": [
"fields": [
]
}
+1 -1
View File
@@ -15,6 +15,6 @@
}
},
"icon": "heliport",
"form": [
"fields": [
]
}
+1 -1
View File
@@ -9,7 +9,7 @@
"amenity": "*"
}
},
"form": [
"fields": [
"amenity"
]
}
+1 -1
View File
@@ -33,7 +33,7 @@
}
},
"icon": "bank",
"form": [
"fields": [
"atm",
"building_area",
"address"
+1 -1
View File
@@ -11,7 +11,7 @@
"terms": []
},
"icon": "bar",
"form": [
"fields": [
"building_area",
"address"
]
@@ -10,7 +10,7 @@
}
},
"icon": "bicycle",
"form": [
"fields": [
"bicycle_parking",
"capacity",
"operator"
@@ -10,7 +10,7 @@
}
},
"icon": "bicycle",
"form": [
"fields": [
"capacity",
"network",
"operator"
+1 -1
View File
@@ -15,7 +15,7 @@
}
},
"icon": "cafe",
"form": [
"fields": [
"cuisine",
"internet_access",
"building_area",
+1 -1
View File
@@ -29,7 +29,7 @@
}
},
"icon": "cinema",
"form": [
"fields": [
"building_area",
"address"
]
+1 -1
View File
@@ -11,7 +11,7 @@
"terms": []
},
"icon": "fast-food",
"form": [
"fields": [
"cuisine",
"building_area",
"address"
@@ -11,7 +11,7 @@
"terms": []
},
"icon": "fire-station",
"form": [
"fields": [
"operator",
"building_area",
"address"
+1 -1
View File
@@ -10,7 +10,7 @@
}
},
"icon": "cemetery",
"form": [
"fields": [
"religion"
]
}
+1 -1
View File
@@ -25,7 +25,7 @@
}
},
"icon": "hospital",
"form": [
"fields": [
"emergency",
"building_area",
"address"
+1 -1
View File
@@ -11,7 +11,7 @@
"terms": []
},
"icon": "library",
"form": [
"fields": [
"operator",
"building_area",
"address"
+1 -1
View File
@@ -11,7 +11,7 @@
"terms": []
},
"icon": "parking",
"form": [
"fields": [
"fee",
"access",
"address"
+1 -1
View File
@@ -11,7 +11,7 @@
"terms": []
},
"icon": "pharmacy",
"form": [
"fields": [
"operator",
"building_area",
"address"
@@ -35,7 +35,7 @@
}
},
"icon": "place-of-worship",
"form": [
"fields": [
"religion",
"denomination",
"building",
@@ -35,7 +35,7 @@
}
},
"icon": "religious-christian",
"form": [
"fields": [
"denomination",
"building",
"address"
@@ -15,7 +15,7 @@
}
},
"icon": "religious-jewish",
"form": [
"fields": [
"denomination",
"building",
"address"
@@ -15,7 +15,7 @@
}
},
"icon": "religious-muslim",
"form": [
"fields": [
"denomination",
"building",
"address"
+1 -1
View File
@@ -40,7 +40,7 @@
}
},
"icon": "police",
"form": [
"fields": [
"operator",
"building_area",
"address"
+1 -1
View File
@@ -17,7 +17,7 @@
]
},
"icon": "post",
"form": [
"fields": [
"operator",
"collection_times"
]
+1 -1
View File
@@ -11,7 +11,7 @@
"terms": []
},
"icon": "beer",
"form": [
"fields": [
"building_area",
"address"
]
+1 -1
View File
@@ -43,7 +43,7 @@
}
},
"icon": "restaurant",
"form": [
"fields": [
"cuisine",
"building_area",
"address"
+1 -1
View File
@@ -28,7 +28,7 @@
}
},
"icon": "school",
"form": [
"fields": [
"operator",
"building",
"address"
+1 -1
View File
@@ -11,7 +11,7 @@
"amenity": "toilets"
}
},
"form": [
"fields": [
"operator",
"building"
]
+1 -1
View File
@@ -17,7 +17,7 @@
}
},
"icon": "town-hall",
"form": [
"fields": [
"building_area",
"address"
]
+1 -1
View File
@@ -11,7 +11,7 @@
"terms": []
},
"icon": "college",
"form": [
"fields": [
"operator",
"address"
]
+1 -1
View File
@@ -10,7 +10,7 @@
"terms": []
},
"icon": "warehouse",
"form": [
"fields": [
"building_yes",
"levels"
],
+1 -1
View File
@@ -11,7 +11,7 @@
"highway": "*"
}
},
"form": [
"fields": [
"highway"
]
}
+1 -1
View File
@@ -10,7 +10,7 @@
"terms": []
},
"icon": "bus",
"form": [
"fields": [
"operator",
"shelter"
]
+1 -1
View File
@@ -12,7 +12,7 @@
"zebra crossing"
]
},
"form": [
"fields": [
"crossing"
]
}
+1 -1
View File
@@ -10,7 +10,7 @@
"terms": []
},
"icon": "highway-cycleway",
"form": [
"fields": [
"oneway",
"roadtype",
"access",
+1 -1
View File
@@ -35,7 +35,7 @@
}
},
"icon": "highway-footway",
"form": [
"fields": [
"access",
"surface"
]
+1 -1
View File
@@ -10,7 +10,7 @@
"terms": []
},
"icon": "highway-motorway",
"form": [
"fields": [
"oneway",
"roadtype",
"access",
+1 -1
View File
@@ -10,7 +10,7 @@
"terms": []
},
"icon": "highway-footway",
"form": [
"fields": [
"oneway",
"roadtype",
"access",
+1 -1
View File
@@ -10,7 +10,7 @@
"terms": []
},
"icon": "highway-primary",
"form": [
"fields": [
"oneway",
"roadtype",
"access",
@@ -10,7 +10,7 @@
"terms": []
},
"icon": "highway-residential",
"form": [
"fields": [
"oneway",
"roadtype",
"access",

Some files were not shown because too many files have changed in this diff Show More