diff options
author | Eric Guzman | 2012-02-22 23:19:45 -0800 |
---|---|---|
committer | Eric Guzman | 2012-02-22 23:19:45 -0800 |
commit | 9e8cd4448a6d0f809a55c3bdea8b45ed75339794 (patch) | |
tree | c7b5105153f17aedecd0669c611dbea44be7374c /js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js | |
parent | a5ee11857f923d3e49b44c0a8c480e9d0b026d5b (diff) | |
parent | 2afef244a3f8124f8a049e504e9782c05904ce23 (diff) | |
download | ninja-9e8cd4448a6d0f809a55c3bdea8b45ed75339794.tar.gz |
Merge branch 'refs/heads/master' into CSSPanelUpdates
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.js | 21 |
1 files changed, 19 insertions, 2 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 f5ab0027..11b322fe 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 | |||
@@ -386,8 +386,25 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
386 | } | 386 | } |
387 | }, | 387 | }, |
388 | checkFileExists:{ | 388 | checkFileExists:{ |
389 | value: function(fileUri, folderUri, fileType){ | 389 | value: function(fileName, folderUri, fileType){ |
390 | var status= this.application.ninja.coreIoApi.checkFileExists(fileUri, folderUri, fileType); | 390 | var uri = "", response=null, status=true; |
391 | //prepare absolute uri | ||
392 | if(/[^/\\]$/g.test(folderUri)){ | ||
393 | folderUri = folderUri + "/"; | ||
394 | } | ||
395 | if(!!fileType && (fileName.lastIndexOf(fileType) !== (fileName.length - fileType.length))){ | ||
396 | fileName = fileName+fileType; | ||
397 | } | ||
398 | uri = ""+folderUri+fileName; | ||
399 | response= this.application.ninja.coreIoApi.fileExists({"uri":uri}); | ||
400 | if(!!response && response.success && (response.status === 204)){ | ||
401 | status = true; | ||
402 | }else if(!!response && response.success && (response.status === 404)){ | ||
403 | status = false; | ||
404 | }else{ | ||
405 | status = false; | ||
406 | } | ||
407 | |||
391 | if(status){ | 408 | if(status){ |
392 | this.showError("! File already exists."); | 409 | this.showError("! File already exists."); |
393 | } | 410 | } |