diff options
author | Jose Antonio Marquez | 2012-02-13 16:57:52 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-13 16:57:52 -0800 |
commit | 79f7727ed077d054d791337d822c8e2259925084 (patch) | |
tree | f409fe261193dca124273b6ab1f6e9c06d3b3fe3 /js/io | |
parent | 5b55cfe0bc333a9a18be6329fdc21b5a6652a15a (diff) | |
parent | f3dc624fa464a79fd8e8cec1ddd16ed2109bda23 (diff) | |
download | ninja-79f7727ed077d054d791337d822c8e2259925084.tar.gz |
Merge branch 'refs/heads/AnanyaFileIO' into FileIO
Diffstat (limited to 'js/io')
-rw-r--r-- | js/io/system/chromeapi.js | 2 | ||||
-rw-r--r-- | js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js | 5 | ||||
-rw-r--r-- | js/io/ui/save-as-dialog.reel/save-as-dialog.js | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/js/io/system/chromeapi.js b/js/io/system/chromeapi.js index eee7409d..e53d4841 100644 --- a/js/io/system/chromeapi.js +++ b/js/io/system/chromeapi.js | |||
@@ -180,7 +180,7 @@ exports.ChromeApi = Montage.create(Object.prototype, { | |||
180 | //Checking for directory not to already exist | 180 | //Checking for directory not to already exist |
181 | this.fileSystem.root.getDirectory(directoryPath, {}, function(dir) { | 181 | this.fileSystem.root.getDirectory(directoryPath, {}, function(dir) { |
182 | if (callback) callback(false); | 182 | if (callback) callback(false); |
183 | return; //Directory already exists | 183 | return false; //Directory already exists |
184 | }); | 184 | }); |
185 | //Creating new directory | 185 | //Creating new directory |
186 | this.fileSystem.root.getDirectory(directoryPath, {create: true}, function(dir) { | 186 | this.fileSystem.root.getDirectory(directoryPath, {create: true}, function(dir) { |
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 f514b81a..848e0cb8 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 | |||
@@ -226,7 +226,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
226 | 226 | ||
227 | if(!!this.selectedProjectType && !!this.selectedTemplate | 227 | if(!!this.selectedProjectType && !!this.selectedTemplate |
228 | && this.isValidFileName(projectName) && this.isValidUri(projectDirectory) | 228 | && this.isValidFileName(projectName) && this.isValidUri(projectDirectory) |
229 | && !this.checkFileExists(projectName, projectDirectory, this.selectedProjectType) | 229 | && !this.checkFileExists(projectName, projectDirectory, fileExtension) |
230 | ){ | 230 | ){ |
231 | this.error.innerHTML=""; | 231 | this.error.innerHTML=""; |
232 | //console.log("$$$ new file selections: \n" + selectionlog); | 232 | //console.log("$$$ new file selections: \n" + selectionlog); |
@@ -258,7 +258,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
258 | this.popup.hide(); | 258 | this.popup.hide(); |
259 | } | 259 | } |
260 | }else{ | 260 | }else{ |
261 | if(this.error.innerHTML !== ""){ | 261 | if(this.error.innerHTML === ""){ |
262 | this.showError("! Project Template, Name and Directory should be valid."); | 262 | this.showError("! Project Template, Name and Directory should be valid."); |
263 | } | 263 | } |
264 | //disable ok | 264 | //disable ok |
@@ -328,7 +328,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
328 | 328 | ||
329 | if(!!this.selectedProjectType && !!this.selectedTemplate | 329 | if(!!this.selectedProjectType && !!this.selectedTemplate |
330 | && this.isValidFileName(this.newFileName) && this.isValidUri(this.newFileDirectory) | 330 | && this.isValidFileName(this.newFileName) && this.isValidUri(this.newFileDirectory) |
331 | && !this.checkFileExists(this.newFileName, this.newFileDirectory, this.newFileModel.projectTypeData[this.selectedProjectType.uri].fileExtension) | ||
332 | ){ | 331 | ){ |
333 | status = true; | 332 | status = true; |
334 | this.okButton.removeAttribute("disabled"); | 333 | this.okButton.removeAttribute("disabled"); |
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 4546e124..786ef5c9 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 | |||
@@ -89,7 +89,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { | |||
89 | 89 | ||
90 | enableOk:{ | 90 | enableOk:{ |
91 | value: function(){ | 91 | value: function(){ |
92 | if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri) && !this.checkFileExists(this.fileName, this.folderUri)){ | 92 | if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri)){ |
93 | this.okButton.removeAttribute("disabled"); | 93 | this.okButton.removeAttribute("disabled"); |
94 | this.error.innerHTML=""; | 94 | this.error.innerHTML=""; |
95 | } | 95 | } |
@@ -141,7 +141,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { | |||
141 | } | 141 | } |
142 | } | 142 | } |
143 | }else{ | 143 | }else{ |
144 | if(this.error.innerHTML !== ""){ | 144 | if(this.error.innerHTML === ""){ |
145 | this.showError("! Name and Location should be valid."); | 145 | this.showError("! Name and Location should be valid."); |
146 | } | 146 | } |
147 | //disable ok | 147 | //disable ok |