aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui
diff options
context:
space:
mode:
authorAnanya Sen2012-02-09 11:12:21 -0800
committerAnanya Sen2012-02-09 11:12:21 -0800
commitc9d0cb73698066247c6267bba8fa446a979565fb (patch)
tree8d706201eb23565e41e288c710e9ff8a83639113 /js/io/ui
parent04d375a02e44d1c11054ace16cd243ada8e6bd23 (diff)
downloadninja-c9d0cb73698066247c6267bba8fa446a979565fb.tar.gz
fixed templates descriptor, changed validation to on key up, fixed minor ui issues
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/ui')
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js4
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js9
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-controller.js2
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js12
4 files changed, 14 insertions, 13 deletions
diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
index 7da13dfc..fae8f9c7 100755
--- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
@@ -37,12 +37,12 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, {
37 37
38 this.fileInputField.selectDirectory = true; 38 this.fileInputField.selectDirectory = true;
39 39
40 this.newFileName.addEventListener("blur", function(evt){that.handleNewFileNameOnblur(evt);}, false); 40 this.newFileName.addEventListener("keyup", function(evt){that.handleNewFileNameOnkeyup(evt);}, false);
41 } 41 }
42 42
43 }, 43 },
44 44
45 handleNewFileNameOnblur:{ 45 handleNewFileNameOnkeyup:{
46 value:function(evt){ 46 value:function(evt){
47 if(this.newFileName.value !== ""){ 47 if(this.newFileName.value !== ""){
48 var newFileNameSetEvent = document.createEvent("Events"); 48 var newFileNameSetEvent = document.createEvent("Events");
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 2f148621..bcb9d123 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
@@ -217,8 +217,9 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
217 if(/[^/\\]$/g.test(projectDirectory)){ 217 if(/[^/\\]$/g.test(projectDirectory)){
218 projectDirectory = projectDirectory + "/"; 218 projectDirectory = projectDirectory + "/";
219 } 219 }
220 if(!!fileExtension && (projectName.lastIndexOf(fileExtension) !== (projectName.length - fileExtension.length))){ 220
221 projectName = projectName+fileExtension; 221 if(!!fileExtension && ((projectName.lastIndexOf(fileExtension) === -1) || (projectName.lastIndexOf(fileExtension) !== (projectName.length - fileExtension.length)))){
222 projectName = projectName+fileExtension;//append file extension if file extension is already not present or is actually part of the file name
222 } 223 }
223 newFilePath = "" + projectDirectory + projectName; 224 newFilePath = "" + projectDirectory + projectName;
224 225
@@ -367,7 +368,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
367 }, 368 },
368 isValidFileName:{ 369 isValidFileName:{
369 value: function(fileName){ 370 value: function(fileName){
370 var status = this.isValidFileName(fileName); 371 var status = this.validateFileName(fileName);
371 if(fileName !== ""){ 372 if(fileName !== ""){
372 if(!status){ 373 if(!status){
373 this.showError("! Invalid file name."); 374 this.showError("! Invalid file name.");
@@ -399,7 +400,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
399 /*** 400 /***
400 * file name validation 401 * file name validation
401 */ 402 */
402 isValidFileName:{ 403 validateFileName:{
403 value: function(fileName){ 404 value: function(fileName){
404 var status = false; 405 var status = false;
405 if(fileName !== ""){ 406 if(fileName !== ""){
diff --git a/js/io/ui/new-file-dialog/new-file-workflow-controller.js b/js/io/ui/new-file-dialog/new-file-workflow-controller.js
index 16075ecf..6cf2a2ae 100755
--- a/js/io/ui/new-file-dialog/new-file-workflow-controller.js
+++ b/js/io/ui/new-file-dialog/new-file-workflow-controller.js
@@ -44,7 +44,7 @@ var NewFileWorkflowController = exports.NewFileWorkflowController = Montage.cre
44 this.model.projectTypeData = this.loadDescriptor("js/io/templates/descriptor.json"); 44 this.model.projectTypeData = this.loadDescriptor("js/io/templates/descriptor.json");
45 45
46 //get default project type 46 //get default project type
47 this.model.defaultProjectType = "files/html.txt"; 47 this.model.defaultProjectType = "/js/io/templates/files/html.txt";
48 this.model.callback = data.callback || null; 48 this.model.callback = data.callback || null;
49 this.model.callbackScope = data.callbackScope || null; 49 this.model.callbackScope = data.callbackScope || null;
50 50
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js
index d1f1c26b..4546e124 100644
--- a/js/io/ui/save-as-dialog.reel/save-as-dialog.js
+++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js
@@ -54,7 +54,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
54 this.newFileName.value = this.fileName; 54 this.newFileName.value = this.fileName;
55 this.fileInputField.newFileDirectory.value = this.folderUri; 55 this.fileInputField.newFileDirectory.value = this.folderUri;
56 56
57 this.newFileName.addEventListener("blur", function(evt){self.handleNewFileNameOnblur(evt);}, false); 57 this.newFileName.addEventListener("keyup", function(evt){self.handleNewFileNameOnkeyup(evt);}, false);
58 this.eventManager.addEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false); 58 this.eventManager.addEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false);
59 59
60 this.okButton.addEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false); 60 this.okButton.addEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false);
@@ -68,18 +68,18 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
68 value:function(evt){ 68 value:function(evt){
69 if(!!evt._event.newFileDirectory){ 69 if(!!evt._event.newFileDirectory){
70 this.folderUri = evt._event.newFileDirectory; 70 this.folderUri = evt._event.newFileDirectory;
71 if(this.folderUri !== ""){ 71 if(this.isValidUri(this.folderUri)){
72 this.enableOk(); 72 this.enableOk();
73 } 73 }
74 } 74 }
75 } 75 }
76 }, 76 },
77 77
78 handleNewFileNameOnblur:{ 78 handleNewFileNameOnkeyup:{
79 value:function(evt){ 79 value:function(evt){
80 this.fileName = this.newFileName.value; 80 this.fileName = this.newFileName.value;
81 if(this.fileName !== ""){ 81 if(this.fileName !== ""){
82 if(this.fileName !== ""){ 82 if(this.isValidFileName(this.fileName)){
83 this.enableOk(); 83 this.enableOk();
84 } 84 }
85 } 85 }
@@ -165,7 +165,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
165 }, 165 },
166 isValidFileName:{ 166 isValidFileName:{
167 value: function(fileName){ 167 value: function(fileName){
168 var status = this.isValidFileName(fileName); 168 var status = this.validateFileName(fileName);
169 if(fileName !== ""){ 169 if(fileName !== ""){
170 if(!status){ 170 if(!status){
171 this.showError("! Invalid file name."); 171 this.showError("! Invalid file name.");
@@ -198,7 +198,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
198 /*** 198 /***
199 * file name validation 199 * file name validation
200 */ 200 */
201 isValidFileName:{ 201 validateFileName:{
202 value: function(fileName){ 202 value: function(fileName){
203 var status = false; 203 var status = false;
204 if(fileName !== ""){ 204 if(fileName !== ""){