From 9116978609f1e17ce881e13648b6b77be7dbcabe Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 25 Jan 2013 12:00:23 -0500 Subject: [PATCH] Show version and tag it correctly. Fixes #502 and fixes #499 --- js/id/connection.js | 13 ++++++++++++- js/id/format/xml.js | 10 ++++------ js/id/id.js | 8 ++++++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/js/id/connection.js b/js/id/connection.js index 12d19505d..326e9ebfa 100644 --- a/js/id/connection.js +++ b/js/id/connection.js @@ -4,6 +4,7 @@ iD.Connection = function() { url = 'http://www.openstreetmap.org', connection = {}, user = {}, + version, keys, inflight = {}, loadedTiles = {}, @@ -186,7 +187,11 @@ iD.Connection = function() { method: 'PUT', path: '/api/0.6/changeset/create', options: { header: { 'Content-Type': 'text/xml' } }, - content: iD.format.XML.changeset(comment, imagery_used) + content: iD.format.XML.changeset({ + imagery_used: imagery_used.join(';'), + comment: comment, + created_by: 'iD ' + (version || '') + }) }, function (err, changeset_id) { if (err) return callback(err); oauth.xhr({ @@ -321,6 +326,12 @@ iD.Connection = function() { return oauth.authenticate(done); }; + connection.version = function(_) { + if (!arguments.length) return version; + version = _; + return connection; + }; + connection.bboxFromAPI = bboxFromAPI; connection.loadFromURL = loadFromURL; connection.loadTiles = _.debounce(loadTiles, 100); diff --git a/js/id/format/xml.js b/js/id/format/xml.js index bdf50c459..a47dfa5df 100644 --- a/js/id/format/xml.js +++ b/js/id/format/xml.js @@ -15,16 +15,14 @@ iD.format.XML = { return s.replace(/>/g,'>').replace(/