mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-03 13:38:04 +02:00
+12
-1
@@ -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);
|
||||
|
||||
+4
-6
@@ -15,16 +15,14 @@ iD.format.XML = {
|
||||
return s.replace(/>/g,'>').replace(/</g,'<').replace(/"/g,'"');
|
||||
},
|
||||
// Generate Changeset XML. Returns a string.
|
||||
changeset: function(comment, imagery_used) {
|
||||
changeset: function(tags) {
|
||||
return (new XMLSerializer()).serializeToString(
|
||||
JXON.unbuild({
|
||||
osm: {
|
||||
changeset: {
|
||||
tag: [
|
||||
{ '@k': 'created_by', '@v': 'iD 0.0.0' },
|
||||
{ '@k': 'comment', '@v': comment || '' },
|
||||
{ '@k': 'imagery_used', '@v': imagery_used.join(';')}
|
||||
],
|
||||
tag: _.map(tags, function(value, key) {
|
||||
return { '@k': key, '@v': value };
|
||||
}),
|
||||
'@version': 0.3,
|
||||
'@generator': 'iD'
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,5 +1,9 @@
|
||||
window.iD = function(container) {
|
||||
var connection = iD.Connection(),
|
||||
// the reported, displayed version of iD.
|
||||
var version = '0.0.0-alpha1';
|
||||
|
||||
var connection = iD.Connection()
|
||||
.version(version),
|
||||
history = iD.History(),
|
||||
map = iD.Map()
|
||||
.connection(connection)
|
||||
@@ -142,7 +146,7 @@ window.iD = function(container) {
|
||||
.attr('id','about')
|
||||
.attr('class','pad1 fillD about-block link-list');
|
||||
linkList.append('li').append('a').attr('target', '_blank')
|
||||
.attr('href', 'http://github.com/systemed/iD').text('view code');
|
||||
.attr('href', 'http://github.com/systemed/iD').text(version);
|
||||
linkList.append('li').append('a').attr('target', '_blank')
|
||||
.attr('href', 'http://github.com/systemed/iD/issues').text('report a bug');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user