aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-01 13:31:56 -0800
committerJose Antonio Marquez2012-02-01 13:31:56 -0800
commitd3208408027c90696af91883935279cf4d023ddc (patch)
tree353e60c8b0cc30012dfd5a0d3573bd0055d30bd3
parent54ccd309722797e79ca35fe115b0372e86850551 (diff)
parentfc4d32e0df064ecdbe7ed86aab25eeab58253032 (diff)
downloadninja-d3208408027c90696af91883935279cf4d023ddc.tar.gz
Merge branch 'refs/heads/AnanyaFileIO' into FileIO
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js6
-rw-r--r--[-rwxr-xr-x]js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css1
-rw-r--r--[-rwxr-xr-x]js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js11
-rw-r--r--[-rwxr-xr-x]js/components/ui/icon-list-basic/icon.reel/icon.css9
-rwxr-xr-xjs/io/document/document-controller.js52
-rwxr-xr-xjs/io/system/coreioapi.js45
-rw-r--r--js/io/utils/file-utils.js76
-rw-r--r--[-rwxr-xr-x]js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js41
-rw-r--r--[-rwxr-xr-x]js/io/workflow/save-as-dialog.reel/save-as-dialog.css6
-rw-r--r--[-rwxr-xr-x]js/io/workflow/save-as-dialog.reel/save-as-dialog.html4
-rw-r--r--[-rwxr-xr-x]js/io/workflow/save-as-dialog.reel/save-as-dialog.js138
-rwxr-xr-xjs/lib/NJUtils.js2
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.js72
13 files changed, 308 insertions, 155 deletions
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index 6f265c91..1431e76f 100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -81,7 +81,7 @@ exports.DocumentEntry = Montage.create(Component, {
81 prepareForDraw: { 81 prepareForDraw: {
82 enumerable: false, 82 enumerable: false,
83 value: function() { 83 value: function() {
84 //this.element.addEventListener("click", this, false); 84 this.element.addEventListener("click", this, false);
85 } 85 }
86 }, 86 },
87 87
@@ -98,10 +98,10 @@ exports.DocumentEntry = Montage.create(Component, {
98 handleClick: { 98 handleClick: {
99 value: function(event) { 99 value: function(event) {
100 if(event._event.target.nodeName === "IMG") { 100 if(event._event.target.nodeName === "IMG") {
101 documentManagerModule.DocumentManager.closeDocument(this._uuid); 101 this.application.ninja.documentController.closeDocument(this._uuid);
102 } else { 102 } else {
103 if(!this._document.isActive) { 103 if(!this._document.isActive) {
104 documentManagerModule.DocumentManager.switchDocument(this._uuid); 104 this.application.ninja.stage.stageView.switchCodeView(this.application.ninja.documentController._findDocumentByUUID(this._uuid));
105 } 105 }
106 } 106 }
107 } 107 }
diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css
index 61328ce0..93578ec1 100755..100644
--- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css
+++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css
@@ -63,6 +63,7 @@
63 63
64.picker .driversList:hover{ 64.picker .driversList:hover{
65 cursor:pointer; 65 cursor:pointer;
66 background-color: #444444;
66} 67}
67 68
68.picker .highlighted{ 69.picker .highlighted{
diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
index eec7c8e8..268ec41a 100755..100644
--- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
+++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
@@ -621,6 +621,16 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
621 this.currentSelectedNode = evt.target; 621 this.currentSelectedNode = evt.target;
622 622
623 }else{ 623 }else{
624
625
626 //test: highlight non-selectable icons too
627 if(!evt.target.classList.contains("selected")){
628 evt.target.classList.add("selected");
629 }
630 this.currentSelectedNode = evt.target;
631 //end- test
632
633
624 //disable OK 634 //disable OK
625 if(!this.okButton.hasAttribute("disabled")){ 635 if(!this.okButton.hasAttribute("disabled")){
626 this.okButton.setAttribute("disabled", "true"); 636 this.okButton.setAttribute("disabled", "true");
@@ -776,6 +786,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
776 this.pickerModel.callback.call(this.pickerModel.callbackScope, {"uri":this.selectedItems}); 786 this.pickerModel.callback.call(this.pickerModel.callbackScope, {"uri":this.selectedItems});
777 }catch(e){ 787 }catch(e){
778 success = false; 788 success = false;
789 console.log("[Error] Failed to open "+ this.selectedItems.toString());
779 console.log(e.stack); 790 console.log(e.stack);
780 } 791 }
781 }else{//else send an event with the selected files 792 }else{//else send an event with the selected files
diff --git a/js/components/ui/icon-list-basic/icon.reel/icon.css b/js/components/ui/icon-list-basic/icon.reel/icon.css
index ca591aff..4d71f6b8 100755..100644
--- a/js/components/ui/icon-list-basic/icon.reel/icon.css
+++ b/js/components/ui/icon-list-basic/icon.reel/icon.css
@@ -17,15 +17,18 @@
17} 17}
18 18
19.icon .selected{ 19.icon .selected{
20 /*background-color: #d1d1d1;*/
21 background-color: #919191; 20 background-color: #919191;
22} 21}
23 22
23/*highlight on hover*/
24.icon:hover{
25 background-color: #919191;
26}
27/*end- test*/
28
24.icon .iconImg{ 29.icon .iconImg{
25 width:35px; 30 width:35px;
26 height:35px; 31 height:35px;
27 /*border: 1px solid #000000;
28 box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);*/
29 margin-left: 20px; 32 margin-left: 20px;
30 margin-top: 10px; 33 margin-top: 10px;
31} 34}
diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js
index 6f363bc7..bba7e0e7 100755
--- a/js/io/document/document-controller.js
+++ b/js/io/document/document-controller.js
@@ -15,10 +15,9 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
15var Montage = require("montage/core/core").Montage, 15var Montage = require("montage/core/core").Montage,
16 Component = require("montage/ui/component").Component, 16 Component = require("montage/ui/component").Component,
17 Uuid = require("montage/core/uuid").Uuid, 17 Uuid = require("montage/core/uuid").Uuid,
18 fileSystem = require("js/io/system/filesystem").FileSystem; 18 nj= require("js/lib/NJUtils.js").NJUtils,
19 19 HTMLDocument = require("js/io/document/html-document").HTMLDocument,
20var HTMLDocument = require("js/io/document/html-document").HTMLDocument; 20 TextDocument = require("js/io/document/text-document").TextDocument;
21var TextDocument = require("js/io/document/text-document").TextDocument;
22 21
23var DocumentController = exports.DocumentController = Montage.create(Component, { 22var DocumentController = exports.DocumentController = Montage.create(Component, {
24 hasTemplate: { 23 hasTemplate: {
@@ -96,7 +95,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
96 95
97 openFileWithURI: { 96 openFileWithURI: {
98 value: function(uriArrayObj) { 97 value: function(uriArrayObj) {
99 var uri = "", fileContent = "", response=null; 98 var uri = "", fileContent = "", response=null, filename="", fileType="js";
100 if(!!uriArrayObj && !!uriArrayObj.uri && (uriArrayObj.uri.length > 0)){ 99 if(!!uriArrayObj && !!uriArrayObj.uri && (uriArrayObj.uri.length > 0)){
101 uri = uriArrayObj.uri[0]; 100 uri = uriArrayObj.uri[0];
102 } 101 }
@@ -104,18 +103,23 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
104 103
105 // Get file from Jose Code with a callback to here 104 // Get file from Jose Code with a callback to here
106 if(!!uri){ 105 if(!!uri){
107 response = fileSystem.shellApiHandler.openFile({"uri":uri}); 106 response = this.application.ninja.coreIoApi.openFile({"uri":uri});
108 if((response.success === true) && ((response.status === 200) || (response.status === 304))){ 107 if((response.success === true) && ((response.status === 200) || (response.status === 304))){
109 fileContent = response.content; 108 fileContent = response.content;
110 } 109 }
111 110
112 console.log("$$$ "+uri+"\n content = \n\n\n"+ fileContent+"\n\n\n"); 111 //console.log("$$$ "+uri+"\n content = \n\n\n"+ fileContent+"\n\n\n");
113 this.openDocument({"type": "js", "name": "tmp.js", "source": fileContent}); 112 filename = nj.getFileNameFromPath(uri);
113 if(uri.indexOf('.') != -1){
114 fileType = uri.substr(uri.lastIndexOf('.') + 1);
115 }
116 this.openDocument({"type": ""+fileType, "name": ""+filename, "source": fileContent});
114 } 117 }
115 118
116 } 119 }
117 }, 120 },
118 121
122
119 openProjectWithURI: { 123 openProjectWithURI: {
120 value: function(uri) { 124 value: function(uri) {
121 console.log("URI is: ", uri); 125 console.log("URI is: ", uri);
@@ -211,7 +215,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
211 this._documents.splice(this._findIndexByUUID(id), 1); 215 this._documents.splice(this._findIndexByUUID(id), 1);
212 216
213 if(this.activeDocument.uuid === id && this._documents.length > 0) { 217 if(this.activeDocument.uuid === id && this._documents.length > 0) {
214 this.switchDocument(this._documents[0].uuid) 218 this.switchDocument(this._documents[0].uuid);
215 } 219 }
216 } 220 }
217 }, 221 },
@@ -254,11 +258,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
254 lineNumbers: true, 258 lineNumbers: true,
255 mode: "htmlmixed", 259 mode: "htmlmixed",
256 onCursorActivity: function() { 260 onCursorActivity: function() {
257 DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.hline, null); 261 DocumentController._codeEditor.editor.setLineClass(DocumentController._codeEditor.hline, null);
258 DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.editor.getCursor().line, "activeline"); 262 DocumentController._codeEditor.hline = DocumentController._codeEditor.editor.setLineClass(Docu