Files
HalbearNetDesktopSite/AccountApps/AccountManager.html
2026-01-26 08:49:11 +00:00

48 lines
2.3 KiB
HTML

<div class="AccountManager Initialised" id="AccountManagerBody" style="display: flex; flex-direction: row; align-content: center; align-items: center; justify-content: center; justify-items: center;"></div>
<script>
function AppInit(ID) {
if (sessionStorage.getItem("UID") == null) sessionStorage.setItem("UID", "Inactive");
const Body = document.getElementById("AccountManagerBody");
if (sessionStorage.getItem("ActiveSession") === true && sessionStorage.getItem("UID") !== "Inactive") {
var NewAppLoaded = new XMLHttpRequest();
NewAppLoaded.open('GET', "AccountApps/AccountLandingPage.html", true);
NewAppLoaded.onreadystatechange = function () {
if (NewAppLoaded.readyState !== 4) return;
if (NewAppLoaded.status !== 200) return;
document.getElementById("AppContainer").insertAdjacentHTML("beforeend", NewAppLoaded.responseText);
};
NewAppLoaded.send();
} else {
var NewAppLoaded = new XMLHttpRequest();
NewAppLoaded.open('GET', "AccountApps/SignIn.html", true);
NewAppLoaded.onreadystatechange = function () {
if (NewAppLoaded.readyState !== 4) return;
if (NewAppLoaded.status !== 200) return;
document.getElementById("AppContainer").insertAdjacentHTML("beforeend", NewAppLoaded.responseText);
};
NewAppLoaded.send();
}
}
function SwitchPage(ID, OldID){
document.getElementById(OldID).remove();
var NewAppLoaded = new XMLHttpRequest();
NewAppLoaded.open('GET', "AccountApps/"+ID+".html", true);
NewAppLoaded.onreadystatechange = function () {
if (NewAppLoaded.readyState !== 4) return;
if (NewAppLoaded.status !== 200) return;
Body.insertAdjacentHTML("beforeend",NewAppLoaded.responseText);
};
NewAppLoaded.send();
}
function showpass(ID) {
var Element = document.getElementById(ID);
if (Element.type === "password") {
document.getElementById("showpasswordcheckbox").checked = true;
Element.type = "text";
} else {
document.getElementById("showpasswordcheckbox").checked = false;
Element.type = "password";
}
}
</script>