Skip to content

Commit

Permalink
Fixing POI URLs without http:// or https://
Browse files Browse the repository at this point in the history
Many website keys are not preceded with the protocol identifier, which
must me added in the href
  • Loading branch information
edewaele committed Jul 7, 2015
1 parent dcc4333 commit 90516f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/poi.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ POI.prototype.getInfoBox = function(){
content+='<div>';
content += this.__genItems({tag:['contact:email','email'],icon:'glyphicon glyphicon-envelope',href:'mailto:'});
content += this.__genItems({tag:['contact:phone','phone'],icon:'glyphicon glyphicon-phone-alt',href:'tel:'});
content += this.__genItems({tag:['contact:website','website'],icon:'glyphicon glyphicon-globe',href:''});
content += this.__genItems({tag:['contact:website','website'],icon:'glyphicon glyphicon-globe',href:'',
hrefFunc:function(nn){
// some website values have no protocol indication, resulting in a misintrepretation of the URL (eg. http://osm24.eu/www.jeudepaume.org)
return (nn.indexOf('http://') == -1 && nn.indexOf('https://') == -1)?'http://'+nn:nn;
}});

content += this.__genItems({tag:['contact:facebook'],icon:'glyphicon glyphicon-globe',name:"Facebook",href:'',hrefFunc:
function(nn){return ((nn.indexOf('/') === -1)?"http://facebook.com/":"")+nn;}});
Expand Down

0 comments on commit 90516f5

Please sign in to comment.