remove unnecessary absolute URLs. site-relative are used where possible (e.g. permalinks, rpc calls) - and a couple of protocol-relative one for automatic http/https matching
This commit is contained in:
parent
f48aca8864
commit
baaaf3e3f1
@ -231,7 +231,7 @@ window.setupPlayerStat = function() {
|
|||||||
+ '<h2 title="'+t+'">'+level+' '
|
+ '<h2 title="'+t+'">'+level+' '
|
||||||
+ '<div id="name">'
|
+ '<div id="name">'
|
||||||
+ '<span class="'+cls+'">'+PLAYER.nickname+'</span>'
|
+ '<span class="'+cls+'">'+PLAYER.nickname+'</span>'
|
||||||
+ '<a href="https://www.ingress.com/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttps://appengine.google.com/_ah/logout%253Fcontinue%253Dhttps://www.ingress.com/intel%26service%3Dah" id="signout">sign out</a>'
|
+ '<a href="/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttps://appengine.google.com/_ah/logout%253Fcontinue%253Dhttps://www.ingress.com/intel%26service%3Dah" id="signout">sign out</a>'
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '<div id="stats">'
|
+ '<div id="stats">'
|
||||||
+ '<sup>XM: '+xmRatio+'%</sup>'
|
+ '<sup>XM: '+xmRatio+'%</sup>'
|
||||||
@ -386,6 +386,7 @@ try { console.log('Loading included JS now'); } catch(e) {}
|
|||||||
|
|
||||||
try { console.log('done loading included JS'); } catch(e) {}
|
try { console.log('done loading included JS'); } catch(e) {}
|
||||||
|
|
||||||
|
//note: no protocol - so uses http or https as used on the current page
|
||||||
var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
|
var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
|
||||||
var JQUERYUI = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js';
|
var JQUERYUI = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js';
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ window.chat.writeDataToHash = function(newData, storageHash, isPublicChannel) {
|
|||||||
|
|
||||||
case 'PORTAL':
|
case 'PORTAL':
|
||||||
var latlng = [markup[1].latE6/1E6, markup[1].lngE6/1E6];
|
var latlng = [markup[1].latE6/1E6, markup[1].lngE6/1E6];
|
||||||
var perma = 'https://ingress.com/intel?latE6='+markup[1].latE6+'&lngE6='+markup[1].lngE6+'&z=17&pguid='+markup[1].guid;
|
var perma = '/intel?latE6='+markup[1].latE6+'&lngE6='+markup[1].lngE6+'&z=17&pguid='+markup[1].guid;
|
||||||
var js = 'window.zoomToAndShowPortal(\''+markup[1].guid+'\', ['+latlng[0]+', '+latlng[1]+']);return false';
|
var js = 'window.zoomToAndShowPortal(\''+markup[1].guid+'\', ['+latlng[0]+', '+latlng[1]+']);return false';
|
||||||
|
|
||||||
msg += '<a onclick="'+js+'"'
|
msg += '<a onclick="'+js+'"'
|
||||||
|
@ -50,7 +50,7 @@ window.renderPortalDetails = function(guid) {
|
|||||||
|
|
||||||
var lat = d.locationE6.latE6;
|
var lat = d.locationE6.latE6;
|
||||||
var lng = d.locationE6.lngE6;
|
var lng = d.locationE6.lngE6;
|
||||||
var perma = 'https://ingress.com/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
|
var perma = '/intel?latE6='+lat+'&lngE6='+lng+'&z=17&pguid='+guid;
|
||||||
var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."';
|
var imgTitle = 'title="'+getPortalDescriptionFromDetails(d)+'\n\nClick to show full image."';
|
||||||
var poslinks = 'window.showPortalPosLinks('+lat/1E6+','+lng/1E6+',\'' + d.portalV2.descriptiveText.TITLE + '\')';
|
var poslinks = 'window.showPortalPosLinks('+lat/1E6+','+lng/1E6+',\'' + d.portalV2.descriptiveText.TITLE + '\')';
|
||||||
var postcard = 'Send in a postcard. Will put it online after receiving. Address:\\n\\nStefan Breunig\\nINF 305 – R045\\n69120 Heidelberg\\nGermany';
|
var postcard = 'Send in a postcard. Will put it online after receiving. Address:\\n\\nStefan Breunig\\nINF 305 – R045\\n69120 Heidelberg\\nGermany';
|
||||||
|
@ -59,10 +59,7 @@ window.postAjax = function(action, data, success, error) {
|
|||||||
var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); };
|
var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); };
|
||||||
var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); };
|
var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); };
|
||||||
var result = $.ajax({
|
var result = $.ajax({
|
||||||
// use full URL to avoid issues depending on how people set their
|
url: '/rpc/dashboard.'+action,
|
||||||
// slash. See:
|
|
||||||
// https://github.com/breunigs/ingress-intel-total-conversion/issues/56
|
|
||||||
url: window.location.protocol + '//www.ingress.com/rpc/dashboard.'+action,
|
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
@ -261,7 +258,7 @@ window.setPermaLink = function(elm) {
|
|||||||
var lat = Math.round(c.lat*1E6);
|
var lat = Math.round(c.lat*1E6);
|
||||||
var lng = Math.round(c.lng*1E6);
|
var lng = Math.round(c.lng*1E6);
|
||||||
var qry = 'latE6='+lat+'&lngE6='+lng+'&z=' + (map.getZoom()-1);
|
var qry = 'latE6='+lat+'&lngE6='+lng+'&z=' + (map.getZoom()-1);
|
||||||
$(elm).attr('href', 'https://www.ingress.com/intel?' + qry);
|
$(elm).attr('href', '/intel?' + qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.uniqueArray = function(arr) {
|
window.uniqueArray = function(arr) {
|
||||||
|
4
main.js
4
main.js
@ -61,7 +61,7 @@ document.getElementsByTagName('head')[0].innerHTML = ''
|
|||||||
+ '<style>@@INCLUDESTRING:style.css@@</style>'
|
+ '<style>@@INCLUDESTRING:style.css@@</style>'
|
||||||
+ '<style>@@INCLUDESTRING:external/leaflet.css@@</style>'
|
+ '<style>@@INCLUDESTRING:external/leaflet.css@@</style>'
|
||||||
//note: smartphone.css injection moved into code/smartphone.js
|
//note: smartphone.css injection moved into code/smartphone.js
|
||||||
+ '<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Coda"/>';
|
+ '<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Coda"/>';
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].innerHTML = ''
|
document.getElementsByTagName('body')[0].innerHTML = ''
|
||||||
+ '<div id="map">Loading, please wait</div>'
|
+ '<div id="map">Loading, please wait</div>'
|
||||||
@ -168,7 +168,7 @@ window.RANGE_INDICATOR_COLOR = 'red'
|
|||||||
window.PORTAL_RADIUS_ENLARGE_MOBILE = 5;
|
window.PORTAL_RADIUS_ENLARGE_MOBILE = 5;
|
||||||
|
|
||||||
|
|
||||||
window.DEFAULT_PORTAL_IMG = 'https://commondatastorage.googleapis.com/ingress/img/default-portal-image.png';
|
window.DEFAULT_PORTAL_IMG = '//commondatastorage.googleapis.com/ingress/img/default-portal-image.png';
|
||||||
window.NOMINATIM = 'http://nominatim.openstreetmap.org/search?format=json&limit=1&q=';
|
window.NOMINATIM = 'http://nominatim.openstreetmap.org/search?format=json&limit=1&q=';
|
||||||
|
|
||||||
// INGRESS CONSTANTS /////////////////////////////////////////////////
|
// INGRESS CONSTANTS /////////////////////////////////////////////////
|
||||||
|
@ -200,7 +200,7 @@ window.plugin.apList.getPortalLink = function(portal) {
|
|||||||
var latlng = [portal.locationE6.latE6/1E6, portal.locationE6.lngE6/1E6].join();
|
var latlng = [portal.locationE6.latE6/1E6, portal.locationE6.lngE6/1E6].join();
|
||||||
var jsSingleClick = 'window.plugin.apList.selectPortal(\''+portal.guid+'\');return false';
|
var jsSingleClick = 'window.plugin.apList.selectPortal(\''+portal.guid+'\');return false';
|
||||||
var jsDoubleClick = 'window.zoomToAndShowPortal(\''+portal.guid+'\', ['+latlng+']);return false';
|
var jsDoubleClick = 'window.zoomToAndShowPortal(\''+portal.guid+'\', ['+latlng+']);return false';
|
||||||
var perma = 'https://ingress.com/intel?latE6='+portal.locationE6.latE6
|
var perma = '/intel?latE6='+portal.locationE6.latE6
|
||||||
+'&lngE6='+portal.locationE6.lngE6+'&z=17&pguid='+portal.guid;
|
+'&lngE6='+portal.locationE6.lngE6+'&z=17&pguid='+portal.guid;
|
||||||
//Use Jquery to create the link, which escape characters in TITLE and ADDRESS of portal
|
//Use Jquery to create the link, which escape characters in TITLE and ADDRESS of portal
|
||||||
var a = $('<a>',{
|
var a = $('<a>',{
|
||||||
|
@ -353,7 +353,7 @@ window.plugin.portalslist.exportKML = function(){
|
|||||||
// description contain picture of the portal, address and link to the Intel map
|
// description contain picture of the portal, address and link to the Intel map
|
||||||
var description = '<![CDATA['
|
var description = '<![CDATA['
|
||||||
+ '<div><table><tr><td><img style="width:100px" src="' + portal.img + '"></td><td>' + portal.address
|
+ '<div><table><tr><td><img style="width:100px" src="' + portal.img + '"></td><td>' + portal.address
|
||||||
+ '<br><a href="https://ingress.com/intel?latE6=' + portal.lat*1E6 + '&lngE6=' + portal.lng*1E6 + '&z=17">Link to Intel Map</a></td></tr></table>'
|
+ '<br><a href="https://www.ingress.com/intel?latE6=' + portal.lat*1E6 + '&lngE6=' + portal.lng*1E6 + '&z=17">Link to Intel Map</a></td></tr></table>'
|
||||||
+ ']]>';
|
+ ']]>';
|
||||||
|
|
||||||
kml += '<Placemark><name>L' + Math.floor(portal.level) + ' - ' + portal.name + '</name>'
|
kml += '<Placemark><name>L' + Math.floor(portal.level) + ' - ' + portal.name + '</name>'
|
||||||
@ -387,7 +387,7 @@ window.plugin.portalslist.getPortalLink = function(portal,guid) {
|
|||||||
var latlng = [portal.locationE6.latE6/1E6, portal.locationE6.lngE6/1E6].join();
|
var latlng = [portal.locationE6.latE6/1E6, portal.locationE6.lngE6/1E6].join();
|
||||||
var jsSingleClick = 'window.renderPortalDetails(\''+guid+'\');return false';
|
var jsSingleClick = 'window.renderPortalDetails(\''+guid+'\');return false';
|
||||||
var jsDoubleClick = 'window.zoomToAndShowPortal(\''+guid+'\', ['+latlng+']);return false';
|
var jsDoubleClick = 'window.zoomToAndShowPortal(\''+guid+'\', ['+latlng+']);return false';
|
||||||
var perma = 'https://ingress.com/intel?latE6='+portal.locationE6.latE6+'&lngE6='+portal.locationE6.lngE6+'&z=17&pguid='+guid;
|
var perma = '/intel?latE6='+portal.locationE6.latE6+'&lngE6='+portal.locationE6.lngE6+'&z=17&pguid='+guid;
|
||||||
|
|
||||||
//Use Jquery to create the link, which escape characters in TITLE and ADDRESS of portal
|
//Use Jquery to create the link, which escape characters in TITLE and ADDRESS of portal
|
||||||
var a = $('<a>',{
|
var a = $('<a>',{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user