improved menu (seperators)

added second level for reboot if reboot from menu was selected by mistake
This commit is contained in:
lumapu 2022-10-23 21:57:03 +02:00
parent 3764aa4ce1
commit f721116987
10 changed files with 58 additions and 77 deletions

View file

@ -1,3 +1,22 @@
/**
* GENERIC FUNCTIONS
*/
function topnav() {
toggle("topnav");
}
function parseMenu(obj) {
var e = document.getElementById("topnav");
e.innerHTML = "";
for(var i = 0; i < obj["name"].length; i ++) {
if(obj["name"][i] == "-")
e.appendChild(span("", ["seperator"]));
else
e.appendChild(link(obj["link"][i], obj["name"][i], obj["trgt"][i]));
}
}
function toggle(id, hide) {
var elm = document.getElementById(id);
if(hide) {
@ -36,6 +55,10 @@ function getAjax(url, ptr, method="GET", json=null) {
}
}
/**
* CREATE DOM FUNCTIONS
*/
function des(val) {
e = document.createElement('p');
e.classList.add("subdes");