Change portal image urls to https if necessary in the portal object
This commit is contained in:
parent
bec7ae8c95
commit
86a7996db5
@ -105,7 +105,15 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
|||||||
&& urlPortal !== ent[0]
|
&& urlPortal !== ent[0]
|
||||||
) return;
|
) return;
|
||||||
|
|
||||||
|
if('imageByUrl' in ent[2] && 'imageUrl' in ent[2].imageByUrl) {
|
||||||
|
if(window.location.protocol === 'https:') {
|
||||||
|
ent[2].imageByUrl.imageUrl = ent[2].imageByUrl.imageUrl.indexOf('www.panoramio.com') !== -1
|
||||||
|
? ent[2].imageByUrl.imageUrl.replace(/^http:\/\/www/, 'https://ssl').replace('small', 'medium')
|
||||||
|
: ent[2].imageByUrl.imageUrl.replace(/^http:\/\//, '//');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ent[2].imageByUrl = {'imageUrl': DEFAULT_PORTAL_IMG};
|
||||||
|
}
|
||||||
|
|
||||||
ppp.push(ent); // delay portal render
|
ppp.push(ent); // delay portal render
|
||||||
} else if(ent[2].edge !== undefined) {
|
} else if(ent[2].edge !== undefined) {
|
||||||
|
@ -44,10 +44,7 @@ window.renderPortalDetails = function(guid) {
|
|||||||
var resoDetails = '<table id="resodetails">' + getResonatorDetails(d) + '</table>';
|
var resoDetails = '<table id="resodetails">' + getResonatorDetails(d) + '</table>';
|
||||||
|
|
||||||
setPortalIndicators(d);
|
setPortalIndicators(d);
|
||||||
var img = d.imageByUrl && d.imageByUrl.imageUrl
|
var img = d.imageByUrl.imageUrl;
|
||||||
? d.imageByUrl.imageUrl
|
|
||||||
: DEFAULT_PORTAL_IMG;
|
|
||||||
|
|
||||||
var lat = d.locationE6.latE6;
|
var lat = d.locationE6.latE6;
|
||||||
var lng = d.locationE6.lngE6;
|
var lng = d.locationE6.lngE6;
|
||||||
var perma = '/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
|
var perma = '/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user