diff options
author | Ananya Sen | 2012-02-02 12:37:29 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-02 12:37:29 -0800 |
commit | 0e595c4e11ce9b44eff157de8616ed15fcd5d6fc (patch) | |
tree | aba0df7f15b631345b9c44b6b50884d06b7a803a /js/io/system | |
parent | 87e247e74040b5e80ff40003d233d5317881102a (diff) | |
download | ninja-0e595c4e11ce9b44eff157de8616ed15fcd5d6fc.tar.gz |
refactoring some file names and locations,
change made to maintain only one codemirror div.
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/system')
-rwxr-xr-x | js/io/system/coreioapi.js | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 717606b5..7839acee 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js | |||
@@ -983,8 +983,35 @@ exports.CoreIoApi = Montage.create(Component, { | |||
983 | // | 983 | // |
984 | return retValue; | 984 | return retValue; |
985 | } | 985 | } |
986 | } | 986 | }, |
987 | //////////////////////////////////////////////////////////////////// | 987 | //////////////////////////////////////////////////////////////////// |
988 | /*** | ||
989 | * check if the file exists | ||
990 | */ | ||
991 | checkFileExists:{ | ||
992 | value: function(fileUri, folderUri, fileType){ | ||
993 | var uri = "", response=null, status=true; | ||
994 | |||
995 | //prepare absolute uri | ||
996 | if(/[^/\\]$/g.test(folderUri)){ | ||
997 | folderUri = folderUri + "/"; | ||
998 | } | ||
999 | |||
1000 | //todo:add file extension check if fileType present | ||
1001 | |||
1002 | uri = ""+folderUri+fileUri; | ||
1003 | |||
1004 | response = this.fileExists({"uri":uri}); | ||
1005 | if(!!response && response.success && (response.status === 204)){ | ||
1006 | status = true; | ||
1007 | }else if(!!response && response.success && (response.status === 404)){ | ||
1008 | status = false; | ||
1009 | }else{ | ||
1010 | status = false; | ||
1011 | } | ||
1012 | return status; | ||
1013 | } | ||
1014 | } | ||
988 | //////////////////////////////////////////////////////////////////// | 1015 | //////////////////////////////////////////////////////////////////// |
989 | }); | 1016 | }); |
990 | //////////////////////////////////////////////////////////////////////// | 1017 | //////////////////////////////////////////////////////////////////////// |