diff --git a/data/index.htm b/data/index.htm index d59cfb51..4b39bfe7 100644 --- a/data/index.htm +++ b/data/index.htm @@ -33,7 +33,7 @@

StarMod by MoonModules 💫

- +
diff --git a/data/index.js b/data/index.js index 52bc0998..0a911bb6 100644 --- a/data/index.js +++ b/data/index.js @@ -126,7 +126,7 @@ function generateHTML(parentNode, json, rowNr = -1) { return a.o - b.o; //o is order nr }); for (var node of json) //if isArray then variables of array - generateHTML(parentNode, node); + generateHTML(parentNode, node, rowNr); } else { //if root (type module) add the html to one of the screen columns @@ -136,11 +136,12 @@ function generateHTML(parentNode, json, rowNr = -1) { } if (json) { - if (json.id == "System") { - console.log("view", json); - if (json.view) - savedView = json.view; - } + if (json.id == "System") { + //get the current view + console.log("view", json); + if (json.view) + savedView = json.view; + } } else { console.log("json no ?", json); @@ -153,7 +154,7 @@ function generateHTML(parentNode, json, rowNr = -1) { //set labelNode before if, will be used in if then else let labelNode = cE("label"); - labelNode.innerText = initCap(json.id); + labelNode.innerText = initCap(json.id); // the default when not overridden by uiFun let isPartOfTable = (rowNr != -1); @@ -188,28 +189,32 @@ function generateHTML(parentNode, json, rowNr = -1) { newNode.appendChild(theadNode); //row for header newNode.appendChild(cE("tbody")); + + //json.n will add the columns } else { //primitive types //table header //no newNode created if (parentNode.nodeName.toLocaleLowerCase() == "table") { //table add the id in the header + //rowNr = -1 for th so uiFun will be called here and processed in processVarNode let thNode = cE("th"); thNode.id = json.id; - thNode.innerText = initCap(json.id); //label uiFun response can change it + // thNode.innerText = "wait for uiFun";// initCap(json.id); //label uiFun response can change it parentNode.firstChild.firstChild.appendChild(thNode); // } else { - if (json.type == "select") { - //if part of a table, use the saved list of options, otheriwise create select and uiFun will get the options + if (!isPartOfTable) { + newNode = cE("p"); + if (json.type != "button") newNode.appendChild(labelNode); //add label + } - //newNode has no id here ... + let valueNode; + let rangeValueNode = null; + // let buttonSaveNode = null; + // let buttonCancelNode = null; - if (!isPartOfTable) { - newNode = cE("p"); - if (json.type != "button") newNode.appendChild(labelNode); //add label - } + if (json.type == "select") { - let valueNode; if (json.ro) { //e.g. for reset/restart reason: do not show a select but only show the selected option valueNode = cE("span"); if (json.value) valueNode.innerText = json.value; @@ -218,10 +223,12 @@ function generateHTML(parentNode, json, rowNr = -1) { //

with