From 1b2af54128985c1b622e13ea740a8402e57527cc Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 17:11:02 -0700 Subject: Temporarily skipping activeDocument.currentView check so keyboard shortcuts still work. Signed-off-by: Nivesh Rajbhandari --- js/mediators/keyboard-mediator.js | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index f8934669..49960f58 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -87,7 +87,8 @@ exports.KeyboardMediator = Montage.create(Component, { value: function(evt) { //keyboard controls for html design view - if((!!this.application.ninja.documentController.activeDocument) && (this.application.ninja.documentController.activeDocument.currentView === "design")){ + // TODO - New template mode doesn't set currentView yet. + if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){ // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { @@ -256,7 +257,7 @@ exports.KeyboardMediator = Montage.create(Component, { handleKeyup: { value: function(evt) { //keyboard controls for html design view - if((!!this.application.ninja.documentController.activeDocument) && (this.application.ninja.documentController.activeDocument.currentView === "design")){ + if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){ if(document.activeElement.nodeName !== "BODY") { // Don't do anything if an input or other control is focused return; @@ -265,31 +266,5 @@ exports.KeyboardMediator = Montage.create(Component, { if(this.application.ninja.toolsData) this.application.ninja.toolsData.selectedToolInstance.HandleKeyUp(evt); } } - }, - - _handleKeydown: { - value: function(evt) { - - // Check if cmd-shift-+/ctrl-shift-+ for toggling snapping - if(evt.shiftKey && (evt.ctrlKey || evt.metaKey) && (evt.keyCode === 187)) - { - MainMenuModule.MenuActionManager.toggleSnapping("snap", !DocumentManagerModule.DocumentManager.activeDocument.snapping); - evt.preventDefault(); - return; - } - - if(evt.keyCode === Keyboard.PLUS && (evt.metaKey||evt.ctrlKey)) { - evt.preventDefault(); - this._toolsList.action("zoomIn", evt); - return; - } - - if(evt.keyCode === Keyboard.MINUS && (evt.metaKey || evt.ctrlKey)) { - evt.preventDefault(); - this._toolsList.action("zoomOut", evt); - return; - } - - } } }); -- cgit v1.2.3 From 29ad6355ef60cfb3b3fc7f780504f3ed30845883 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Mon, 7 May 2012 14:30:47 -0700 Subject: More implementation of moving color chips to the individual subtools. Removed the tool color bar Added new icons for inkbottle Removed Pencil tool Removed Inkbottle tool Added chips to the pen, brush and tag tools Aligned controls in several subtools --- js/mediators/keyboard-mediator.js | 7 ------- 1 file changed, 7 deletions(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index f8934669..c647107f 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -179,13 +179,6 @@ exports.KeyboardMediator = Montage.create(Component, { return; } - // Shortcut for Eyedropper Tool is I - if(evt.keyCode === Keyboard.I && !(evt.ctrlKey || evt.metaKey)) { - evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[12]}); - return; - } - // Rotate Stage Tool is M if(evt.keyCode === Keyboard.M ) { evt.preventDefault(); -- cgit v1.2.3 From dd663d8fe9191cc57c9cebe6d425562cb45982c2 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Tue, 8 May 2012 07:25:09 -0700 Subject: Removed unused SubSelect Tool --- js/mediators/keyboard-mediator.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index c647107f..665e3ce7 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -110,35 +110,35 @@ exports.KeyboardMediator = Montage.create(Component, { // Shortcut for Selection Tool is V if(evt.keyCode === Keyboard.V) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[0]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex] }); return; } // Shortcut for Tag Tool is D if(evt.keyCode === Keyboard.D){ evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[4]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.tagToolIndex] }); return; } // Shortcut for Rotate Tool is W if(evt.keyCode === Keyboard.W){ evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[2]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.rotate3DToolIndex] }); return; } // Shortcut for Translate Tool is G if(evt.keyCode === Keyboard.G){ evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[3]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.translate3DToolIndex] }); return; } // shortcut for Pen tool is P if (evt.keyCode === Keyboard.P){ evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[5]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.penToolIndex] }); return; } @@ -147,24 +147,24 @@ exports.KeyboardMediator = Montage.create(Component, { // If the user is pressing the command key, they want to refresh the browser. if((evt.keyCode === Keyboard.R) && !evt.metaKey) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[7]}); - this.application.ninja.handleSelectSubTool({"detail": this.application.ninja.toolsData.defaultToolsData[7].subtools[1]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex] }); + this.application.ninja.handleSelectSubTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex].subtools[1] }); return; } // Shortcut for Oval Tool is O if(evt.keyCode === Keyboard.O) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[7]}); - this.application.ninja.handleSelectSubTool({"detail": this.application.ninja.toolsData.defaultToolsData[7].subtools[0]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex] }); + this.application.ninja.handleSelectSubTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex].subtools[0] }); return; } // Shortcut for Line Tool is L if(evt.keyCode === Keyboard.L ) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[7]}); - this.application.ninja.handleSelectSubTool({"detail": this.application.ninja.toolsData.defaultToolsData[7].subtools[2]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex] }); + this.application.ninja.handleSelectSubTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex].subtools[2] }); return; } @@ -172,9 +172,9 @@ exports.KeyboardMediator = Montage.create(Component, { if(evt.keyCode === Keyboard.K ) { evt.preventDefault(); if(this.application.ninja.toolsData.selectedTool.id === "FillTool") { - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[11]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.fillToolIndex] }); } else { - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[10]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.inkBottleToolIndex] }); } return; } @@ -182,21 +182,21 @@ exports.KeyboardMediator = Montage.create(Component, { // Rotate Stage Tool is M if(evt.keyCode === Keyboard.M ) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[13]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.rotateStage3DToolIndex] }); return; } // Hand tool if(evt.keyCode === Keyboard.H ) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[14]}); + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.panToolIndex]}); return; } // Zoom tool if((evt.keyCode === Keyboard.Z) && !(evt.ctrlKey || evt.metaKey) && !evt.shiftKey) {//ctrl or shift key not press with Z evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[15]}); + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.zoomToolIndex]}); return; } -- cgit v1.2.3 From 26c4d00b3e5d39c1c313d48433abebd06f386a85 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Wed, 16 May 2012 14:37:10 -0700 Subject: fixed bug with keyboard shortcut for fill/ink tool --- js/mediators/keyboard-mediator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 665e3ce7..029c0916 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -172,11 +172,13 @@ exports.KeyboardMediator = Montage.create(Component, { if(evt.keyCode === Keyboard.K ) { evt.preventDefault(); if(this.application.ninja.toolsData.selectedTool.id === "FillTool") { + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.inkBottleToolIndex] }); + } else if(this.application.ninja.toolsData.selectedTool.id === "InkBottleTool") { this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.fillToolIndex] }); } else { - this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.inkBottleToolIndex] }); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.fillToolIndex] }); } - return; + return; } // Rotate Stage Tool is M -- cgit v1.2.3 From fd54dabad7cbc27a0efb0957155c00d578912909 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 15:32:36 -0700 Subject: changing @change to propertyChangeListener Signed-off-by: Valerio Virgillito --- js/mediators/keyboard-mediator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 49960f58..243caf5c 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -67,7 +67,7 @@ exports.KeyboardMediator = Montage.create(Component, { document.addEventListener("keydown", this, false); document.addEventListener("keyup", this, false); - this.addEventListener("change@appModel.livePreview", this.handleLivePreview, false); + this.addPropertyChangeListener("appModel.livePreview", this.handleLivePreview, false); } }, -- cgit v1.2.3 From ee54342b5f4fdd41c46543d6402e649e4b3d57cb Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 22 May 2012 17:58:23 -0700 Subject: - don't redraw stage for code document - fixes a switching bug - fix for ctrl+S for code document - disallow opening the panels while in code document Signed-off-by: Ananya Sen --- js/mediators/keyboard-mediator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 23a2ce75..2f55edb4 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -88,7 +88,7 @@ exports.KeyboardMediator = Montage.create(Component, { //keyboard controls for html design view // TODO - New template mode doesn't set currentView yet. - if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){ + if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.model.currentView === "design")){ // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { -- cgit v1.2.3 From bf8a79b0ed1593b5b9e3085373dcdab9aeab055e Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 24 May 2012 10:46:28 -0700 Subject: Keyboard arrows were not working because some code had not been updated to check updated document model. Signed-off-by: Nivesh Rajbhandari --- js/mediators/keyboard-mediator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/mediators/keyboard-mediator.js') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 2f55edb4..e2e8e937 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -88,7 +88,7 @@ exports.KeyboardMediator = Montage.create(Component, { //keyboard controls for html design view // TODO - New template mode doesn't set currentView yet. - if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.model.currentView === "design")){ + if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.currentView === "design")) { // Don't do anything if an input or other control is focused if(document.activeElement.nodeName !== "BODY") { @@ -252,7 +252,7 @@ exports.KeyboardMediator = Montage.create(Component, { handleKeyup: { value: function(evt) { //keyboard controls for html design view - if((!!this.application.ninja.currentDocument)){// && (this.application.ninja.currentDocument.model.currentView === "design")){ + if((!!this.application.ninja.currentDocument) && (this.application.ninja.currentDocument.currentView === "design")) { if(document.activeElement.nodeName !== "BODY") { // Don't do anything if an input or other control is focused return; -- cgit v1.2.3