Voeg thematische kleurplaten en creatieve niveaus toe (v0.4.65-beta) #3
2 changed files with 10 additions and 5 deletions
|
|
@ -24,6 +24,7 @@
|
|||
<button class="tbtn ghost" id="btnFolders">📁</button>
|
||||
<button class="tbtn ghost" id="btnSave">💾 <span data-i18n="saveBoard"></span></button>
|
||||
<button class="tbtn ghost" id="btnUser">👤 <span id="userLbl"></span></button>
|
||||
<button class="tbtn ghost" id="btnSettings" style="display:none;">⚙️</button>
|
||||
<button class="tbtn ghost" id="btnAdmin" style="display:none;">👥</button>
|
||||
<div id="langToggle">
|
||||
<button data-lang="nl">NL</button>
|
||||
|
|
|
|||
|
|
@ -373,6 +373,9 @@ const roleKey = r => r==="super" ? "roleSuper" : r==="admin" ? "roleAdmin" : r==
|
|||
function updateUserUI(){
|
||||
document.getElementById("userLbl").textContent = currentUser ? currentUser.displayName : T("login");
|
||||
document.getElementById("btnUser").classList.toggle("on", !!currentUser);
|
||||
const settingsBtn = document.getElementById("btnSettings");
|
||||
settingsBtn.style.display = currentUser ? "" : "none";
|
||||
settingsBtn.title = T("settingsTitle");
|
||||
const adminBtn = document.getElementById("btnAdmin");
|
||||
adminBtn.style.display = can("admin.access") ? "" : "none";
|
||||
adminBtn.title = T("beheer");
|
||||
|
|
@ -399,17 +402,18 @@ async function loadSchools(){
|
|||
list.map(x=>`<option value="${x.id}">${x.name.replace(/</g,"<")}</option>`).join("");
|
||||
}catch(e){ sel.innerHTML = `<option value="">${T("schoolSel")}</option>`; }
|
||||
}
|
||||
function openSettings(){
|
||||
settingsMsg.textContent = ""; settingsMsg.classList.remove("ok");
|
||||
settingsWrap.classList.add("open");
|
||||
}
|
||||
document.getElementById("btnUser").addEventListener("click", ()=>{
|
||||
if(currentUser){
|
||||
settingsMsg.textContent = ""; settingsMsg.classList.remove("ok");
|
||||
settingsWrap.classList.add("open");
|
||||
return;
|
||||
}
|
||||
if(currentUser){ openSettings(); return; }
|
||||
loginMsg.textContent = ""; loginMsg.classList.remove("ok");
|
||||
switchLoginTab("login");
|
||||
loadSchools();
|
||||
loginWrap.classList.add("open");
|
||||
});
|
||||
document.getElementById("btnSettings").addEventListener("click", openSettings);
|
||||
loginWrap.addEventListener("click", e=>{ if(e.target===loginWrap) loginWrap.classList.remove("open"); });
|
||||
settingsWrap.addEventListener("click", e=>{ if(e.target===settingsWrap) settingsWrap.classList.remove("open"); });
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue