From e7c22b1311f68ed157dd06cbd73f890c33073134 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 4 Jul 2021 18:46:51 +0200 Subject: [PATCH 1/3] Shorcuts Improved --- Projects/Foundations/UI/Globals/Shorcuts.js | 9 +++++++ .../Token-Distribution-Superalgos.json | 10 ++++---- Projects/ProjectsSchema.json | 5 ++++ UI/Canvas.js | 24 +++++++++++++++---- 4 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 Projects/Foundations/UI/Globals/Shorcuts.js diff --git a/Projects/Foundations/UI/Globals/Shorcuts.js b/Projects/Foundations/UI/Globals/Shorcuts.js new file mode 100644 index 000000000..e00df5391 --- /dev/null +++ b/Projects/Foundations/UI/Globals/Shorcuts.js @@ -0,0 +1,9 @@ +function newFoundationsGlobalsShorcuts() { + let thisObject = { + TOGGLE_MAP_MODE: 'M', + TOGGLE_DRAW_REFERENCE_LINES: 'R', + TOGGLE_DRAW_PARENT_LINES: 'C', + SAVE_WORKSPACE: 'S' + } + return thisObject +} \ No newline at end of file diff --git a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json index a98182435..f5711b5ff 100644 --- a/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json +++ b/Projects/Governance/Plugins/Workspaces/Token-Distribution-Superalgos.json @@ -1,7 +1,7 @@ { "type": "Workspace", "name": "Token-Distribution-Superalgos", - "config": "{\n \"docsLanguage\": \"EN\",\n \"currentBranch\": \"develop\",\n \"contributionsBranch\": \"develop\"\n}", + "config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}", "rootNodes": [ { "type": "Design Space", @@ -148,7 +148,7 @@ "spaceSettings": { "type": "Space Settings", "name": "New Space Settings", - "config": "{\n \"indexContent\": true\n}", + "config": "{\n \"indexContent\": false\n}", "project": "Foundations", "id": "4124c674-c5fe-41d9-94b9-d669753188b7", "savedPayload": { @@ -782,7 +782,7 @@ { "type": "Plugin File", "name": "harrellbm", - "config": "{\"project\":\"Governance\",\"fileName\":\"harrellbm\",\"folderName\":\"User-Profiles\",\"nodeType\":\"User Profile\"}", + "config": "{\n \"project\": \"Governance\",\n \"fileName\": \"harrellbm\",\n \"folderName\": \"User-Profiles\",\n \"nodeType\": \"User Profile\"\n}", "project": "Foundations", "pluginFilePosition": { "type": "Plugin File Position", @@ -824,7 +824,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 @@ -1364,7 +1364,7 @@ "githubAPI": { "type": "Github API", "name": "New Github API", - "config": "{\n \"username\": \"Luis-Fernando-Molina\",\n \"token\": \"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\"\n}", + "config": "{\n \"username\": \"\",\n \"token\": \"\"\n}", "project": "Foundations", "id": "90d121ab-9f19-4437-a051-1222287085fc", "savedPayload": { diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 45d7cf427..b9ed173e2 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -8,6 +8,11 @@ "name": "Zoom", "propertyName": "zoom", "functionName": "newFoundationsGlobalsZoom" + }, + { + "name": "Shortcuts", + "propertyName": "shorcuts", + "functionName": "newFoundationsGlobalsShorcuts" } ], "functionLibraries": [ diff --git a/UI/Canvas.js b/UI/Canvas.js index 19dea6d81..724fac730 100644 --- a/UI/Canvas.js +++ b/UI/Canvas.js @@ -415,25 +415,41 @@ function newCanvas() { UI.projects.foundations.spaces.floatingSpace.exitMapMode() } - if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'M' || event.key === 'm')) { + if ( + event.shiftKey === true && + (event.ctrlKey === true || event.metaKey === true) && + (event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_MAP_MODE || event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_MAP_MODE.toLowerCase()) + ) { UI.projects.foundations.spaces.floatingSpace.toggleMapMode() event.preventDefault() return } - if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'R' || event.key === 'r')) { + if ( + event.shiftKey === true && + (event.ctrlKey === true || event.metaKey === true) && + (event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_DRAW_REFERENCE_LINES || event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_DRAW_REFERENCE_LINES.toLowerCase()) + ) { UI.projects.foundations.spaces.floatingSpace.toggleDrawReferenceLines() event.preventDefault() return } - if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'C' || event.key === 'c')) { + if ( + event.shiftKey === true && + (event.ctrlKey === true || event.metaKey === true) && + (event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_DRAW_PARENT_LINES || event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_DRAW_PARENT_LINES.toLowerCase()) + ) { UI.projects.foundations.spaces.floatingSpace.toggleDrawChainLines() event.preventDefault() return } - if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'S' || event.key === 's')) { + if ( + event.shiftKey === true && + (event.ctrlKey === true || event.metaKey === true) && + (event.key === UI.projects.foundations.globals.shorcuts.SAVE_WORKSPACE || event.key === UI.projects.foundations.globals.shorcuts.SAVE_WORKSPACE.toLowerCase()) + ) { UI.projects.foundations.spaces.designSpace.workspace.save() if (event.preventDefault !== undefined) { event.preventDefault() From 827dcbaee6a04970ba7839bdc80064b37d6b2d27 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 4 Jul 2021 19:01:58 +0200 Subject: [PATCH 2/3] Floating Space Settings --- Projects/Foundations/UI/Globals/Shorcuts.js | 3 ++- .../UI/Spaces/Charting-Space/EdgeEditor.js | 10 ++++--- .../UI/Spaces/Floating-Space/FloatingSpace.js | 26 ++++++++++++++++++- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Projects/Foundations/UI/Globals/Shorcuts.js b/Projects/Foundations/UI/Globals/Shorcuts.js index e00df5391..28910f405 100644 --- a/Projects/Foundations/UI/Globals/Shorcuts.js +++ b/Projects/Foundations/UI/Globals/Shorcuts.js @@ -3,7 +3,8 @@ function newFoundationsGlobalsShorcuts() { TOGGLE_MAP_MODE: 'M', TOGGLE_DRAW_REFERENCE_LINES: 'R', TOGGLE_DRAW_PARENT_LINES: 'C', - SAVE_WORKSPACE: 'S' + SAVE_WORKSPACE: 'S', + ADJUST_ASPECT_RATIO: 'A' } return thisObject } \ No newline at end of file diff --git a/Projects/Foundations/UI/Spaces/Charting-Space/EdgeEditor.js b/Projects/Foundations/UI/Spaces/Charting-Space/EdgeEditor.js index ee39b9429..1576ad2f0 100644 --- a/Projects/Foundations/UI/Spaces/Charting-Space/EdgeEditor.js +++ b/Projects/Foundations/UI/Spaces/Charting-Space/EdgeEditor.js @@ -186,9 +186,9 @@ function newEdgeEditor() { function onKeyPressed(event, forceExecution) { if (forceExecution !== true) { - if (whereIsMouseOver !== 'center' ) {return} + if (whereIsMouseOver !== 'center') { return } } - + const STEP = 10 if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowLeft') { @@ -228,7 +228,11 @@ function newEdgeEditor() { return } - if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'A' || event.key === 'a')) { + if ( + event.shiftKey === true && + (event.ctrlKey === true || event.metaKey === true) && + (event.key === UI.projects.foundations.globals.shorcuts.ADJUST_ASPECT_RATIO || event.key === UI.projects.foundations.globals.shorcuts.ADJUST_ASPECT_RATIO.toLowerCase()) + ) { resetAspectRatio() return } diff --git a/Projects/Foundations/UI/Spaces/Floating-Space/FloatingSpace.js b/Projects/Foundations/UI/Spaces/Floating-Space/FloatingSpace.js index d0808189e..f5fc08ef5 100644 --- a/Projects/Foundations/UI/Spaces/Floating-Space/FloatingSpace.js +++ b/Projects/Foundations/UI/Spaces/Floating-Space/FloatingSpace.js @@ -100,7 +100,14 @@ function newFoundationsFloatingSpace() { } }, physics: true, - detachUsingMouse: false + detachUsingMouse: false, + shortcuts: { + toggleMapMode: "M", + toggleDrawRelationshipLines: "R", + toggleDrawParentLines: "C", + saveWorkspace: "S", + adjustAspectRatio: "A" + } } return thisObject @@ -540,6 +547,23 @@ function newFoundationsFloatingSpace() { if (configSettings.detachUsingMouse !== undefined) { thisObject.settings.detachUsingMouse = configSettings.detachUsingMouse } + if (configSettings.shortcuts !== undefined) { + if (configSettings.shortcuts.toggleMapMode !== undefined) { + thisObject.settings.shortcuts.toggleMapMode = configSettings.shortcuts.toggleMapMode + } + if (configSettings.shortcuts.toggleDrawRelationshipLines !== undefined) { + thisObject.settings.shortcuts.toggleDrawRelationshipLines = configSettings.shortcuts.toggleDrawRelationshipLines + } + if (configSettings.shortcuts.toggleDrawParentLines !== undefined) { + thisObject.settings.shortcuts.toggleDrawParentLines = configSettings.shortcuts.toggleDrawParentLines + } + if (configSettings.shortcuts.saveWorkspace !== undefined) { + thisObject.settings.shortcuts.saveWorkspace = configSettings.shortcuts.saveWorkspace + } + if (configSettings.shortcuts.adjustAspectRatio !== undefined) { + thisObject.settings.shortcuts.adjustAspectRatio = configSettings.shortcuts.adjustAspectRatio + } + } } function positionContraintsPhysics() { From 30aea189147f2c4e81497d78d9feb00fc3fc6a5c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 4 Jul 2021 19:25:53 +0200 Subject: [PATCH 3/3] Shorcuts Improvements Finished --- .../Schemas/App-Schema/space-settings.json | 2 +- .../Space/Space-Settings/space-settings.json | 37 +++++++++++++++++++ Projects/Foundations/UI/Globals/Shorcuts.js | 10 ----- .../UI/Spaces/Charting-Space/EdgeEditor.js | 2 +- Projects/ProjectsSchema.json | 5 --- UI/Canvas.js | 8 ++-- 6 files changed, 43 insertions(+), 21 deletions(-) delete mode 100644 Projects/Foundations/UI/Globals/Shorcuts.js diff --git a/Projects/Foundations/Schemas/App-Schema/space-settings.json b/Projects/Foundations/Schemas/App-Schema/space-settings.json index 4607dbca5..079349f18 100644 --- a/Projects/Foundations/Schemas/App-Schema/space-settings.json +++ b/Projects/Foundations/Schemas/App-Schema/space-settings.json @@ -9,7 +9,7 @@ "config": true }, "initialValues": { - "config": "{\"node\":{\"distancePercentage\":60,\"radiusPercentage\":85,\"massPercentage\":100,\"animationSteps\":2,\"menuItem\":{\"widthPercentage\":100,\"heightPercentage\":60,\"radiusPercentage\":90}},\"physics\":false,\"detachUsingMouse\":false }" + "config": "{\"node\":{\"distancePercentage\":60,\"radiusPercentage\":85,\"massPercentage\":100,\"animationSteps\":2,\"menuItem\":{\"widthPercentage\":100,\"heightPercentage\":60,\"radiusPercentage\":90}},\"physics\":false,\"shortcuts\":{\"toggleMapMode\":\"M\",\"toggleDrawRelationshipLines\":\"R\",\"toggleDrawParentLines\":\"C\",\"saveWorkspace\":\"S\",\"adjustAspectRatio\":\"A\"}}" }, "menuItems": [ { diff --git a/Projects/Foundations/Schemas/Docs-Nodes/S/Space/Space-Settings/space-settings.json b/Projects/Foundations/Schemas/Docs-Nodes/S/Space/Space-Settings/space-settings.json index 704cea2c2..3d22433a6 100644 --- a/Projects/Foundations/Schemas/Docs-Nodes/S/Space/Space-Settings/space-settings.json +++ b/Projects/Foundations/Schemas/Docs-Nodes/S/Space/Space-Settings/space-settings.json @@ -59,6 +59,43 @@ { "style": "List", "text": "detachUsingMouse defines if you can detach nodes from it's parent or reference parents only using the mouse (when true) or if you can not use the mouse for that and can only do it using the detach buttons on the icon's menu (when false)." + }, + { + "style": "Subtitle", + "text": "Shorcut Properties" + }, + { + "style": "Text", + "text": "Shorcuts are key stroke combinations that helps users execute certain actions very quickly. To execute a shorcut users need to simultaniously press CTRL + SHIFT + a pre-defined key.", + "updated": 1625419324367 + }, + { + "style": "Success", + "text": "Shorcuts default values an be seen below. You can modify those values by changing the Config Properties listed below." + }, + { + "style": "List", + "text": "toggleMapMode defines which letter will be used as a Shorcut of entering and leaving the Map Mode." + }, + { + "style": "List", + "text": "toggleDrawRelationshipLines defines which letter will be used as a Shorcut for turning on and off the drawing of Reference Lines.", + "updated": 1625419127491 + }, + { + "style": "List", + "text": "toggleDrawParentLines defines which letter will be used as a Shorcut for turning on and off the drawing of Parent Lines.", + "updated": 1625419130924 + }, + { + "style": "List", + "text": "saveWorkspace defines which letter will be used as a Shorcut for saving the Workspace .", + "updated": 1625419134674 + }, + { + "style": "List", + "text": "adjustAspectRation defines which letter will be used as a Shorcut for forcing a Time Machine to adjust it's aspect ratio according to the size of the screen a user currently have.", + "updated": 1625419123375 } ] } \ No newline at end of file diff --git a/Projects/Foundations/UI/Globals/Shorcuts.js b/Projects/Foundations/UI/Globals/Shorcuts.js deleted file mode 100644 index 28910f405..000000000 --- a/Projects/Foundations/UI/Globals/Shorcuts.js +++ /dev/null @@ -1,10 +0,0 @@ -function newFoundationsGlobalsShorcuts() { - let thisObject = { - TOGGLE_MAP_MODE: 'M', - TOGGLE_DRAW_REFERENCE_LINES: 'R', - TOGGLE_DRAW_PARENT_LINES: 'C', - SAVE_WORKSPACE: 'S', - ADJUST_ASPECT_RATIO: 'A' - } - return thisObject -} \ No newline at end of file diff --git a/Projects/Foundations/UI/Spaces/Charting-Space/EdgeEditor.js b/Projects/Foundations/UI/Spaces/Charting-Space/EdgeEditor.js index 1576ad2f0..7ecc06ff7 100644 --- a/Projects/Foundations/UI/Spaces/Charting-Space/EdgeEditor.js +++ b/Projects/Foundations/UI/Spaces/Charting-Space/EdgeEditor.js @@ -231,7 +231,7 @@ function newEdgeEditor() { if ( event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && - (event.key === UI.projects.foundations.globals.shorcuts.ADJUST_ASPECT_RATIO || event.key === UI.projects.foundations.globals.shorcuts.ADJUST_ASPECT_RATIO.toLowerCase()) + (event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.adjustAspectRatio || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.adjustAspectRatio.toLowerCase()) ) { resetAspectRatio() return diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index b9ed173e2..45d7cf427 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -8,11 +8,6 @@ "name": "Zoom", "propertyName": "zoom", "functionName": "newFoundationsGlobalsZoom" - }, - { - "name": "Shortcuts", - "propertyName": "shorcuts", - "functionName": "newFoundationsGlobalsShorcuts" } ], "functionLibraries": [ diff --git a/UI/Canvas.js b/UI/Canvas.js index 724fac730..4c07da82b 100644 --- a/UI/Canvas.js +++ b/UI/Canvas.js @@ -418,7 +418,7 @@ function newCanvas() { if ( event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && - (event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_MAP_MODE || event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_MAP_MODE.toLowerCase()) + (event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleMapMode || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleMapMode.toLowerCase()) ) { UI.projects.foundations.spaces.floatingSpace.toggleMapMode() event.preventDefault() @@ -428,7 +428,7 @@ function newCanvas() { if ( event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && - (event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_DRAW_REFERENCE_LINES || event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_DRAW_REFERENCE_LINES.toLowerCase()) + (event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleDrawRelationshipLines || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleDrawRelationshipLines.toLowerCase()) ) { UI.projects.foundations.spaces.floatingSpace.toggleDrawReferenceLines() event.preventDefault() @@ -438,7 +438,7 @@ function newCanvas() { if ( event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && - (event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_DRAW_PARENT_LINES || event.key === UI.projects.foundations.globals.shorcuts.TOGGLE_DRAW_PARENT_LINES.toLowerCase()) + (event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleDrawParentLines || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleDrawParentLines.toLowerCase()) ) { UI.projects.foundations.spaces.floatingSpace.toggleDrawChainLines() event.preventDefault() @@ -448,7 +448,7 @@ function newCanvas() { if ( event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && - (event.key === UI.projects.foundations.globals.shorcuts.SAVE_WORKSPACE || event.key === UI.projects.foundations.globals.shorcuts.SAVE_WORKSPACE.toLowerCase()) + (event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.saveWorkspace || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.saveWorkspace.toLowerCase()) ) { UI.projects.foundations.spaces.designSpace.workspace.save() if (event.preventDefault !== undefined) {