Update DocsSpace.js

This commit is contained in:
Luis Fernando Molina committed 2020-12-13 08:14:53 +01:00
1 parent 5eb53c4862
commit e6f0cb1a78
1 file changed
+81 -30
@@ -618,47 +618,98 @@ function newSuperalgosDocSpace() {
}
function autoGeneratedHtml() {
/*
Menu Items
*/
let paragraph
let key = 'auto-generated-paragraph-' + paragraphIndex
if (nodeAppDefinition !== undefined && nodeAppDefinition.menuItems !== undefined) {
paragraph = {
style: "Title",
text: "" + nodeAppDefinition.type + " node menu"
}
renderParagraph(paragraph, key)
paragraphIndex++
paragraph = {
style: "Text",
text: "The " + nodeAppDefinition.type + " node has the following menu items:"
}
renderParagraph(paragraph, key)
paragraphIndex++
for (let i = 0; i < nodeAppDefinition.menuItems.length; i++) {
let menuItem = nodeAppDefinition.menuItems[i]
HTML = HTML + '<button id="docs-menu-item-' + i + '" type="button" class="docs-collapsible-element"><img>' + menuItem.label + '</button>'
HTML = HTML + '<div class="docs-collapsible-content">'
generateMenuItems()
//generateMenuProperties()
function generateMenuItems() {
/*
Menu Items
*/
let paragraph
let key = 'auto-generated-paragraph-' + paragraphIndex
if (nodeAppDefinition !== undefined && nodeAppDefinition.menuItems !== undefined) {
paragraph = {
style: "Text",
text: 'The ' + menuItem.label + ' menu item has the following properties:'
style: "Title",
text: "" + nodeAppDefinition.type + " node menu"
}
renderParagraph(paragraph, key)
paragraphIndex++
paragraph = {
style: "Text",
text: "The " + nodeAppDefinition.type + " node has the following menu items:"
}
renderParagraph(paragraph, key)
paragraphIndex++
for (let i = 0; i < nodeAppDefinition.menuItems.length; i++) {
let menuItem = nodeAppDefinition.menuItems[i]
HTML = HTML + '<button id="docs-menu-item-' + i + '" type="button" class="docs-collapsible-element"><img>' + menuItem.label + '</button>'
HTML = HTML + '<div class="docs-collapsible-content">'
for (const property in menuItem) {
paragraph = {
style: "List",
text: property + ": " + menuItem[property]
style: "Text",
text: 'The ' + menuItem.label + ' menu item has the following properties:'
}
renderParagraph(paragraph, key)
paragraphIndex++
}
HTML = HTML + '</div>'
for (const property in menuItem) {
paragraph = {
style: "List",
text: property + ": " + menuItem[property]
}
renderParagraph(paragraph, key)
paragraphIndex++
}
HTML = HTML + '</div>'
}
}
}
function generateMenuProperties() {
/*
Properties
*/
let paragraph
let key = 'auto-generated-paragraph-' + paragraphIndex
if (nodeAppDefinition !== undefined && nodeAppDefinition.menuItems !== undefined) {
paragraph = {
style: "Title",
text: "" + nodeAppDefinition.type + " node menu"
}
renderParagraph(paragraph, key)
paragraphIndex++
paragraph = {
style: "Text",
text: "The " + nodeAppDefinition.type + " node has the following menu items:"
}
renderParagraph(paragraph, key)
paragraphIndex++
for (let i = 0; i < nodeAppDefinition.menuItems.length; i++) {
let menuItem = nodeAppDefinition.menuItems[i]
HTML = HTML + '<button id="docs-menu-item-' + i + '" type="button" class="docs-collapsible-element"><img>' + menuItem.label + '</button>'
HTML = HTML + '<div class="docs-collapsible-content">'
paragraph = {
style: "Text",
text: 'The ' + menuItem.label + ' menu item has the following properties:'
}
renderParagraph(paragraph, key)
paragraphIndex++
for (const property in menuItem) {
paragraph = {
style: "List",
text: property + ": " + menuItem[property]
}
renderParagraph(paragraph, key)
paragraphIndex++
}
HTML = HTML + '</div>'
}
}
}
}