diff --git a/js/settings.js b/js/settings.js index a7b321e3..91fff1b6 100644 --- a/js/settings.js +++ b/js/settings.js @@ -180,8 +180,8 @@ function signup(str) { function changeName() { var name = document.forms['signupform'].username.value; - var url = "https://" + location.host + "/user/" + encodeURIComponent(name); - $('profileurl').innerHTML = gt.gettext("Profile address:") + url; + var url = location.origin + "/user/" + encodeURIComponent(name); + $('profileurl').innerHTML = gt.gettext("Profile address: ") + url; } // Swap privacy panes @@ -218,5 +218,5 @@ function showError(err) { // Need to duplicate this from openflights.js so that it opens in Settings window, not main, and // IE does not go nuts function backupFlights() { - location.href="https://" + location.host + "/php/flights.php?export=backup"; + location.href = location.origin + "/php/flights.php?export=backup"; } diff --git a/openflights.js b/openflights.js index a8d1fdd3..b1adfdd9 100644 --- a/openflights.js +++ b/openflights.js @@ -1521,9 +1521,9 @@ function listFlights(str, desc, id) { // newWindow: true if we want target URL to open in a new window. function exportFlights(type, newWindow) { if(type == "KML") { - url = "https://" + location.host + "/php/kml.php?" + lastQuery; + url = location.origin + "/php/kml.php?" + lastQuery; } else { - url = "https://" + location.host + "/php/flights.php?" + lastQuery + "&export=" + type; + url = location.origin + "/php/flights.php?" + lastQuery + "&export=" + type; } if(newWindow) { window.open(url, "openflights_export"); @@ -2962,7 +2962,7 @@ function login(str, param) { case 2: // Successful but need to switch UI language, so reload, stripping out any "?lang" in the URL $("loginstatus").innerHTML = "" + gt.gettext("Loading") + ""; - location.href = "https://" + location.host + location.pathname; + location.href = location.origin + location.pathname; break; default: