From e7c22b1311f68ed157dd06cbd73f890c33073134 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 4 Jul 2021 18:46:51 +0200 Subject: [PATCH] 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()