mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Update OSM.org links
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user