diff --git a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js index afb28ee2f..aa0a822e4 100644 --- a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js +++ b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js @@ -277,7 +277,7 @@ function newSuperalgosTutorialSpace() { if (newDocumentationURL === currentDocumentationURL) { return } currentDocumentationURL = newDocumentationURL - console.log('Trying to navigate to: ' + currentDocumentationURL + ' at ' + config.subTitle) + console.log('Trying to navigate to: ' + currentDocumentationURL + ' at ' + config.docs.type) // TODO UI.projects.superalgos.spaces.docsSpace.openSpaceAreaAndNavigateTo('Superalgos', 'Node', currentDocumentationURL) } } @@ -1109,212 +1109,6 @@ function newSuperalgosTutorialSpace() { } } - function buildDocument() { - - let nodeConfig = JSON.parse(currentNode.config) - if (nodeConfig.docs !== undefined) { return } - - if ( - (nodeConfig.title === undefined || nodeConfig.title === "") && - (nodeConfig.subTitle === undefined || nodeConfig.subTitle === "") && - (nodeConfig.gif === undefined || nodeConfig.gif === "") && - (nodeConfig.warning === undefined || nodeConfig.warning === "") - ) { - return - } - - PAGE_NUMBER = PAGE_NUMBER + 1 - const project = 'Superalgos' - - let type = 'Page Name' - - let template = { - tutorial: TUTORIAL_NAME, - pageNumber: PAGE_NUMBER, - type: '', - definition: { - icon: { - project: 'Superalgos', - name: nodeConfig.image - }, - text: "Write here a summary for this tutorial page." - }, - paragraphs: [ - - ] - } - - /**DEFINITION */ - if (nodeConfig.definition !== undefined && nodeConfig.definition !== "") { - template.definition.text = clean(nodeConfig.definition) - } - if (nodeConfig.summary !== undefined && nodeConfig.summary !== "") { - if (template.definition.text === 'Write here a summary for this tutorial page.') { - template.definition.text = nodeConfig.summary - } else { - template.definition.text = template.definition.text + ' ' + clean(nodeConfig.summary) - } - } - template.definition.text = template.definition.text.trim() - - /* TITLE and SUBTITLE HANDLING */ - - if (nodeConfig.title !== undefined && nodeConfig.title !== "") { - template.type = currentNode.type + ' - ' + nodeConfig.title - - if (nodeConfig.subTitle !== undefined && nodeConfig.subTitle !== '') { - let paragraph = { - style: 'Title', - text: clean(nodeConfig.subTitle) - } - template.paragraphs.push(paragraph) - } - } else { - template.type = currentNode.type + ' - ' + nodeConfig.subTitle - } - - - if (nodeConfig.bulletListIntro !== undefined && nodeConfig.bulletListIntro !== '') { - let paragraph = { - style: 'Text', - text: clean(nodeConfig.bulletListIntro) - } - template.paragraphs.push(paragraph) - } - if (nodeConfig.bulletArray !== undefined) { - for (let i = 0; i < nodeConfig.bulletArray.length; i++) { - let bullet = nodeConfig.bulletArray[i] - let paragraph = { - style: 'List', - text: clean(bullet[0]) + ' ' + clean(bullet[1]) - } - template.paragraphs.push(paragraph) - - } - } - if (nodeConfig.paragraph1 !== undefined && nodeConfig.paragraph1 !== '') { - let paragraph = { - style: 'Text', - text: clean(nodeConfig.paragraph1) - } - template.paragraphs.push(paragraph) - } - - if (nodeConfig.callOut !== undefined && nodeConfig.callOut !== '') { - let paragraph = { - style: 'Callout', - text: clean(nodeConfig.callOut) - } - template.paragraphs.push(paragraph) - } - - if (nodeConfig.externalLink !== undefined && nodeConfig.externalLink[0] !== "" && nodeConfig.externalLink[1] !== "") { - let paragraph = { - style: 'Link', - text: nodeConfig.externalLink[0] + '->' + nodeConfig.externalLink[1] - } - template.paragraphs.push(paragraph) - } - - if (nodeConfig.paragraph2 !== undefined && nodeConfig.paragraph2 !== '') { - let paragraph = { - style: 'Text', - text: clean(nodeConfig.paragraph2) - } - template.paragraphs.push(paragraph) - } - - if (nodeConfig.note !== undefined && nodeConfig.note !== '') { - let paragraph = { - style: 'Note', - text: clean(nodeConfig.note) - } - template.paragraphs.push(paragraph) - } - - if (nodeConfig.tip !== undefined && nodeConfig.tip !== '') { - let paragraph = { - style: 'Success', - text: clean(nodeConfig.tip) - } - template.paragraphs.push(paragraph) - } - - if (nodeConfig.important !== undefined && nodeConfig.important !== '') { - let paragraph = { - style: 'Important', - text: clean(nodeConfig.important) - } - template.paragraphs.push(paragraph) - } - - if (nodeConfig.warning !== undefined && nodeConfig.warning !== '') { - let paragraph = { - style: 'Warning', - text: clean(nodeConfig.warning) - } - template.paragraphs.push(paragraph) - } - - /**FULL SCREEN GIF */ - if (nodeConfig.gif !== undefined && nodeConfig.gif !== "") { - let type = nodeConfig.gif.replaceAll("-", " ") - type = UI.projects.superalgos.utilities.strings.allWordsToUpper(type) - template.type = currentNode.type + ' - ' + type - template.definition.text = "This step will play a video in full screen mode." - let paragraph = { - style: 'Gif', - text: 'GIFs/Superalgos/Tutorials/' + nodeConfig.gif + '.gif' - } - template.paragraphs.push(paragraph) - } - - SCHEMAS_BY_PROJECT.get(project).array.docsTutorialSchema.push(template) - - UI.projects.superalgos.spaces.docsSpace.navigateTo(project, 'Tutorial', template.type) - - /* Here we will store the keys to access the Content from the Docs */ - nodeConfig.docs = { - project: project, - category: 'Tutorial', - type: template.type - } - /* Deleting all the in-configuration content */ - nodeConfig.title = undefined - nodeConfig.subTitle = undefined - nodeConfig.gif = undefined - nodeConfig.definition = undefined - nodeConfig.summary = undefined - nodeConfig.bulletListIntro = undefined - nodeConfig.bulletArray = undefined - nodeConfig.paragraph1 = undefined - nodeConfig.paragraph2 = undefined - nodeConfig.note = undefined - nodeConfig.warning = undefined - nodeConfig.tip = undefined - nodeConfig.important = undefined - nodeConfig.callOut = undefined - - currentNode.config = JSON.stringify(nodeConfig, undefined, 4) - - function clean(text) { - let result = text - result = result - .replaceAll('->', '') - .replaceAll('', '') - .replaceAll('', '') - .replaceAll('', '') - .replaceAll('', '') - .replaceAll('', '') - .replaceAll('', '') - .replaceAll('', '') - .replaceAll('', '') - .trim() - return result - } - - } - function buildHTML() { newConfig = currentNode.config @@ -1331,8 +1125,6 @@ function newSuperalgosTutorialSpace() { transformDocsInfoIntoTutorialInfo() createTheHTML() - UI.projects.superalgos.spaces.docsSpace.navigateTo(nodeConfig.docs.project, 'Tutorial', nodeConfig.docs.type) - function transformDocsInfoIntoTutorialInfo() { if (schemaDocument === undefined) { title = "Configuration Error"