diff --git a/js/id/core/connection.js b/js/id/core/connection.js index cccca636c..35b1cef4f 100644 --- a/js/id/core/connection.js +++ b/js/id/core/connection.js @@ -22,15 +22,19 @@ iD.Connection = function() { off; connection.changesetURL = function(changesetId) { - return url + '/browse/changeset/' + changesetId; + return url + '/changeset/' + changesetId; }; - connection.changesetsURL = function(extent) { - return url + '/browse/changesets?bbox=' + extent.toParam(); + connection.changesetsURL = function(center, zoom) { + var precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2)); + return url + '/history#map=' + + Math.floor(zoom) + '/' + + center[1].toFixed(precision) + '/' + + center[0].toFixed(precision); }; connection.entityURL = function(entity) { - return url + '/browse/' + entity.type + '/' + entity.osmId(); + return url + '/' + entity.type + '/' + entity.osmId(); }; connection.userURL = function(username) { diff --git a/js/id/ui/contributors.js b/js/id/ui/contributors.js index b9fbdcb9b..cca4acc2c 100644 --- a/js/id/ui/contributors.js +++ b/js/id/ui/contributors.js @@ -34,7 +34,7 @@ iD.ui.Contributors = function(context) { .attr('target', '_blank') .attr('tabindex', -1) .attr('href', function() { - return context.connection().changesetsURL(context.map().extent()); + return context.connection().changesetsURL(context.map().center(), context.map().zoom()); }) .text(u.length - limit + 1); diff --git a/test/spec/core/connection.js b/test/spec/core/connection.js index 305275fb3..da4d3568a 100644 --- a/test/spec/core/connection.js +++ b/test/spec/core/connection.js @@ -11,7 +11,7 @@ describe('iD.Connection', function () { describe('#changesetUrl', function() { it('provides a changeset url', function() { - expect(c.changesetURL(2)).to.eql('http://www.openstreetmap.org/browse/changeset/2'); + expect(c.changesetURL(2)).to.eql('http://www.openstreetmap.org/changeset/2'); }); }); @@ -32,7 +32,7 @@ describe('iD.Connection', function () { c.switch({ url: "http://example.com" }); - expect(c.changesetURL(1)).to.equal("http://example.com/browse/changeset/1") + expect(c.changesetURL(1)).to.equal("http://example.com/changeset/1") }); it("emits an auth event", function(done) {