aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-14 11:07:21 -0800
committerValerio Virgillito2012-02-14 11:07:21 -0800
commitf060190a3bffd9a16718f2ce0499699103d46372 (patch)
treea308fe7eacec2156c8212dff0892a3de925d5f9a /js/lib
parentf766cc203f30ea43ae8b83cf4b65d45cc4435ee9 (diff)
parent33bc9d62b8e6694500bf14d5b18187bd99a520a3 (diff)
downloadninja-f060190a3bffd9a16718f2ce0499699103d46372.tar.gz
Merge branch 'FileIO' of https://github.com/joseeight/ninja-internal into integration
Diffstat (limited to 'js/lib')
-rwxr-xr-x[-rw-r--r--]js/lib/NJUtils.js18
-rwxr-xr-x[-rw-r--r--]js/lib/nj-base.js0
2 files changed, 18 insertions, 0 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js
index 0e886ae7..8daafa42 100644..100755
--- a/js/lib/NJUtils.js
+++ b/js/lib/NJUtils.js
@@ -227,8 +227,26 @@ exports.NJUtils = Object.create(Object.prototype, {
227 ///// Return the last part of a path (e.g. filename) 227 ///// Return the last part of a path (e.g. filename)
228 getFileNameFromPath : { 228 getFileNameFromPath : {
229 value: function(path) { 229 value: function(path) {
230 path = path.replace(/[/\\]$/g,"");
231 path = path.replace(/\\/g,"/");
230 return path.substr(path.lastIndexOf('/') + 1); 232 return path.substr(path.lastIndexOf('/') + 1);
231 } 233 }
234 },
235 /***
236 * file name validation
237 */
238 isValidFileName:{
239 value: function(fileName){
240 var status = false;
241 if(fileName !== ""){
242 fileName = fileName.replace(/^\s+|\s+$/g,"");
243 status = !(/[/\\]/g.test(fileName));
244 if(status && navigator.userAgent.indexOf("Macintosh") != -1){//for Mac files beginning with . are hidden
245 status = !(/^\./g.test(fileName));
246 }
247 }
248 return status;
249 }
232 } 250 }
233 251
234}); 252});
diff --git a/js/lib/nj-base.js b/js/lib/nj-base.js
index d1e1ff5b..d1e1ff5b 100644..100755
--- a/js/lib/nj-base.js
+++ b/js/lib/nj-base.js