From baac911a93b2531f0676aad6853c0799b74c4d47 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 9 Jan 2021 14:35:07 +0100 Subject: [PATCH] Getting Started Checked --- .../UI/Spaces/Tutorial-Space/TutorialSpace.js | 76 ++++++++++++------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js index f46b8034b..9b5129880 100644 --- a/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js +++ b/Projects/Superalgos/UI/Spaces/Tutorial-Space/TutorialSpace.js @@ -50,6 +50,7 @@ function newSuperalgosTutorialSpace() { let htmlImage = document.createElement("IMG") let currentImageName = 'Never Set' let newImageName = 'Never Set' + let newImageProject = 'Never Set' let currentConfig let newConfig let currentDocumentationURL @@ -231,7 +232,7 @@ function newSuperalgosTutorialSpace() { if (currentGifName === newGifName) { return } currentGifName = newGifName - htmlGif.src = 'GIFs/' + currentNode.project + '/Tutorials/' + currentGifName + '.gif' + htmlGif.src = currentGifName htmlGif.width = "400" htmlGif.height = "580" } @@ -242,14 +243,11 @@ function newSuperalgosTutorialSpace() { tutorialImageDiv.appendChild(htmlImage) } + if (newImageName === undefined) { return } if (currentImageName === newImageName) { return } currentImageName = newImageName - let webParam - if (currentImageName.indexOf('/') >= 0) { - webParam = 'Icons/' + currentImageName + '.png' - } else { - webParam = 'Icons/' + 'Superalgos' + '/' + currentImageName + '.png' - } + let webParam = 'Icons/' + newImageProject + '/' + newImageName + '.png' + htmlImage.src = webParam htmlImage.width = "100" htmlImage.height = "100" @@ -1329,7 +1327,7 @@ function newSuperalgosTutorialSpace() { if (nodeConfig.docs === undefined) { return } let schemaDocument = SCHEMAS_BY_PROJECT.get(project).map.docsTutorialSchema.get(nodeConfig.docs.type) - let title + let title transformDocsInfoIntoTutorialInfo() createTheHTML() @@ -1355,31 +1353,52 @@ function newSuperalgosTutorialSpace() { } function createTheHTML() { + let fullscreenMode = false let html = '' - html = html + '

' + title + '

' + + /* Check for Full Screen Mode */ + for (let i = 0; i < schemaDocument.paragraphs.length; i++) { + let paragraph = schemaDocument.paragraphs[i] + if (paragraph.style === 'Gif') { + fullscreenMode = true + } + } + if (schemaDocument.definition !== undefined && schemaDocument.definition.text !== '') { + if (schemaDocument.definition.text.indexOf('full screen mode') >= 0) { + fullscreenMode = true + } + } + + if (fullscreenMode === false) { + html = html + '

' + title + '

' + } + html = html + '
' if (schemaDocument.definition !== undefined && schemaDocument.definition.text !== '') { - html = html + '' - html = html + '' - html = html + '' - html = html + '' + html = html + '' + html = html + '
' - if (schemaDocument.icon !== undefined && schemaDocument.icon.name !== '') { - html = html + '
' - newImageName = schemaDocument.icon.name - } - html = html + '
' - - let text = schemaDocument.definition.text - text = UI.projects.superalgos.utilities.docs.addKeyboard(text) - text = UI.projects.superalgos.utilities.docs.addCodeToCamelCase(text) - text = UI.projects.superalgos.utilities.docs.addCodeToWhiteList(text) - text = UI.projects.superalgos.utilities.docs.addToolTips(text) + if (fullscreenMode === false) { + html = html + '' + html = html + '' + html = html + '' + html = html + '' - html = html + '' - html = html + '
' + if (schemaDocument.definition.icon !== undefined && schemaDocument.definition.icon.name !== '') { + html = html + '
' + newImageName = schemaDocument.definition.icon.name + newImageProject = schemaDocument.definition.icon.project + } + html = html + '
' - html = html + '' + text + '' - html = html + '
' + let text = schemaDocument.definition.text + text = UI.projects.superalgos.utilities.docs.addKeyboard(text) + text = UI.projects.superalgos.utilities.docs.addCodeToCamelCase(text) + text = UI.projects.superalgos.utilities.docs.addCodeToWhiteList(text) + text = UI.projects.superalgos.utilities.docs.addToolTips(text) + + html = html + '' + text + '' + html = html + '
' + } } for (let i = 0; i < schemaDocument.paragraphs.length; i++) { @@ -1419,6 +1438,7 @@ function newSuperalgosTutorialSpace() { text = UI.projects.superalgos.utilities.docs.addKeyboard(text) text = UI.projects.superalgos.utilities.docs.addCodeToCamelCase(text) text = UI.projects.superalgos.utilities.docs.addCodeToWhiteList(text) + text = UI.projects.superalgos.utilities.docs.addBold(text) text = UI.projects.superalgos.utilities.docs.addToolTips(text) html = html + '
  • ' + text + '
  • ' break