diff options
author | hwc487 | 2012-02-22 10:58:40 -0800 |
---|---|---|
committer | hwc487 | 2012-02-22 10:58:40 -0800 |
commit | 1a72686c9b915c488f9b430995787d2176671561 (patch) | |
tree | 849ca3d54f68c6c327c3daa240b48c7be6f73e91 /js/io/ui/new-file-dialog | |
parent | bb441ec8f8080cdaa52257a40531c62c47028667 (diff) | |
parent | 2f24dafec79583547fe663d5a387d8ef15aae3bf (diff) | |
download | ninja-1a72686c9b915c488f9b430995787d2176671561.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into integration
Diffstat (limited to 'js/io/ui/new-file-dialog')
-rwxr-xr-x | js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html | 2 | ||||
-rw-r--r-- | js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js | 21 |
2 files changed, 20 insertions, 3 deletions
diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html index 8c0327eb..7340251c 100755 --- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html +++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html | |||
@@ -51,7 +51,7 @@ | |||
51 | }, | 51 | }, |
52 | 52 | ||
53 | "fileInputField":{ | 53 | "fileInputField":{ |
54 | "module": "js/components/ui/FilePicker/file-input-field.reel", | 54 | "module": "js/io/ui/file-picker/file-input-field.reel", |
55 | "name": "FileInputField", | 55 | "name": "FileInputField", |
56 | "properties": { | 56 | "properties": { |
57 | "element": {"#": "fileInputField"} | 57 | "element": {"#": "fileInputField"} |
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 | } |