aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
diff options
context:
space:
mode:
authorhwc4872012-04-13 11:52:13 -0700
committerhwc4872012-04-13 11:52:13 -0700
commit4f2fb5764703cab4ce3ada719b1395ed1e2f3b7c (patch)
tree3dc2e3c5a041179eed38eab1a00f851554e50005 /js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
parent521df0ed9242efff45715998837068c87aca7efd (diff)
parent4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff)
downloadninja-4f2fb5764703cab4ce3ada719b1395ed1e2f3b7c.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Snapping_II
Conflicts: js/helper-classes/3D/view-utils.js js/panels/presets/animations-presets.reel/animations-presets.js js/panels/presets/style-presets.reel/style-presets.js js/panels/presets/transitions-presets.reel/transitions-presets.js js/tools/Translate3DToolBase.js
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js')
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js46
1 files changed, 27 insertions, 19 deletions
diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
index 35c3b28e..1a26c99c 100644
--- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
+++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
@@ -145,6 +145,9 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
145 } 145 }
146 }, true); 146 }, true);
147 147
148 this.eventManager.addEventListener("enterKey", this, false);
149 this.eventManager.addEventListener("escKey", this, false);
150
148 } 151 }
149 152
150 }, 153 },
@@ -326,32 +329,36 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
326 329
327 handleNewFileDirectorySet:{ 330 handleNewFileDirectorySet:{
328 value:function(evt){ 331 value:function(evt){
329 if(evt.keyCode === 13){ 332 this.newFileDirectory = evt._event.newFileDirectory;
330 if(!this.okButton.hasAttribute("disabled")) this.handleOkButtonAction(evt); 333 if(this.isValidUri(this.newFileDirectory)){
331 }else if(evt.keyCode === 27){ 334 this.enableOk();
332 this.handleCancelButtonAction(evt);
333 }
334 else{
335 this.newFileDirectory = evt._event.newFileDirectory;
336 if(this.isValidUri(this.newFileDirectory)){
337 this.enableOk();
338 }
339 } 335 }
340 } 336 }
341 }, 337 },
342 338
343 handleNewFileNameSet:{ 339 handleNewFileNameSet:{
344 value:function(evt){ 340 value:function(evt){
345 if((evt.keyCode === 13) && !this.okButton.hasAttribute("disabled")){ 341 this.newFileName = evt._event.newFileName;
346 this.handleOkButtonAction(evt); 342 if(this.isValidFileName(this.newFileName)){
347 }else if(evt.keyCode === 27){ 343 this.enableOk();
348 this.handleCancelButtonAction(evt);
349 } 344 }
350 else{ 345 }
351 this.newFileName = evt._event.newFileName; 346 },
352 if(this.isValidFileName(this.newFileName)){ 347
353 this.enableOk(); 348 handleEnterKey:{
354 } 349 value: function(evt){
350 if((this.application.ninja.newFileController.newFileOptionsNav !== null)
351 && !this.okButton.hasAttribute("disabled")){
352
353 this.handleOkButtonAction(evt);
354 }
355 }
356 },
357
358 handleEscKey:{
359 value: function(evt){
360 if(this.application.ninja.newFileController.newFileOptionsNav !== null){
361 this.handleCancelButtonAction(evt);
355 } 362 }
356 } 363 }
357 }, 364 },
@@ -486,6 +493,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
486 var status = false; 493 var status = false;
487 if((fileName !== null) && (fileName !== "")){ 494 if((fileName !== null) && (fileName !== "")){
488 fileName = fileName.replace(/^\s+|\s+$/g,""); 495 fileName = fileName.replace(/^\s+|\s+$/g,"");
496 if(fileName === ""){return false;}
489 status = !(/[/\\]/g.test(fileName)); 497 status = !(/[/\\]/g.test(fileName));
490 if(status && navigator.userAgent.indexOf("Macintosh") != -1){//for Mac files beginning with . are hidden 498 if(status && navigator.userAgent.indexOf("Macintosh") != -1){//for Mac files beginning with . are hidden
491 status = !(/^\./g.test(fileName)); 499 status = !(/^\./g.test(fileName));