From 725bb869618b9e0ebb2820a24bca5d1cf53a4810 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Thu, 15 Mar 2012 15:14:28 -0700 Subject: Initial Data Binding Mediator Signed-off-by: Armen Kesablyan --- js/mediators/binding-mediator.js | 14 ++++++++++++++ js/mediators/keyboard-mediator.js | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 js/mediators/binding-mediator.js (limited to 'js/mediators') diff --git a/js/mediators/binding-mediator.js b/js/mediators/binding-mediator.js new file mode 100644 index 00000000..10d3f7c6 --- /dev/null +++ b/js/mediators/binding-mediator.js @@ -0,0 +1,14 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage/core/core").Montage; +var Component = require("montage/ui/component").Component; + +exports.bindingMediator = Montage.create(Component, { + + + +}); \ No newline at end of file diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 65dd34cd..85a46739 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -203,6 +203,8 @@ exports.KeyboardMediator = Montage.create(Component, { } + + if((evt.keyCode == Keyboard.ENTER) && (evt.ctrlKey || evt.metaKey)) { this.application.ninja.executeChromePreview(); return; -- cgit v1.2.3 From 2557f463c1cfe2d0dd8ea187c184755bd141dab4 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 22 Mar 2012 10:38:44 -0700 Subject: IKNINJA-1302 : For File>New and File>SaveAll dialogs, 'ESC' key now triggers Cancel button and 'Enter' key now triggers OK button. For File picker, the 'ESC' now triggers the Cancel button. Signed-off-by: Ananya Sen Conflicts: js/io/ui/new-file-dialog/new-file-workflow-controller.js Signed-off-by: Ananya Sen --- js/mediators/keyboard-mediator.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'js/mediators') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 65dd34cd..63dcfa88 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -246,6 +246,35 @@ exports.KeyboardMediator = Montage.create(Component, { return; } + // check for ENTER key + if((evt.keyCode == Keyboard.ENTER) && !(evt.ctrlKey || evt.metaKey)) { + //new file + if((this.application.ninja.newFileController.newFileOptionsNav !== null) + && !this.application.ninja.newFileController.newFileOptionsNav.okButton.hasAttribute("disabled")){ + + this.application.ninja.newFileController.newFileOptionsNav.handleOkButtonAction(); + } + //save as + if((this.application.ninja.newFileController.saveAsDialog !== null) + && !this.application.ninja.newFileController.saveAsDialog.okButton.hasAttribute("disabled")){ + + this.application.ninja.newFileController.saveAsDialog.handleOkButtonAction(); + } + return; + } + //ESC key + if(evt.keyCode === Keyboard.ESCAPE){ + if(this.application.ninja.filePickerController.pickerNavChoices !== null){ + this.application.ninja.filePickerController.pickerNavChoices.handleCancelButtonAction(); + } + if(this.application.ninja.newFileController.newFileOptionsNav !== null){ + this.application.ninja.newFileController.newFileOptionsNav.handleCancelButtonAction(); + } + if(this.application.ninja.newFileController.saveAsDialog !== null){ + this.application.ninja.newFileController.saveAsDialog.handleCancelButtonAction(); + } + return; + } } }, -- cgit v1.2.3 From 80ceeffeb3dd3227008714b8b56383f9556ff409 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 22 Mar 2012 14:49:17 -0700 Subject: KNINJA-1302 : refactored fixed as per request Signed-off-by: Ananya Sen --- js/mediators/keyboard-mediator.js | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 63dcfa88..fc0d0f6a 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -245,37 +245,6 @@ exports.KeyboardMediator = Montage.create(Component, { //menuViewManagerModule.MenuViewManager.closeMenu("mainMenuBar"); return; } - - // check for ENTER key - if((evt.keyCode == Keyboard.ENTER) && !(evt.ctrlKey || evt.metaKey)) { - //new file - if((this.application.ninja.newFileController.newFileOptionsNav !== null) - && !this.application.ninja.newFileController.newFileOptionsNav.okButton.hasAttribute("disabled")){ - - this.application.ninja.newFileController.newFileOptionsNav.handleOkButtonAction(); - } - //save as - if((this.application.ninja.newFileController.saveAsDialog !== null) - && !this.application.ninja.newFileController.saveAsDialog.okButton.hasAttribute("disabled")){ - - this.application.ninja.newFileController.saveAsDialog.handleOkButtonAction(); - } - return; - } - //ESC key - if(evt.keyCode === Keyboard.ESCAPE){ - if(this.application.ninja.filePickerController.pickerNavChoices !== null){ - this.application.ninja.filePickerController.pickerNavChoices.handleCancelButtonAction(); - } - if(this.application.ninja.newFileController.newFileOptionsNav !== null){ - this.application.ninja.newFileController.newFileOptionsNav.handleCancelButtonAction(); - } - if(this.application.ninja.newFileController.saveAsDialog !== null){ - this.application.ninja.newFileController.saveAsDialog.handleCancelButtonAction(); - } - return; - } - } }, -- cgit v1.2.3 From 3a4ddfc232372d2d8d956778f060d8cabe316818 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Fri, 23 Mar 2012 14:37:39 -0700 Subject: Removing old code Signed-off-by: Armen Kesablyan --- js/mediators/binding-mediator.js | 14 -------------- js/mediators/keyboard-mediator.js | 2 -- 2 files changed, 16 deletions(-) delete mode 100644 js/mediators/binding-mediator.js (limited to 'js/mediators') diff --git a/js/mediators/binding-mediator.js b/js/mediators/binding-mediator.js deleted file mode 100644 index 10d3f7c6..00000000 --- a/js/mediators/binding-mediator.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - This file contains proprietary software owned by Motorola Mobility, Inc.
- No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
- (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ - -var Montage = require("montage/core/core").Montage; -var Component = require("montage/ui/component").Component; - -exports.bindingMediator = Montage.create(Component, { - - - -}); \ No newline at end of file diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 85a46739..65dd34cd 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -203,8 +203,6 @@ exports.KeyboardMediator = Montage.create(Component, { } - - if((evt.keyCode == Keyboard.ENTER) && (evt.ctrlKey || evt.metaKey)) { this.application.ninja.executeChromePreview(); return; -- cgit v1.2.3