aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
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 d6548871..74039e64 100644..100755
--- a/js/lib/NJUtils.js
+++ b/js/lib/NJUtils.js
@@ -206,8 +206,26 @@ exports.NJUtils = Object.create(Object.prototype, {
206 ///// Return the last part of a path (e.g. filename) 206 ///// Return the last part of a path (e.g. filename)
207 getFileNameFromPath : { 207 getFileNameFromPath : {
208 value: function(path) { 208 value: function(path) {
209 path = path.replace(/[/\\]$/g,"");
210 path = path.replace(/\\/g,"/");
209 return path.substr(path.lastIndexOf('/') + 1); 211 return path.substr(path.lastIndexOf('/') + 1);
210 } 212 }
213 },
214 /***
215 * file name validation
216 */
217 isValidFileName:{
218 value: function(fileName){
219 var status = false;
220 if(fileName !== ""){
221 fileName = fileName.replace(/^\s+|\s+$/g,"");
222 status = !(/[/\\]/g.test(fileName));
223 if(status && navigator.userAgent.indexOf("Macintosh") != -1){//for Mac files beginning with . are hidden
224 status = !(/^\./g.test(fileName));
225 }
226 }
227 return status;
228 }
211 } 229 }
212 230
213}); 231});
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