remove wiki.js

This commit is contained in:
Ansis Brammanis
2013-01-10 13:35:58 -05:00
parent b9cd9193c3
commit 5cfbff3a61
2 changed files with 4 additions and 40 deletions
-32
View File
@@ -1,32 +0,0 @@
iD.wiki = function() {
var wiki = {},
endpoint = 'http://wiki.openstreetmap.org/w/api.php';
// ?action=query&prop=imageinfo&titles=Image:Residential.jpg&iiprop=url%7Ccontent&format=json&callback=foo',
wiki.image = function(img, callback) {
d3.jsonp(endpoint + '?' +
iD.util.qsString({
action: 'query',
prop: 'imageinfo',
titles: img,
iiprop: 'url',
format: 'json',
callback: '{callback}'
}), function(d) {
try {
callback(null,
d.query.pages[Object.keys(d.query.pages)[0]].imageinfo[0].url);
} catch(e) {
callback(new Error('Image not found'));
}
});
};
wiki.endpoint = function(_) {
if (!arguments.length) return endpoint;
endpoint = _;
return wiki;
};
return wiki;
};
+4 -8
View File
@@ -27,14 +27,10 @@ iD.tagReference = function(selection) {
.text('Description');
if (selection.datum().image) {
iD.wiki().image(selection.datum().image, function(err, src) {
if (!err) {
referenceBody
.append('img')
.attr('class', 'wiki-image')
.attr('src', src);
}
});
referenceBody
.append('img')
.attr('class', 'wiki-image')
.attr('src', selection.datum().image.image_url);
}
referenceBody