From a9c369c2e5d8f6fc8d936f7e1e6b84f693226ddf Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 16 Feb 2012 13:11:48 -0800 Subject: moved file picker in file io Signed-off-by: Ananya Sen --- js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/io/ui/new-file-dialog') 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 @@ }, "fileInputField":{ - "module": "js/components/ui/FilePicker/file-input-field.reel", + "module": "js/io/ui/file-picker/file-input-field.reel", "name": "FileInputField", "properties": { "element": {"#": "fileInputField"} -- cgit v1.2.3 From 4641dbefb6e8cb41f1f3d7f4d070d50bcaed94be Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 16 Feb 2012 17:32:57 -0800 Subject: remove similar function from coreioapi.js Signed-off-by: Ananya Sen --- .../new-file-options-navigator.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'js/io/ui/new-file-dialog') 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 } }, checkFileExists:{ - value: function(fileUri, folderUri, fileType){ - var status= this.application.ninja.coreIoApi.checkFileExists(fileUri, folderUri, fileType); + value: function(fileName, folderUri, fileType){ + var uri = "", response=null, status=true; + //prepare absolute uri + if(/[^/\\]$/g.test(folderUri)){ + folderUri = folderUri + "/"; + } + if(!!fileType && (fileName.lastIndexOf(fileType) !== (fileName.length - fileType.length))){ + fileName = fileName+fileType; + } + uri = ""+folderUri+fileName; + response= this.application.ninja.coreIoApi.fileExists({"uri":uri}); + if(!!response && response.success && (response.status === 204)){ + status = true; + }else if(!!response && response.success && (response.status === 404)){ + status = false; + }else{ + status = false; + } + if(status){ this.showError("! File already exists."); } -- cgit v1.2.3