diff --git a/Spaces/TutorialSpace.js b/Spaces/TutorialSpace.js index 384dcf5b9..e21a2eebd 100644 --- a/Spaces/TutorialSpace.js +++ b/Spaces/TutorialSpace.js @@ -111,6 +111,7 @@ function newTutorialSpace() { checkGif() checkImage() checkDocumentation() + checkSlider() checkReference() return @@ -141,18 +142,63 @@ function newTutorialSpace() { } function checkDocumentation() { - if (currentNode === undefined) {return} + if (currentNode === undefined) { return } let config = JSON.parse(currentNode.config) let newDocumentationURL = config.documentationURL - if (newDocumentationURL === undefined || newDocumentationURL === "") { + if (newDocumentationURL === undefined) { + /* + The doc panel will remain as it is, and the user will be free to open or close it at will. + */ + return + } + if (newDocumentationURL === "") { + /* + This forces the tutorial to close the documentation panel and to keep it closed. + */ canvas.docSpace.sidePanelTab.close() + return } if (newDocumentationURL === currentDocumentationURL) { return } - + currentDocumentationURL = newDocumentationURL canvas.docSpace.navigateTo(currentDocumentationURL) } + function checkSlider() { + if (currentNode === undefined) { return } + let config = JSON.parse(currentNode.config) + if (config.slider === undefined) { + /* + The cockpit space will remain where it is. The user is free to move it. + */ + return + } + switch (config.slider) { + case "toTop": { + /* + This forces the tutorial to close the charting space and to keep it closed. + */ + canvas.cockpitSpace.toTop() + return + } + case "toMiddle": { + /* + This forces the tutorial to share the screen half with the designer and half + with the charting space and force it in that way. + */ + canvas.cockpitSpace.toMiddle() + return + } + case "toBottom": { + /* + This forces the tutorial to fully open the charting space and to keep it open. + */ + canvas.cockpitSpace.toBottom() + return + } + } + } + function checkReference() { /* If there is a reference parent defined, we will highlight it @@ -275,7 +321,7 @@ function newTutorialSpace() { function skip() { let tutorial = { - status:'Skipped' + status: 'Skipped' } saveTutorial(currentNode.payload, tutorial) advance() @@ -283,7 +329,7 @@ function newTutorialSpace() { function done() { let tutorial = { - status:'Done' + status: 'Done' } saveTutorial(currentNode.payload, tutorial) advance() @@ -329,7 +375,7 @@ function newTutorialSpace() { for (let i = 0; i < node.tutorialSteps.length; i++) { let tutorialStep = node.tutorialSteps[i] let tutorial = { - status:'Reset' + status: 'Reset' } saveTutorial(tutorialStep.payload, tutorial) } @@ -337,7 +383,7 @@ function newTutorialSpace() { for (let i = 0; i < node.tutorialTopics.length; i++) { let tutorialTopic = node.tutorialTopics[i] let tutorial = { - status:'Reset' + status: 'Reset' } saveTutorial(tutorialTopic.payload, tutorial) resetNextNode(tutorialTopic) @@ -472,14 +518,14 @@ function newTutorialSpace() { let nodeConfig = JSON.parse(currentNode.config) let html = '' if (nodeConfig.title !== undefined && nodeConfig.title !== '') { - html = html + '
' + nodeConfig.bulletListIntro + '
' + html = html + '' + nodeConfig.bulletListIntro + '
' } if (nodeConfig.bulletArray !== undefined) { html = html + '' + bullet[0] + ': ' + bullet[1] + '
' + html = html + '' + bullet[0] + ': ' + bullet[1] + '
' html = html + '' + nodeConfig.paragraph1 + '
' + html = html + '' + nodeConfig.paragraph1 + '
' } if (nodeConfig.callOut !== undefined && nodeConfig.callOut !== '') { - html = html + '' + nodeConfig.paragraph2 + '
' + html = html + '' + nodeConfig.paragraph2 + '
' } if (nodeConfig.paragraph2 !== undefined && nodeConfig.paragraph2 !== '') { - html = html + '' + nodeConfig.paragraph2 + '
' + html = html + '' + nodeConfig.paragraph2 + '
' } if (nodeConfig.note !== undefined && nodeConfig.note !== '') { - html = html + '