diff --git a/js/id/core/connection.js b/js/id/core/connection.js index e265436e4..f3860ce61 100644 --- a/js/id/core/connection.js +++ b/js/id/core/connection.js @@ -25,6 +25,10 @@ iD.Connection = function() { return url + '/browse/changeset/' + changesetId; }; + connection.changesetsURL = function(extent) { + return url + '/browse/changesets?bbox=' + extent.toParam(); + }; + connection.entityURL = function(entity) { return url + '/browse/' + entity.type + '/' + entity.osmId(); }; diff --git a/js/id/geo/extent.js b/js/id/geo/extent.js index 1b19abcbc..9d1cfe627 100644 --- a/js/id/geo/extent.js +++ b/js/id/geo/extent.js @@ -41,5 +41,9 @@ _.extend(iD.geo.Extent.prototype, { return iD.geo.Extent( [this[0][0] - dLon, this[0][1] - dLat], [this[1][0] + dLon, this[1][1] + dLat]); + }, + + toParam: function() { + return [this[0][0], this[0][1], this[1][0], this[1][1]].join(','); } }); diff --git a/js/id/ui/contributors.js b/js/id/ui/contributors.js index 80125eed1..b9fbdcb9b 100644 --- a/js/id/ui/contributors.js +++ b/js/id/ui/contributors.js @@ -34,10 +34,7 @@ iD.ui.Contributors = function(context) { .attr('target', '_blank') .attr('tabindex', -1) .attr('href', function() { - var ext = context.map().extent(); - return 'http://www.openstreetmap.org/browse/changesets?bbox=' + [ - ext[0][0], ext[0][1], - ext[1][0], ext[1][1]]; + return context.connection().changesetsURL(context.map().extent()); }) .text(u.length - limit + 1);