From 5c282291271a17de46e8a781995033aa8e98c44b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 4 Sep 2020 17:47:46 +0200 Subject: [PATCH] Tutorials --- .../FunctionLibraries/TutorialFunctions.js | 24 +++++++++++++++++++ DesignSpace/Workspace/Workspace.js | 6 +++++ 2 files changed, 30 insertions(+) create mode 100644 DesignSpace/Workspace/FunctionLibraries/TutorialFunctions.js diff --git a/DesignSpace/Workspace/FunctionLibraries/TutorialFunctions.js b/DesignSpace/Workspace/FunctionLibraries/TutorialFunctions.js new file mode 100644 index 000000000..49abd5e01 --- /dev/null +++ b/DesignSpace/Workspace/FunctionLibraries/TutorialFunctions.js @@ -0,0 +1,24 @@ +function newTutorialFunctions() { + thisObject = { + play: play + } + const HEIGHT = 800 + const WIDTH = 600 + const MARGIN = 300 + return thisObject + + function play(node) { + let docAppDiv = document.getElementById('tutorialStepDiv') + tutorialPosition = { + x: MARGIN, + y: (browserCanvas.height - HEIGHT) / 2 + } + + docAppDiv.style = ' ' + + 'position:fixed; top:' + tutorialPosition.y + 'px; ' + + 'left:' + tutorialPosition.x + 'px; ' + + 'width: ' + WIDTH + 'px;' + + 'height: ' + HEIGHT + 'px;' + + 'z-index:1;' + } +} diff --git a/DesignSpace/Workspace/Workspace.js b/DesignSpace/Workspace/Workspace.js index 875e0214c..2fb7c7976 100644 --- a/DesignSpace/Workspace/Workspace.js +++ b/DesignSpace/Workspace/Workspace.js @@ -69,6 +69,7 @@ function newWorkspace() { let functionLibraryDataMineFunctions = newDataMineFunctions() let functionLibraryDataStorageFunctions = newDataStorageFunctions() let functionLibraryChartingSpaceFunctions = newChartingSpaceFunctions() + let functionLibraryTutorialFunctions = newTutorialFunctions() thisObject.nodeChildren = newNodeChildren() @@ -635,6 +636,11 @@ function newWorkspace() { functionLibraryChartingSpaceFunctions.addAllDataMineLayers(payload.node, functionLibraryUiObjectsFromNodes) } break + case 'Play Tutorial': + { + functionLibraryTutorialFunctions.play(payload.node) + } + break case 'Send Webhook Test Message': { functionLibraryWebhookFunctions.sendTestMessage(payload.node, callBackFunction)