Skip to content

Commit

Permalink
Add hyperlinks for wikidata entries
Browse files Browse the repository at this point in the history
  • Loading branch information
guyfawcus authored and tyrasd committed Mar 6, 2014
1 parent 52261b4 commit 330b834
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/overpass.js
Expand Up @@ -383,6 +383,10 @@ setTimeout(function() {
if (((wiki_lang = k.match(/^wikipedia\:(.*)$/)) && (wiki_page = v)) ||
((k == "wikipedia") && (wiki_lang = v.match(/^([a-zA-Z]+)\:(.*)$/)) && (wiki_page = wiki_lang[2])))
v = '<a href="http://'+wiki_lang[1]+'.wikipedia.org/wiki/'+encodeURIComponent(wiki_page)+'" target="_blank">'+v+'</a>';
// hyperlinks for wikidata entries
var wikidata_page;
if ((k == "wikidata") && (wikidata_page = v.match(/^Q[0-9]+$/)))
v = '<a href="https://www.wikidata.org/wiki/'+encodeURIComponent(wikidata_page)+'" target="_blank">'+v+'</a>';
popup += "<li>"+k+"="+v+"</li>"
});
popup += "</ul>";
Expand Down

0 comments on commit 330b834

Please sign in to comment.