Better matching tag format for presets

This commit is contained in:
Ansis Brammanis
2013-02-01 12:58:01 -05:00
parent f9b6d508da
commit 72675dbb83
3 changed files with 1397 additions and 2810 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ iD.presetData = function() {
count = 0;
tags = data[i].tags;
if (!_.contains(data[i].type, entity.type)) continue;
for (var k = 0; k < tags.length; k++) {
if (entity.tags[tags[k].key] == tags[k].value) count++;
for (var k in tags) {
if (entity.tags[k] == tags[k]) count++;
}
if (count > maxcount) best = data[i], maxcount = count;
}
+2 -5
View File
@@ -33,12 +33,9 @@ def isfav(x):
for item in dom1.getElementsByTagName('item'):
tags = []
tags = {}
for elem in item.getElementsByTagName('key'):
tags.append({
'key': elem.getAttribute('key'),
'value': elem.getAttribute('value')
})
tags[elem.getAttribute('key')] = elem.getAttribute('value')
jitem = {
"name": item.getAttribute('name'),
+1393 -2803
View File
File diff suppressed because it is too large Load Diff