mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-28 02:42:36 +02:00
Better matching tag format for presets
This commit is contained in:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user