X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b76bfe379e6527c9cfc2ced97aa615f8c2c45dd7..f2bf38606e281290fee8273e247afc54f08a0a47:/vendor/assets/iD/iD.js?ds=sidebyside diff --git a/vendor/assets/iD/iD.js b/vendor/assets/iD/iD.js index 6a8d7a87a..c7bb96219 100644 --- a/vendor/assets/iD/iD.js +++ b/vendor/assets/iD/iD.js @@ -16151,7 +16151,7 @@ window.iD = function () { return d3.rebind(context, dispatch, 'on'); }; -iD.version = '1.3.6'; +iD.version = '1.3.7'; (function() { var detected = {}; @@ -16187,7 +16187,7 @@ iD.version = '1.3.6'; })(); iD.taginfo = function() { var taginfo = {}, - endpoint = 'http://taginfo.openstreetmap.org/api/4/', + endpoint = 'https://taginfo.openstreetmap.org/api/4/', tag_sorts = { point: 'count_nodes', vertex: 'count_nodes', @@ -16323,7 +16323,7 @@ iD.taginfo = function() { }; iD.wikipedia = function() { var wiki = {}, - endpoint = 'http://en.wikipedia.org/w/api.php?'; + endpoint = 'https://en.wikipedia.org/w/api.php?'; wiki.search = function(lang, query, callback) { lang = lang || 'en'; @@ -17702,10 +17702,14 @@ iD.actions.MergePolygon = function(ids, newRelationId) { graph = graph.remove(m); }); - members.forEach(function(m) { - var entity = graph.entity(m.id); - relation = relation.mergeTags(entity.tags); - graph = graph.replace(entity.update({ tags: {} })); + entities.closedWay.forEach(function(way) { + function isThisOuter(m) { + return m.id === way.id && m.role !== 'inner'; + } + if (members.some(isThisOuter)) { + relation = relation.mergeTags(way.tags); + graph = graph.replace(way.update({ tags: {} })); + } }); return graph.replace(relation.update({ @@ -17719,6 +17723,8 @@ iD.actions.MergePolygon = function(ids, newRelationId) { if (entities.other.length > 0 || entities.closedWay.length + entities.multipolygon.length < 2) return 'not_eligible'; + if (!entities.multipolygon.every(function(r) { return r.isComplete(graph); })) + return 'incomplete_relation'; }; return action; @@ -20567,6 +20573,9 @@ iD.operations.Merge = function(selectedIDs, context) { if (j === 'restriction' && m && p) return t('operations.merge.restriction', {relation: context.presets().item('type/restriction').name()}); + if (p === 'incomplete_relation' && j && m) + return t('operations.merge.incomplete_relation'); + if (j && m && p) return t('operations.merge.' + j); @@ -22033,7 +22042,9 @@ iD.History = function(context) { toJSON: function() { if (stack.length <= 1) return; - var allEntities = {}; + var allEntities = {}, + baseEntities = {}, + base = stack[0]; var s = stack.map(function(i) { var modified = [], deleted = []; @@ -22046,6 +22057,12 @@ iD.History = function(context) { } else { deleted.push(id); } + + // make sure that the originals of changed or deleted entities get merged + // into the base of the stack after restoring the data from JSON. + if (id in base.graph.entities) { + baseEntities[id] = base.graph.entities[id]; + } }); var x = {}; @@ -22059,8 +22076,9 @@ iD.History = function(context) { }); return JSON.stringify({ - version: 2, + version: 3, entities: _.values(allEntities), + baseEntities: _.values(baseEntities), stack: s, nextIDs: iD.Entity.id.next, index: index @@ -22073,13 +22091,22 @@ iD.History = function(context) { iD.Entity.id.next = h.nextIDs; index = h.index; - if (h.version === 2) { + if (h.version === 2 || h.version === 3) { var allEntities = {}; h.entities.forEach(function(entity) { allEntities[iD.Entity.key(entity)] = iD.Entity(entity); }); + if (h.version === 3) { + // this merges originals for changed entities into the base of + // the stack even if the current stack doesn't have them (for + // example when iD has been restarted in a different region) + var baseEntities = h.baseEntities.map(iD.Entity); + stack[0].graph.rebase(baseEntities, _.pluck(stack, 'graph')); + tree.rebase(baseEntities); + } + stack = h.stack.map(function(d) { var entities = {}, entity; @@ -22151,8 +22178,6 @@ iD.History = function(context) { var json = context.storage(getKey('saved_history')); if (json) history.fromJSON(json); - - context.storage(getKey('saved_history', null)); }, _getKey: getKey @@ -23066,7 +23091,7 @@ iD.BackgroundSource.Bing = function(data, dispatch) { var bing = iD.BackgroundSource(data), key = 'Arzdiw4nlOJzRwOz__qailc8NiR31Tt51dN2D7cm57NrnceZnCpgOkmJhNpGoppU', // Same as P2 and JOSM - url = 'http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?include=ImageryProviders&key=' + + url = 'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?include=ImageryProviders&key=' + key + '&jsonp={callback}', providers = []; @@ -23085,7 +23110,7 @@ iD.BackgroundSource.Bing = function(data, dispatch) { dispatch.change(); }); - var template = 'http://ecn.t{t}.tiles.virtualearth.net/tiles/a{u}.jpeg?g=587&mkt=en-gb&n=z', + var template = 'https://ecn.t{t}.tiles.virtualearth.net/tiles/a{u}.jpeg?g=587&mkt=en-gb&n=z', subdomains = [0, 1, 2, 3]; bing.url = function(coord) { @@ -29384,7 +29409,6 @@ iD.ui.preset.access = function(field) { }; iD.ui.preset.address = function(field, context) { var event = d3.dispatch('change'), - housename, housenumber, street, city, @@ -29482,12 +29506,6 @@ iD.ui.preset.address = function(field, context) { var enter = wrap.enter().append('div') .attr('class', 'preset-input-wrap'); - enter.append('input') - .property('type', 'text') - .attr('placeholder', field.t('placeholders.housename')) - .attr('class', 'addr-housename') - .attr('id', 'preset-input-' + field.id); - enter.append('input') .property('type', 'text') .attr('placeholder', field.t('placeholders.number')) @@ -29510,7 +29528,6 @@ iD.ui.preset.address = function(field, context) { // Update - housename = wrap.select('.addr-housename'); housenumber = wrap.select('.addr-number'); street = wrap.select('.addr-street'); city = wrap.select('.addr-city'); @@ -29541,7 +29558,6 @@ iD.ui.preset.address = function(field, context) { function change() { event.change({ - 'addr:housename': housename.value() || undefined, 'addr:housenumber': housenumber.value() || undefined, 'addr:street': street.value() || undefined, 'addr:city': city.value() || undefined, @@ -29556,7 +29572,6 @@ iD.ui.preset.address = function(field, context) { }; address.tags = function(tags) { - housename.value(tags['addr:housename'] || ''); housenumber.value(tags['addr:housenumber'] || ''); street.value(tags['addr:street'] || ''); city.value(tags['addr:city'] || ''); @@ -29564,7 +29579,7 @@ iD.ui.preset.address = function(field, context) { }; address.focus = function() { - housename.node().focus(); + housenumber.node().focus(); }; return d3.rebind(address, event, 'on'); @@ -62669,7 +62684,7 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "dentist's office" ], "tags": { - "amenity": "doctors" + "amenity": "dentist" }, "icon": "hospital", "fields": [ @@ -63904,6 +63919,102 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," }, "name": "Apartments" }, + "building/barn": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "barn" + }, + "name": "Barn" + }, + "building/bunker": { + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "bunker" + }, + "name": "Bunker", + "searchable": false + }, + "building/cabin": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "cabin" + }, + "name": "Cabin" + }, + "building/cathedral": { + "icon": "place-of-worship", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "cathedral" + }, + "name": "Cathedral" + }, + "building/chapel": { + "icon": "place-of-worship", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "chapel" + }, + "name": "Chapel" + }, + "building/church": { + "icon": "place-of-worship", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "church" + }, + "name": "Church" + }, "building/commercial": { "icon": "commercial", "geometry": [ @@ -63916,6 +64027,54 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," }, "name": "Commercial Building" }, + "building/construction": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "construction" + }, + "name": "Building Under Construction" + }, + "building/detached": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "detached" + }, + "name": "Detached Home" + }, + "building/dormitory": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "dormitory" + }, + "name": "Dormitory" + }, "building/entrance": { "icon": "entrance", "geometry": [ @@ -63942,6 +64101,69 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "name": "Garage", "icon": "warehouse" }, + "building/garages": { + "icon": "warehouse", + "fields": [ + "capacity" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "garages" + }, + "name": "Garages" + }, + "building/greenhouse": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "greenhouse" + }, + "name": "Greenhouse" + }, + "building/hospital": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "hospital" + }, + "name": "Hospital Building" + }, + "building/hotel": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "hotel" + }, + "name": "Hotel Building" + }, "building/house": { "icon": "building", "fields": [ @@ -63984,6 +64206,22 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," }, "name": "Industrial Building" }, + "building/public": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "public" + }, + "name": "Public Building" + }, "building/residential": { "icon": "building", "fields": [ @@ -64000,6 +64238,167 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," }, "name": "Residential Building" }, + "building/retail": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "retail" + }, + "name": "Retail Building" + }, + "building/roof": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "roof" + }, + "name": "Roof" + }, + "building/school": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "school" + }, + "name": "School Building" + }, + "building/shed": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "shed" + }, + "name": "Shed" + }, + "building/stable": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "stable" + }, + "name": "Stable" + }, + "building/static_caravan": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "static_caravan" + }, + "name": "Static Mobile Home" + }, + "building/terrace": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "terrace" + }, + "name": "Row Houses" + }, + "building/train_station": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "train_station" + }, + "name": "Train Station", + "searchable": false + }, + "building/university": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "university" + }, + "name": "University Building" + }, + "building/warehouse": { + "icon": "building", + "fields": [ + "address", + "levels" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "building": "warehouse" + }, + "name": "Warehouse" + }, "craft/basket_maker": { "name": "Basket Maker", "geometry": [ @@ -67761,6 +68160,9 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," }, "railway/station": { "icon": "rail", + "fields": [ + "building_area" + ], "geometry": [ "point", "vertex", @@ -67879,6 +68281,27 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," ], "name": "Liquor Store" }, + "shop/art": { + "icon": "art-gallery", + "fields": [ + "address", + "building_area", + "opening_hours" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "terms": [ + "art store", + "art gallery" + ], + "tags": { + "shop": "art" + }, + "name": "Art Shop" + }, "shop/bakery": { "icon": "bakery", "fields": [ @@ -67953,6 +68376,23 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," }, "name": "Bicycle Shop" }, + "shop/bookmaker": { + "icon": "shop", + "fields": [ + "address", + "building_area", + "opening_hours" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "shop": "bookmaker" + }, + "name": "Bookmaker" + }, "shop/books": { "icon": "shop", "fields": [ @@ -68472,6 +68912,23 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," }, "name": "Locksmith" }, + "shop/lottery": { + "icon": "shop", + "fields": [ + "address", + "building_area", + "opening_hours" + ], + "geometry": [ + "point", + "vertex", + "area" + ], + "tags": { + "shop": "lottery" + }, + "name": "Lottery Shop" + }, "shop/mall": { "icon": "shop", "fields": [ @@ -97121,7 +97578,6 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "address": { "type": "address", "keys": [ - "addr:housename", "addr:housenumber", "addr:street", "addr:city", @@ -97132,7 +97588,6 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "label": "Address", "strings": { "placeholders": { - "housename": "Housename", "number": "123", "street": "Street", "city": "City", @@ -109952,7 +110407,8 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "annotation": "Merged {n} lines.", "not_eligible": "These features can't be merged.", "not_adjacent": "These lines can't be merged because they aren't connected.", - "restriction": "These lines can't be merged because at least one is a member of a \"{relation}\" relation." + "restriction": "These lines can't be merged because at least one is a member of a \"{relation}\" relation.", + "incomplete_relation": "These features can't be merged because at least one hasn't been fully downloaded." }, "move": { "title": "Move", @@ -110287,7 +110743,6 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "address": { "label": "Address", "placeholders": { - "housename": "Housename", "number": "123", "street": "Street", "city": "City", @@ -111108,10 +111563,46 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "name": "Apartments", "terms": "" }, + "building/barn": { + "name": "Barn", + "terms": "" + }, + "building/bunker": { + "name": "Bunker", + "terms": "" + }, + "building/cabin": { + "name": "Cabin", + "terms": "" + }, + "building/cathedral": { + "name": "Cathedral", + "terms": "" + }, + "building/chapel": { + "name": "Chapel", + "terms": "" + }, + "building/church": { + "name": "Church", + "terms": "" + }, "building/commercial": { "name": "Commercial Building", "terms": "" }, + "building/construction": { + "name": "Building Under Construction", + "terms": "" + }, + "building/detached": { + "name": "Detached Home", + "terms": "" + }, + "building/dormitory": { + "name": "Dormitory", + "terms": "" + }, "building/entrance": { "name": "Entrance", "terms": "" @@ -111120,6 +111611,22 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "name": "Garage", "terms": "" }, + "building/garages": { + "name": "Garages", + "terms": "" + }, + "building/greenhouse": { + "name": "Greenhouse", + "terms": "" + }, + "building/hospital": { + "name": "Hospital Building", + "terms": "" + }, + "building/hotel": { + "name": "Hotel Building", + "terms": "" + }, "building/house": { "name": "House", "terms": "" @@ -111132,10 +111639,54 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "name": "Industrial Building", "terms": "" }, + "building/public": { + "name": "Public Building", + "terms": "" + }, "building/residential": { "name": "Residential Building", "terms": "" }, + "building/retail": { + "name": "Retail Building", + "terms": "" + }, + "building/roof": { + "name": "Roof", + "terms": "" + }, + "building/school": { + "name": "School Building", + "terms": "" + }, + "building/shed": { + "name": "Shed", + "terms": "" + }, + "building/stable": { + "name": "Stable", + "terms": "" + }, + "building/static_caravan": { + "name": "Static Mobile Home", + "terms": "" + }, + "building/terrace": { + "name": "Row Houses", + "terms": "" + }, + "building/train_station": { + "name": "Train Station", + "terms": "" + }, + "building/university": { + "name": "University Building", + "terms": "" + }, + "building/warehouse": { + "name": "Warehouse", + "terms": "" + }, "craft/basket_maker": { "name": "Basket Maker", "terms": "basket,basketry,basket maker,basket weaver" @@ -112112,6 +112663,10 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "name": "Liquor Store", "terms": "alcohol" }, + "shop/art": { + "name": "Art Shop", + "terms": "art store,art gallery" + }, "shop/bakery": { "name": "Bakery", "terms": "" @@ -112128,6 +112683,10 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "name": "Bicycle Shop", "terms": "" }, + "shop/bookmaker": { + "name": "Bookmaker", + "terms": "" + }, "shop/books": { "name": "Bookstore", "terms": "" @@ -112248,6 +112807,10 @@ iD.introGraph = '{"n185954700":{"id":"n185954700","loc":[-85.642244,41.939081]," "name": "Locksmith", "terms": "keys" }, + "shop/lottery": { + "name": "Lottery Shop", + "terms": "" + }, "shop/mall": { "name": "Mall", "terms": ""