From 17512ff718b3fd8372dfeece608cd39548aab111 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 19 Oct 2020 11:33:07 +0200 Subject: [PATCH] Events Definitions --- Projects/ProjectsSchema.json | 59 +++++++++++++++---- .../Function-Libraries/ActionSwitch.js | 18 +++--- .../Superalgos/Spaces/Chat-Space/ChatSpace.js | 9 ++- .../Spaces/Design-Space/Workspace.js | 2 +- .../Spaces/Panel-Space/PanelSpace.js | 1 + .../Spaces/Tutorial-Space/TutorialSpace.js | 10 ++-- 6 files changed, 69 insertions(+), 30 deletions(-) diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 0978f2e2f..2a598a5ca 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -9,7 +9,11 @@ "propertyName": "floatingSpace", "functionName": "newSuperalgosFloatingSpace", "initializationIndex": 0, - "animationIndex": 1 + "animationIndex": 1, + "onMouseWheelIndex": 6, + "onMouseOverIndex": 8, + "onMouseClickIndex": 8, + "onMouseDownIndex": 8 }, { "name": "Top Space", @@ -17,7 +21,10 @@ "propertyName": "topSpace", "functionName": "newSuperalgosTopSpace", "initializationIndex": 1, - "animationIndex": 1 + "animationIndex": 8, + "onMouseOverIndex": 4, + "onMouseClickIndex": 4, + "onMouseDownIndex": 4 }, { "name": "Cockpit Space", @@ -25,7 +32,11 @@ "propertyName": "cockpitSpace", "functionName": "newSuperalgosCockpitSpace", "initializationIndex": 2, - "animationIndex": 0 + "animationIndex": 0, + "onMouseWheelIndex": 4, + "onMouseOverIndex": 5, + "onMouseClickIndex": 5, + "onMouseDownIndex": 5 }, { "name": "Design Space", @@ -33,7 +44,11 @@ "propertyName": "designSpace", "functionName": "newSuperalgosDesignSpace", "initializationIndex": 3, - "animationIndex": 3 + "animationIndex": 3, + "onMouseWheelIndex": 0, + "onMouseOverIndex": 3, + "onMouseClickIndex": 3, + "onMouseDownIndex": 3 }, { "name": "Panel Space", @@ -41,7 +56,11 @@ "propertyName": "panelSpace", "functionName": "newSuperalgosPanelSpace", "initializationIndex": 4, - "animationIndex": 4 + "animationIndex": 4, + "onMouseWheelIndex": 3, + "onMouseOverIndex": 6, + "onMouseClickIndex": 6, + "onMouseDownIndex": 6 }, { "name": "Charting Space", @@ -49,7 +68,11 @@ "propertyName": "chartingSpace", "functionName": "newSuperalgosChartingSpace", "initializationIndex": 5, - "animationIndex": 2 + "animationIndex": 2, + "onMouseWheelIndex": 5, + "onMouseOverIndex": 7, + "onMouseClickIndex": 7, + "onMouseDownIndex": 7 }, { "name": "Side Space", @@ -57,7 +80,11 @@ "propertyName": "sideSpace", "functionName": "newSuperalgosFloatingSpace", "initializationIndex": 6, - "animationIndex": 5 + "animationIndex": 5, + "onMouseWheelIndex": 2, + "onMouseOverIndex": 2, + "onMouseClickIndex": 2, + "onMouseDownIndex": 2 }, { "name": "Doc Space", @@ -65,23 +92,29 @@ "propertyName": "docSpace", "functionName": "newSuperalgosDocSpace", "initializationIndex": 7, - "animationIndex": 6 + "animationIndex": 6, + "onMouseWheelIndex": 1, + "onMouseOverIndex": 1, + "onMouseClickIndex": 1, + "onMouseDownIndex": 1 }, { "name": "Chat Space", "folderName": "Chat-Space", "propertyName": "chatSpace", - "functionName": "newSuperalgosChatSpace", - "initializationIndex": 8, - "animationIndex": 7 + "functionName": "newSuperalgosChatSpace" }, { "name": "Tutorial Space", "folderName": "Tutorial-Space", "propertyName": "tutorialSpace", "functionName": "newSuperalgosTutorialSpace", - "initializationIndex": 9, - "animationIndex": 8 + "initializationIndex": 8, + "animationIndex": 7, + "onMouseWheelIndex": 0, + "onMouseOverIndex": 0, + "onMouseClickIndex": 0, + "onMouseDownIndex": 0 } ] }, diff --git a/Projects/Superalgos/Function-Libraries/ActionSwitch.js b/Projects/Superalgos/Function-Libraries/ActionSwitch.js index d6b1d3000..4f1aabcfb 100644 --- a/Projects/Superalgos/Function-Libraries/ActionSwitch.js +++ b/Projects/Superalgos/Function-Libraries/ActionSwitch.js @@ -401,37 +401,37 @@ function newSuperalgosActionSwitch() { break case 'Play Tutorial': { - canvas.tutorialSpace.playTutorial(action.node) + UI.projects.superalgos.spaces.tutorialSpace.playTutorial(action.node) } break case 'Play Tutorial Topic': { - canvas.tutorialSpace.playTutorialTopic(action.node) + UI.projects.superalgos.spaces.tutorialSpace.playTutorialTopic(action.node) } break case 'Play Tutorial Step': { - canvas.tutorialSpace.playTutorialStep(action.node) + UI.projects.superalgos.spaces.tutorialSpace.playTutorialStep(action.node) } break case 'Resume Tutorial': { - canvas.tutorialSpace.resumeTutorial(action.node) + UI.projects.superalgos.spaces.tutorialSpace.resumeTutorial(action.node) } break case 'Resume Tutorial Topic': { - canvas.tutorialSpace.resumeTutorialTopic(action.node) + UI.projects.superalgos.spaces.tutorialSpace.resumeTutorialTopic(action.node) } break case 'Resume Tutorial Step': { - canvas.tutorialSpace.resumeTutorialStep(action.node) + UI.projects.superalgos.spaces.tutorialSpace.resumeTutorialStep(action.node) } break case 'Reset Tutorial Progress': { - canvas.tutorialSpace.resetTutorialProgress(action.node) + UI.projects.superalgos.spaces.tutorialSpace.resetTutorialProgress(action.node) } break case 'Send Webhook Test Message': @@ -492,7 +492,7 @@ function newSuperalgosActionSwitch() { let definition = getNodeDefinition(action.node) if (definition !== undefined) { if (definition.docURL !== undefined) { - canvas.docSpace.navigateTo(definition.docURL) + UI.projects.superalgos.spaces.docSpace.navigateTo(definition.docURL) } else { let headName = getHiriarchyHead(action.node).type headName = headName.toLowerCase() @@ -501,7 +501,7 @@ function newSuperalgosActionSwitch() { nodeName = nodeName.toLowerCase() nodeName = nodeName.split(" ").join("-") url = DOCUMENTATION_URL_PREFIX + "suite-hierarchy-" + headName + ".html#" + nodeName - canvas.docSpace.navigateTo(url) + UI.projects.superalgos.spaces.docSpace.navigateTo(url) } } } diff --git a/Projects/Superalgos/Spaces/Chat-Space/ChatSpace.js b/Projects/Superalgos/Spaces/Chat-Space/ChatSpace.js index 6a72c1676..ccce6a42a 100644 --- a/Projects/Superalgos/Spaces/Chat-Space/ChatSpace.js +++ b/Projects/Superalgos/Spaces/Chat-Space/ChatSpace.js @@ -84,9 +84,14 @@ function newSuperalgosChatSpace() { if (container !== undefined) { return container } if (thisObject.container.frame.isThisPointHere(point, true) === true) { - return thisObject.container + if (container.isWheelable === true) { + return thisObject.container + } else { + canvas.chartingSpace.viewport.onMouseWheel(event) + return + } } else { - return undefined + return } } diff --git a/Projects/Superalgos/Spaces/Design-Space/Workspace.js b/Projects/Superalgos/Spaces/Design-Space/Workspace.js index c2e917df7..f0f2bb16a 100644 --- a/Projects/Superalgos/Spaces/Design-Space/Workspace.js +++ b/Projects/Superalgos/Spaces/Design-Space/Workspace.js @@ -236,7 +236,7 @@ function newWorkspace() { switch (workingAtTask) { case 1: - canvas.tutorialSpace.stop() + UI.projects.superalgos.spaces.tutorialSpace.stop() executeAction({ node: thisObject.workspaceNode, name: 'Delete Workspace', project: 'Superalgos' }) workingAtTask++ break diff --git a/Projects/Superalgos/Spaces/Panel-Space/PanelSpace.js b/Projects/Superalgos/Spaces/Panel-Space/PanelSpace.js index 7a7fd4617..5a34f0811 100644 --- a/Projects/Superalgos/Spaces/Panel-Space/PanelSpace.js +++ b/Projects/Superalgos/Spaces/Panel-Space/PanelSpace.js @@ -353,6 +353,7 @@ function newSuperalgosPanelSpace() { function getContainer(point, purpose) { if (thisObject.visible !== true) { return } + if (purpose === GET_CONTAINER_PURPOSE.DRAGGING && point.shiftKey !== false) {return} let container /* diff --git a/Projects/Superalgos/Spaces/Tutorial-Space/TutorialSpace.js b/Projects/Superalgos/Spaces/Tutorial-Space/TutorialSpace.js index 15c9efdfa..dc3e07120 100644 --- a/Projects/Superalgos/Spaces/Tutorial-Space/TutorialSpace.js +++ b/Projects/Superalgos/Spaces/Tutorial-Space/TutorialSpace.js @@ -268,14 +268,14 @@ function newSuperalgosTutorialSpace() { /* This forces the tutorial to close the documentation panel and to keep it closed. */ - canvas.docSpace.sidePanelTab.close() + UI.projects.superalgos.spaces.docSpace.sidePanelTab.close() return } - canvas.docSpace.sidePanelTab.open() + UI.projects.superalgos.spaces.docSpace.sidePanelTab.open() if (newDocumentationURL === currentDocumentationURL) { return } currentDocumentationURL = newDocumentationURL - canvas.docSpace.navigateTo(currentDocumentationURL) + UI.projects.superalgos.spaces.docSpace.navigateTo(currentDocumentationURL) } } @@ -294,7 +294,7 @@ function newSuperalgosTutorialSpace() { This forces the tutorial to close the workspaces panel and to keep it closed. */ if (workspacesCounter === 5) { - canvas.sideSpace.sidePanelTab.close() + UI.projects.superalgos.spaces.sideSpace.sidePanelTab.close() } return } @@ -303,7 +303,7 @@ function newSuperalgosTutorialSpace() { This forces the tutorial to open the workspaces panel and to keep it closed. */ if (workspacesCounter === 5) { - canvas.sideSpace.sidePanelTab.open() + UI.projects.superalgos.spaces.sideSpace.sidePanelTab.open() } return }