36 lines
768 B
JavaScript
36 lines
768 B
JavaScript
let maestroID = -1;
|
|
|
|
$(document).ready(function() {
|
|
loadMaestroID();
|
|
});
|
|
|
|
|
|
function loadMaestroID() {
|
|
maestroID = sessionStorage.getItem("maestroID");
|
|
if(maestroID === null) {
|
|
maestroID = -1;
|
|
sessionStorage.setItem("maestroID", maestroID);
|
|
}
|
|
maestroID = Number(maestroID);
|
|
console.log("loaded maestroID : " + maestroID);
|
|
}
|
|
|
|
function saveMaestroID() {
|
|
sessionStorage.setItem("maestroID", maestroID);
|
|
console.log("saved maestroID : " + maestroID);
|
|
}
|
|
|
|
function goHome() {
|
|
if(maestroID === -1) {
|
|
location.href = "./../main/index.html";
|
|
} else {
|
|
location.href = "./../maestro/main_menu.html";
|
|
}
|
|
}
|
|
|
|
function logout() {
|
|
sessionStorage.clear();
|
|
maestroID = -1;
|
|
sessionStorage.setItem("maestroID", maestroID);
|
|
location.href = './../main/index.html';
|
|
} |