diff options
author | Nivesh Rajbhandari | 2012-02-22 10:34:46 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-02-22 10:34:46 -0800 |
commit | 50bb05efbafc9a80f069dfde32988e5cd6826865 (patch) | |
tree | 64332f1c2f22b5c0a17f6df2f9a02d77f1c87274 /js/io/ui/save-as-dialog.reel/save-as-dialog.js | |
parent | a69c929602e64f10fb3903b89a2ca9e9ed2c8dfb (diff) | |
parent | 2f24dafec79583547fe663d5a387d8ef15aae3bf (diff) | |
download | ninja-50bb05efbafc9a80f069dfde32988e5cd6826865.tar.gz |
Merge branch 'refs/heads/ninja-internal' into ToolFixes
Diffstat (limited to 'js/io/ui/save-as-dialog.reel/save-as-dialog.js')
-rw-r--r-- | js/io/ui/save-as-dialog.reel/save-as-dialog.js | 21 |
1 files changed, 19 insertions, 2 deletions
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 786ef5c9..55a09fa8 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 | |||
@@ -175,8 +175,25 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { | |||
175 | } | 175 | } |
176 | }, | 176 | }, |
177 | checkFileExists:{ | 177 | checkFileExists:{ |
178 | value: function(fileUri, folderUri, fileType){ | 178 | value: function(fileName, folderUri, fileType){ |
179 | var status= this.application.ninja.coreIoApi.checkFileExists(fileUri, folderUri, fileType); | 179 | var uri = "", response=null, status=true; |
180 | //prepare absolute uri | ||
181 | if(/[^/\\]$/g.test(folderUri)){ | ||
182 | folderUri = folderUri + "/"; | ||
183 | } | ||
184 | if(!!fileType && (fileName.lastIndexOf(fileType) !== (fileName.length - fileType.length))){ | ||
185 | fileName = fileName+fileType; | ||
186 | } | ||
187 | uri = ""+folderUri+fileName; | ||
188 | response= this.application.ninja.coreIoApi.fileExists({"uri":uri}); | ||
189 | if(!!response && response.success && (response.status === 204)){ | ||
190 | status = true; | ||
191 | }else if(!!response && response.success && (response.status === 404)){ | ||
192 | status = false; | ||
193 | }else{ | ||
194 | status = false; | ||
195 | } | ||
196 | |||
180 | if(status){ | 197 | if(status){ |
181 | this.showError("! File already exists."); | 198 | this.showError("! File already exists."); |
182 | } | 199 | } |