🗃️ Committing everything that changed 🗃️

htdocs/www/js/errorpages/homepage.js
This commit is contained in:
casjay 2024-09-02 19:25:43 -04:00
parent b03948d68b
commit ab179e0bed
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145

View File

@ -1,6 +1,16 @@
function homepage() { function homepage(getURI) {
let proto = location.protocol; let baseURI = getURI;
let port = location.port; let port = location.port;
let currentSite = window.location.hostname; let url = location.hostname;
window.location = proto + '//' + currentSite + ':' + port; let proto = location.protocol;
let baseURL = baseURI || location.pathname;
let base = baseURL.slice(0, baseURL.lastIndexOf('/'));
if (!base) base = '/';
if (!port)
if (proto == 'https:') {
port = 443;
} else {
port = 80;
}
window.location = proto + '//' + url + ':' + port + base;
} }