diff options
author | Ananya Sen | 2012-02-03 09:49:23 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-03 09:49:23 -0800 |
commit | 79b0173eeca079dec42ff1480182656dbe3af44f (patch) | |
tree | 3fe750230fd154f5535ba19aa56f4a715b767c63 /js/io/ui/new-file-dialog/new-file-options-navigator.reel | |
parent | 6890662caba94598675679f40dbb725301c93e98 (diff) | |
download | ninja-79b0173eeca079dec42ff1480182656dbe3af44f.tar.gz |
removed usage of NJUtils.js as it is being deleted.
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-options-navigator.reel')
-rw-r--r-- | js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js | 24 |
1 files changed, 20 insertions, 4 deletions
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 467c5452..f17b15d5 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 | |||
@@ -8,8 +8,7 @@ var Montage = require("montage/core/core").Montage, | |||
8 | Component = require("montage/ui/component").Component, | 8 | Component = require("montage/ui/component").Component, |
9 | iconsListModule = require("js/components/ui/icon-list-basic/iconsList.reel"), | 9 | iconsListModule = require("js/components/ui/icon-list-basic/iconsList.reel"), |
10 | treeModule = require("js/components/ui/tree-basic/tree.reel"), | 10 | treeModule = require("js/components/ui/tree-basic/tree.reel"), |
11 | newFileLocationSelectionModule = require("js/io/ui/new-file-dialog/new-file-workflow-controller"), | 11 | newFileLocationSelectionModule = require("js/io/ui/new-file-dialog/new-file-workflow-controller"); |
12 | nj= require("js/lib/NJUtils.js").NJUtils; | ||
13 | 12 | ||
14 | var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(Component, { | 13 | var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(Component, { |
15 | 14 | ||
@@ -364,7 +363,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
364 | }, | 363 | }, |
365 | isValidFileName:{ | 364 | isValidFileName:{ |
366 | value: function(fileName){ | 365 | value: function(fileName){ |
367 | var status = nj.isValidFileName(fileName); | 366 | var status = this.isValidFileName(fileName); |
368 | if(fileName !== ""){ | 367 | if(fileName !== ""){ |
369 | if(!status){ | 368 | if(!status){ |
370 | this.showError("! Invalid file name."); | 369 | this.showError("! Invalid file name."); |
@@ -391,6 +390,23 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C | |||
391 | this.okButton.setAttribute("disabled", "true"); | 390 | this.okButton.setAttribute("disabled", "true"); |
392 | } | 391 | } |
393 | } | 392 | } |
394 | } | 393 | }, |
394 | |||
395 | /*** | ||
396 | * file name validation | ||
397 | */ | ||
398 | isValidFileName:{ | ||
399 | value: function(fileName){ | ||
400 | var status = false; | ||
401 | if(fileName !== ""){ | ||
402 | fileName = fileName.replace(/^\s+|\s+$/g,""); | ||
403 | status = !(/[/\\]/g.test(fileName)); | ||
404 | if(status && navigator.userAgent.indexOf("Macintosh") != -1){//for Mac files beginning with . are hidden | ||
405 | status = !(/^\./g.test(fileName)); | ||
406 | } | ||
407 | } | ||
408 | return status; | ||
409 | } | ||
410 | } | ||
395 | 411 | ||
396 | }); \ No newline at end of file | 412 | }); \ No newline at end of file |