fix protocol-related error for http + https support
This commit is contained in:
parent
38f22989d6
commit
bc5939818c
@ -62,7 +62,7 @@ window.postAjax = function(action, data, success, error) {
|
||||
// use full URL to avoid issues depending on how people set their
|
||||
// slash. See:
|
||||
// https://github.com/breunigs/ingress-intel-total-conversion/issues/56
|
||||
url: 'https://www.ingress.com/rpc/dashboard.'+action,
|
||||
url: window.location.protocol + '//www.ingress.com/rpc/dashboard.'+action,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
@ -108,7 +108,7 @@ window.rangeLinkClick = function() {
|
||||
|
||||
window.showPortalPosLinks = function(lat, lng) {
|
||||
if (typeof android !== 'undefined' && android && android.intentPosLink) {
|
||||
android.intentPosLink('https://maps.google.com/?q='+lat+','+lng);
|
||||
android.intentPosLink(window.location.protocol + '//maps.google.com/?q='+lat+','+lng);
|
||||
} else {
|
||||
var qrcode = '<div id="qrcode"></div>';
|
||||
var script = '<script>$(\'#qrcode\').qrcode({text:\'GEO:'+lat+','+lng+'\'});</script>';
|
||||
|
13
dist/total-conversion-build.user.js
vendored
13
dist/total-conversion-build.user.js
vendored
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @id ingress-intel-total-conversion@jonatkins
|
||||
// @name intel map total conversion
|
||||
// @version 0.8.2-2013-03-16-194450-jonatkins
|
||||
// @version 0.9.0-2013-03-16-200744-jonatkins
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL http://iitc.jonatkins.com/dist/total-conversion-build.user.js
|
||||
// @downloadURL http://iitc.jonatkins.com/dist/total-conversion-build.user.js
|
||||
@ -16,16 +16,11 @@
|
||||
// REPLACE ORIG SITE ///////////////////////////////////////////////////
|
||||
if(document.getElementsByTagName('html')[0].getAttribute('itemscope') != null)
|
||||
throw('Ingress Intel Website is down, not a userscript issue.');
|
||||
window.iitcBuildDate = '2013-03-16-194450';
|
||||
window.iitcBuildDate = '2013-03-16-200744';
|
||||
|
||||
// disable vanilla JS
|
||||
window.onload = function() {};
|
||||
|
||||
if(window.location.protocol !== 'https:') {
|
||||
var redir = window.location.href.replace(/^http:/, 'https:');
|
||||
window.location = redir;
|
||||
throw('Need to load HTTPS version.');
|
||||
}
|
||||
|
||||
// rescue user data from original page
|
||||
var scr = document.getElementsByTagName('script');
|
||||
@ -1658,12 +1653,12 @@ d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo
|
||||
function boot() {
|
||||
window.debug.console.overwriteNativeIfRequired();
|
||||
|
||||
console.log('loading done, booting. Built: 2013-03-16-194450');
|
||||
console.log('loading done, booting. Built: 2013-03-16-200744');
|
||||
if(window.deviceID) console.log('Your device ID: ' + window.deviceID);
|
||||
window.runOnSmartphonesBeforeBoot();
|
||||
|
||||
// overwrite default Leaflet Marker icon to be a neutral color
|
||||
var base = 'https://iitc.jonatkins.com/dist/images';
|
||||
var base = 'http://iitc.jonatkins.com/dist/images';
|
||||
L.Icon.Default.imagePath = base;
|
||||
|
||||
window.iconEnl = L.Icon.Default.extend({options: { iconUrl: base + '/marker-green.png' } });
|
||||
|
Loading…
x
Reference in New Issue
Block a user