aboutsummaryrefslogtreecommitdiff
path: root/js/io
diff options
context:
space:
mode:
authorAnanya Sen2012-02-02 12:37:29 -0800
committerAnanya Sen2012-02-02 12:37:29 -0800
commit0e595c4e11ce9b44eff157de8616ed15fcd5d6fc (patch)
treeaba0df7f15b631345b9c44b6b50884d06b7a803a /js/io
parent87e247e74040b5e80ff40003d233d5317881102a (diff)
downloadninja-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')
-rwxr-xr-xjs/io/document/document-controller.js3
-rwxr-xr-xjs/io/system/coreioapi.js29
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.css (renamed from js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.css)0
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html (renamed from js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.html)2
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js (renamed from js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.js)2
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.css (renamed from js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.css)0
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.html (renamed from js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.html)4
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js (renamed from js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js)10
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-controller.js (renamed from js/io/workflow/newFileDialog/new-file-workflow-controller.js)6
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-model.js (renamed from js/io/workflow/newFileDialog/new-file-workflow-model.js)0
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.css (renamed from js/io/workflow/save-as-dialog.reel/save-as-dialog.css)0
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.html (renamed from js/io/workflow/save-as-dialog.reel/save-as-dialog.html)2
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js (renamed from js/io/workflow/save-as-dialog.reel/save-as-dialog.js)8
-rw-r--r--js/io/utils/file-utils.js76
-rwxr-xr-xjs/io/workflow/new-project-manager.js136
-rwxr-xr-xjs/io/workflow/newProjectNavigator.js75
-rwxr-xr-xjs/io/workflow/newProjectNavigator.reel/newProjectNavigator.css32
-rwxr-xr-xjs/io/workflow/newProjectNavigator.reel/newProjectNavigator.html32
18 files changed, 48 insertions, 369 deletions
diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js
index 9be40ccc..8ce43dcc 100755
--- a/js/io/document/document-controller.js
+++ b/js/io/document/document-controller.js
@@ -244,6 +244,9 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
244 244
245 switchViews: { 245 switchViews: {
246 value: function() { 246 value: function() {
247
248 //save file if dirty
249
247 this.application.ninja.stage.saveScroll(); 250 this.application.ninja.stage.saveScroll();
248 this._hideCurrentDocument(); 251 this._hideCurrentDocument();
249 252
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////////////////////////////////////////////////////////////////////////
diff --git a/js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.css b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.css
index 7f11c225..7f11c225 100755
--- a/js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.css
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.css
diff --git a/js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.html b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html
index 7c271511..d7fbc235 100755
--- a/js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.html
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html
@@ -59,7 +59,7 @@
59 }, 59 },
60 60
61 "owner":{ 61 "owner":{
62 "module": "js/io/workflow/newFileDialog/new-file-location.reel", 62 "module": "js/io/ui/new-file-dialog/new-file-location.reel",
63 "name": "NewFileLocation", 63 "name": "NewFileLocation",
64 "properties": { 64 "properties": {
65 "element": {"#": "newfileLocation"}, 65 "element": {"#": "newfileLocation"},
diff --git a/js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
index 805b44a4..7da13dfc 100755
--- a/js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.js
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
@@ -6,7 +6,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
6 6
7var Montage = require("montage/core/core").Montage; 7var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component; 8var Component = require("montage/ui/component").Component;
9var newFileWorkflowControllerModule = require("js/io/workflow/newFileDialog/new-file-workflow-controller"); 9var newFileWorkflowControllerModule = require("js/io/ui/new-file-dialog/new-file-workflow-controller");
10 10
11var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { 11var NewFileLocation = exports.NewFileLocation = Montage.create(Component, {
12 12
diff --git a/js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.css b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.css
index 7ef6d2ce..7ef6d2ce 100755
--- a/js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.css
+++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.css
diff --git a/js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.html b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.html
index dc090b99..eb4a8045 100755
--- a/js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.html
+++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.html
@@ -41,7 +41,7 @@
41 }, 41 },
42 42
43 "newFileLocation":{ 43 "newFileLocation":{
44 "module": "js/io/workflow/newFileDialog/new-file-location.reel", 44 "module": "js/io/ui/new-file-dialog/new-file-location.reel",
45 "name": "NewFileLocation", 45 "name": "NewFileLocation",
46 "properties": { 46 "properties": {
47 "element": {"#": "right-bottom"} 47 "element": {"#": "right-bottom"}
@@ -49,7 +49,7 @@
49 }, 49 },
50 50
51 "owner":{ 51 "owner":{
52 "module": "js/io/workflow/newFileDialog/new-file-options-navigator.reel", 52 "module": "js/io/ui/new-file-dialog/new-file-options-navigator.reel",
53 "name": "NewFileOptionsNavigator", 53 "name": "NewFileOptionsNavigator",
54 "properties": { 54 "properties": {
55 "element": {"#": "newfile"}, 55 "element": {"#": "newfile"},
diff --git a/js/io/workflow/newFileDialog/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 7702b1a2..cee8d4b7 100644
--- a/js/io/workflow/newFileDialog/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,8 @@ 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/workflow/newFileDialog/new-file-workflow-controller"), 11 newFileLocationSelectionModule = require("js/io/ui/new-file-dialog/new-file-workflow-controller"),
12 fileUtils = require("js/io/utils/file-utils").FileUtils; 12 nj= require("js/lib/NJUtils.js").NJUtils;
13 13
14var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(Component, { 14var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(Component, {
15 15
@@ -335,7 +335,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
335 335
336 isValidUri:{ 336 isValidUri:{
337 value: function(uri){ 337 value: function(uri){
338 var status= fileUtils.isValidUri(uri); 338 var status= nj.isValidUri(uri);
339 if(uri !== ""){ 339 if(uri !== ""){
340 if(!status){ 340 if(!status){
341 this.showError("! Invalid directory."); 341 this.showError("! Invalid directory.");
@@ -346,7 +346,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
346 }, 346 },
347 isValidFileName:{ 347 isValidFileName:{
348 value: function(fileName){ 348 value: function(fileName){
349 var status = fileUtils.isValidFileName(fileName); 349 var status = nj.isValidFileName(fileName);
350 if(fileName !== ""){ 350 if(fileName !== ""){
351 if(!status){ 351 if(!status){
352 this.showError("! Invalid file name."); 352 this.showError("! Invalid file name.");
@@ -357,7 +357,7 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
357 }, 357 },
358 checkFileExists:{ 358 checkFileExists:{
359 value: function(fileUri, folderUri, fileType){ 359 value: function(fileUri, folderUri, fileType){
360 var status= fileUtils.checkFileExists(fileUri, folderUri, fileType); 360 var status= this.application.ninja.coreIoApi.checkFileExists(fileUri, folderUri, fileType);
361 if(status){ 361 if(status){
362 this.showError("! File already exists."); 362 this.showError("! File already exists.");