Auto Generating Menu in Progress
This commit is contained in:
1 parent
df23843548
commit
0ed4c49c6a
1 file changed
+99
-21
@@ -509,6 +509,7 @@ function newSuperalgosDocSpace() {
|
||||
}
|
||||
}
|
||||
|
||||
autoGeneratedHtml()
|
||||
HTML = HTML + '</div>' // Content Ends
|
||||
HTML = HTML + '</div>' // Container Ends
|
||||
|
||||
@@ -517,7 +518,52 @@ function newSuperalgosDocSpace() {
|
||||
addProjectImage(project)
|
||||
|
||||
if (nodeDocsDefinition.definition !== undefined) {
|
||||
addDefinitionImage(nodeAppDefinition, objectBeingRendered.project)
|
||||
addDefinitionImage(objectBeingRendered.project)
|
||||
}
|
||||
|
||||
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]
|
||||
paragraph = {
|
||||
style:"Subtitle",
|
||||
text: menuItem.label
|
||||
}
|
||||
renderParagraph(paragraph, key)
|
||||
paragraphIndex++
|
||||
|
||||
paragraph = {
|
||||
style:"Text",
|
||||
text: menuItem.label + ' has the following properties:'
|
||||
}
|
||||
renderParagraph(paragraph, key)
|
||||
paragraphIndex++
|
||||
|
||||
paragraph = {
|
||||
style:"List",
|
||||
text: "Action: " + menuItem.action
|
||||
}
|
||||
renderParagraph(paragraph, key)
|
||||
paragraphIndex++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function renderParagraph(paragraph, key) {
|
||||
@@ -668,7 +714,7 @@ function newSuperalgosDocSpace() {
|
||||
}
|
||||
}
|
||||
|
||||
function addDefinitionImage(nodeAppDefinition, project) {
|
||||
function addDefinitionImage(project) {
|
||||
if (nodeAppDefinition.icon === undefined) {
|
||||
imageName = nodeAppDefinition.type.toLowerCase().replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-').replace(' ', '-')
|
||||
}
|
||||
@@ -730,19 +776,19 @@ function newSuperalgosDocSpace() {
|
||||
}
|
||||
|
||||
if (found === false && menuLabelsMap.get(cleanPhrase3) === true) {
|
||||
changedText = changedText + phrase4.replace(cleanPhrase3, '<i>' + cleanPhrase3 + '</i>') + ' '
|
||||
changedText = changedText + phrase3.replace(cleanPhrase3, '<i>' + cleanPhrase3 + '</i>') + ' '
|
||||
i = i + 2
|
||||
found = true
|
||||
}
|
||||
|
||||
if (found === false && menuLabelsMap.get(cleanPhrase2) === true) {
|
||||
changedText = changedText + phrase4.replace(cleanPhrase2, '<i>' + cleanPhrase2 + '</i>') + ' '
|
||||
changedText = changedText + phrase2.replace(cleanPhrase2, '<i>' + cleanPhrase2 + '</i>') + ' '
|
||||
i = i + 1
|
||||
found = true
|
||||
}
|
||||
|
||||
if (found === false && menuLabelsMap.get(cleanPhrase1) === true) {
|
||||
changedText = changedText + phrase4.replace(cleanPhrase1, '<i>' + cleanPhrase1 + '</i>') + ' '
|
||||
changedText = changedText + phrase1.replace(cleanPhrase1, '<i>' + cleanPhrase1 + '</i>') + ' '
|
||||
i = i + 0
|
||||
found = true
|
||||
}
|
||||
@@ -834,51 +880,83 @@ function newSuperalgosDocSpace() {
|
||||
let project = PROJECTS_ARRAY[j]
|
||||
|
||||
/* Search in docSchema */
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase4) !== undefined && cleanPhrase4 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase4, '->' + 'Node' + '|' + cleanPhrase4 + '|' + project + '->') + ' '
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase4) !== undefined) {
|
||||
if (cleanPhrase4 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase4, '->' + 'Node' + '|' + cleanPhrase4 + '|' + project + '->') + ' '
|
||||
} else {
|
||||
taggedText = taggedText + cleanPhrase4 + ' '
|
||||
}
|
||||
i = i + 3
|
||||
found = true
|
||||
break
|
||||
}
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase3) !== undefined && cleanPhrase3 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase3.replace(cleanPhrase3, '->' + 'Node' + '|' + cleanPhrase3 + '|' + project + '->') + ' '
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase3) !== undefined) {
|
||||
if (cleanPhrase3 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase3, '->' + 'Node' + '|' + cleanPhrase3 + '|' + project + '->') + ' '
|
||||
} else {
|
||||
taggedText = taggedText + cleanPhrase3 + ' '
|
||||
}
|
||||
i = i + 2
|
||||
found = true
|
||||
break
|
||||
}
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase2) !== undefined && cleanPhrase2 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase2.replace(cleanPhrase2, '->' + 'Node' + '|' + cleanPhrase2 + '|' + project + '->') + ' '
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase2) !== undefined) {
|
||||
if (cleanPhrase2 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase2, '->' + 'Node' + '|' + cleanPhrase2 + '|' + project + '->') + ' '
|
||||
} else {
|
||||
taggedText = taggedText + cleanPhrase2 + ' '
|
||||
}
|
||||
i = i + 1
|
||||
found = true
|
||||
break
|
||||
}
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase1) !== undefined && cleanPhrase1 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase1.replace(cleanPhrase1, '->' + 'Node' + '|' + cleanPhrase1 + '|' + project + '->') + ' '
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase1) !== undefined) {
|
||||
if (cleanPhrase1 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase1, '->' + 'Node' + '|' + cleanPhrase1 + '|' + project + '->') + ' '
|
||||
} else {
|
||||
taggedText = taggedText + cleanPhrase1 + ' '
|
||||
}
|
||||
found = true
|
||||
break
|
||||
}
|
||||
|
||||
/* Search in conceptSchema */
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase4) !== undefined && cleanPhrase4 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase4, '->' + 'Concept' + '|' + cleanPhrase4 + '|' + project + '->') + ' '
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase4) !== undefined) {
|
||||
if (cleanPhrase4 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase4, '->' + 'Concept' + '|' + cleanPhrase4 + '|' + project + '->') + ' '
|
||||
} else {
|
||||
taggedText = taggedText + cleanPhrase4 + ' '
|
||||
}
|
||||
i = i + 3
|
||||
found = true
|
||||
break
|
||||
}
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase3) !== undefined && cleanPhrase3 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase3.replace(cleanPhrase3, '->' + 'Concept' + '|' + cleanPhrase3 + '|' + project + '->') + ' '
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase3) !== undefined) {
|
||||
if (cleanPhrase3 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase3, '->' + 'Concept' + '|' + cleanPhrase3 + '|' + project + '->') + ' '
|
||||
} else {
|
||||
taggedText = taggedText + cleanPhrase3 + ' '
|
||||
}
|
||||
i = i + 2
|
||||
found = true
|
||||
break
|
||||
}
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase2) !== undefined && cleanPhrase2 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase2.replace(cleanPhrase2, '->' + 'Concept' + '|' + cleanPhrase2 + '|' + project + '->') + ' '
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase2) !== undefined) {
|
||||
if (cleanPhrase2 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase2, '->' + 'Concept' + '|' + cleanPhrase2 + '|' + project + '->') + ' '
|
||||
} else {
|
||||
taggedText = taggedText + cleanPhrase2 + ' '
|
||||
}
|
||||
i = i + 1
|
||||
found = true
|
||||
break
|
||||
}
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase1) !== undefined && cleanPhrase1 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase1.replace(cleanPhrase1, '->' + 'Concept' + '|' + cleanPhrase1 + '|' + project + '->') + ' '
|
||||
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase1) !== undefined) {
|
||||
if (cleanPhrase1 !== excludeNodesAndConceptTypes) {
|
||||
taggedText = taggedText + phrase4.replace(cleanPhrase1, '->' + 'Concept' + '|' + cleanPhrase1 + '|' + project + '->') + ' '
|
||||
} else {
|
||||
taggedText = taggedText + cleanPhrase1 + ' '
|
||||
}
|
||||
found = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user