From 30aea189147f2c4e81497d78d9feb00fc3fc6a5c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 4 Jul 2021 19:25:53 +0200 Subject: [PATCH] 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) {