From c9c0aeaca7a8bf119eff6759dc243d2929100f72 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 9 Jun 2021 18:03:33 +0200 Subject: [PATCH] Docs and Tutorials completely separated into Education Project --- .../UI/Spaces/Blockchain-Space/Blockchain.js | 3 ++ .../Ethereum/UI/Spaces/Wallet-Space/Wallet.js | 3 ++ .../UI/Spaces/Assets-Space/Assets.js | 3 ++ .../UI/Spaces/Features-Space/Features.js | 3 ++ .../Governance/UI/Spaces/Pools-Space/Pools.js | 3 ++ .../UI/Spaces/Positions-Space/Positions.js | 5 +-- .../Spaces/User-Profile-Space/UserProfile.js | 3 ++ UI/Canvas.js | 34 +++++++++++++++---- 8 files changed, 48 insertions(+), 9 deletions(-) diff --git a/Projects/Ethereum/UI/Spaces/Blockchain-Space/Blockchain.js b/Projects/Ethereum/UI/Spaces/Blockchain-Space/Blockchain.js index 37f63d57e..2cc449ee5 100644 --- a/Projects/Ethereum/UI/Spaces/Blockchain-Space/Blockchain.js +++ b/Projects/Ethereum/UI/Spaces/Blockchain-Space/Blockchain.js @@ -12,6 +12,7 @@ function newEthereumBlockchainSpace() { thisObject.container = newContainer() thisObject.container.initialize(MODULE_NAME) + thisObject.container.isDraggeable = false let lastTryToReconnectDatetime @@ -166,6 +167,8 @@ function newEthereumBlockchainSpace() { function getContainer(point) { + return undefined // since this space does not draw anything we return here + if (thisObject.container.frame.isThisPointHere(point, true) === true) { thisObject.container.space = MODULE_NAME return thisObject.container diff --git a/Projects/Ethereum/UI/Spaces/Wallet-Space/Wallet.js b/Projects/Ethereum/UI/Spaces/Wallet-Space/Wallet.js index 66bdb9de4..4ff03d2e1 100644 --- a/Projects/Ethereum/UI/Spaces/Wallet-Space/Wallet.js +++ b/Projects/Ethereum/UI/Spaces/Wallet-Space/Wallet.js @@ -12,6 +12,7 @@ function newEthereumWalletSpace() { thisObject.container = newContainer() thisObject.container.initialize(MODULE_NAME) + thisObject.container.isDraggeable = false let lastTryToReconnectDatetime @@ -149,6 +150,8 @@ function newEthereumWalletSpace() { function getContainer(point) { + return undefined // since this space does not draw anything we return here + if (thisObject.container.frame.isThisPointHere(point, true) === true) { thisObject.container.space = MODULE_NAME return thisObject.container diff --git a/Projects/Governance/UI/Spaces/Assets-Space/Assets.js b/Projects/Governance/UI/Spaces/Assets-Space/Assets.js index 0c89e6858..a732735a8 100644 --- a/Projects/Governance/UI/Spaces/Assets-Space/Assets.js +++ b/Projects/Governance/UI/Spaces/Assets-Space/Assets.js @@ -12,6 +12,7 @@ function newGobernanceAssetsSpace() { thisObject.container = newContainer() thisObject.container.initialize(MODULE_NAME) + thisObject.container.isDraggeable = false return thisObject @@ -30,6 +31,8 @@ function newGobernanceAssetsSpace() { function getContainer(point) { + return undefined // since this space does not draw anything we return here + if (thisObject.container.frame.isThisPointHere(point, true) === true) { thisObject.container.space = MODULE_NAME return thisObject.container diff --git a/Projects/Governance/UI/Spaces/Features-Space/Features.js b/Projects/Governance/UI/Spaces/Features-Space/Features.js index 7cc992169..135373ac6 100644 --- a/Projects/Governance/UI/Spaces/Features-Space/Features.js +++ b/Projects/Governance/UI/Spaces/Features-Space/Features.js @@ -12,6 +12,7 @@ function newGovernanceFeaturesSpace() { thisObject.container = newContainer() thisObject.container.initialize(MODULE_NAME) + thisObject.container.isDraggeable = false return thisObject @@ -30,6 +31,8 @@ function newGovernanceFeaturesSpace() { function getContainer(point) { + return undefined // since this space does not draw anything we return here + if (thisObject.container.frame.isThisPointHere(point, true) === true) { thisObject.container.space = MODULE_NAME return thisObject.container diff --git a/Projects/Governance/UI/Spaces/Pools-Space/Pools.js b/Projects/Governance/UI/Spaces/Pools-Space/Pools.js index 7163bc864..cb0f8e68d 100644 --- a/Projects/Governance/UI/Spaces/Pools-Space/Pools.js +++ b/Projects/Governance/UI/Spaces/Pools-Space/Pools.js @@ -12,6 +12,7 @@ function newGovernancePoolsSpace() { thisObject.container = newContainer() thisObject.container.initialize(MODULE_NAME) + thisObject.container.isDraggeable = false return thisObject @@ -26,6 +27,8 @@ function newGovernancePoolsSpace() { function getContainer(point) { + return undefined // since this space does not draw anything we return here + if (thisObject.container.frame.isThisPointHere(point, true) === true) { thisObject.container.space = MODULE_NAME return thisObject.container diff --git a/Projects/Governance/UI/Spaces/Positions-Space/Positions.js b/Projects/Governance/UI/Spaces/Positions-Space/Positions.js index 2147cc234..445479d8b 100644 --- a/Projects/Governance/UI/Spaces/Positions-Space/Positions.js +++ b/Projects/Governance/UI/Spaces/Positions-Space/Positions.js @@ -12,8 +12,7 @@ function newGovernancePositionsSpace() { thisObject.container = newContainer() thisObject.container.initialize(MODULE_NAME) - - let lastTryToReconnectDatetime + thisObject.container.isDraggeable = false return thisObject @@ -32,6 +31,8 @@ function newGovernancePositionsSpace() { function getContainer(point) { + return undefined // since this space does not draw anything we return here + if (thisObject.container.frame.isThisPointHere(point, true) === true) { thisObject.container.space = MODULE_NAME return thisObject.container diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 2984cef22..8637ef67f 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -12,6 +12,7 @@ function newGovernanceUserProfileSpace() { thisObject.container = newContainer() thisObject.container.initialize(MODULE_NAME) + thisObject.container.isDraggeable = false return thisObject @@ -26,6 +27,8 @@ function newGovernanceUserProfileSpace() { function getContainer(point) { + return undefined // since this space does not draw anything we return here + if (thisObject.container.frame.isThisPointHere(point, true) === true) { thisObject.container.space = MODULE_NAME return thisObject.container diff --git a/UI/Canvas.js b/UI/Canvas.js index 963ed7e01..ecad9b59e 100644 --- a/UI/Canvas.js +++ b/UI/Canvas.js @@ -380,7 +380,7 @@ function newCanvas() { return } /* When the Docs is Visible, we do not process key down events of the Designer Space. */ - if (UI.projects.education.spaces.docsSpace.isVisible === true) { + if (UI.projects.education !== undefined && UI.projects.education.spaces.docsSpace.isVisible === true) { return } thisObject.mouse.event = event @@ -388,8 +388,8 @@ function newCanvas() { checkMediaRecording(event) - event.x = thisObject.mouse.position.x - event.y = thisObject.mouse.position.y + event.x = thisObject.mouse.position.x + event.y = thisObject.mouse.position.y UI.projects.superalgos.spaces.chartingSpace.onKeyPressed(event) @@ -716,10 +716,15 @@ function newCanvas() { and we are going to query each space to see if they have the container that is at the mouse position. We will order firt the spaces by the sequence order defined at the project schema specifically for this mouse event. + + The order of the projects for events evaluations has intentionally been inverted, + because the latest project is drwan the last, on top of the others, that means that + events should belong to the last first. */ - for (let i = 0; i < PROJECTS_SCHEMA.length; i++) { + for (let i = PROJECTS_SCHEMA.length - 1; i >= 0; i--) { let projectDefinition = PROJECTS_SCHEMA[i] let projectInstance = UI.projects[projectDefinition.propertyName] + if (projectInstance === undefined) { continue } for (let j = 0; j < projectDefinition.UI.spaces.length; j++) { let spaceInstance = projectInstance.events.onMouseDownMap.get(j) @@ -819,10 +824,15 @@ function newCanvas() { and we are going to query each space to see if they have the container that is at the mouse position. We will order firt the spaces by the sequence order defined at the project schema specifically for this mouse event. + + The order of the projects for events evaluations has intentionally been inverted, + because the latest project is drwan the last, on top of the others, that means that + events should belong to the last first. */ - for (let i = 0; i < PROJECTS_SCHEMA.length; i++) { + for (let i = PROJECTS_SCHEMA.length - 1; i >= 0; i--) { let projectDefinition = PROJECTS_SCHEMA[i] let projectInstance = UI.projects[projectDefinition.propertyName] + if (projectInstance === undefined) { continue } for (let j = 0; j < projectDefinition.UI.spaces.length; j++) { let spaceInstance = projectInstance.events.onMouseClickMap.get(j) @@ -930,10 +940,15 @@ function newCanvas() { and we are going to query each space to see if they have the container that is at the mouse position. We will order firt the spaces by the sequence order defined at the project schema specifically for this mouse event. + + The order of the projects for events evaluations has intentionally been inverted, + because the latest project is drwan the last, on top of the others, that means that + events should belong to the last first. */ - for (let i = 0; i < PROJECTS_SCHEMA.length; i++) { + for (let i = PROJECTS_SCHEMA.length - 1; i >= 0; i--) { let projectDefinition = PROJECTS_SCHEMA[i] let projectInstance = UI.projects[projectDefinition.propertyName] + if (projectInstance === undefined) { continue } for (let j = 0; j < projectDefinition.UI.spaces.length; j++) { let spaceInstance = projectInstance.events.onMouseOverMap.get(j) @@ -987,10 +1002,15 @@ function newCanvas() { and we are going to query each space to see if they have the container that is at the mouse position. We will order firt the spaces by the sequence order defined at the project schema specifically for this mouse event. + + The order of the projects for events evaluations has intentionally been inverted, + because the latest project is drwan the last, on top of the others, that means that + events should belong to the last first. */ - for (let i = 0; i < PROJECTS_SCHEMA.length; i++) { + for (let i = PROJECTS_SCHEMA.length - 1; i >= 0; i--) { let projectDefinition = PROJECTS_SCHEMA[i] let projectInstance = UI.projects[projectDefinition.propertyName] + if (projectInstance === undefined) { continue } for (let j = 0; j < projectDefinition.UI.spaces.length; j++) { let spaceInstance = projectInstance.events.onMouseWheelMap.get(j)