aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-16 11:18:21 -0800
committerJose Antonio Marquez2012-02-16 11:18:21 -0800
commit729e32ee70b0dd30a3b498ed7d1636b1b5b56a43 (patch)
treef5a5a19ee9df4fee691484fa1762dc202adea9ad
parent075252ad893452df446566f01d0b26eeab08be3d (diff)
downloadninja-729e32ee70b0dd30a3b498ed7d1636b1b5b56a43.tar.gz
Squashed commit of the following:
commit 302ae3c1812086d976eb67c9cf693c43205f3904 Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Thu Feb 16 11:13:05 2012 -0800 hide the rulers when no document is open Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit 2e766c9eaa98fa20f311b3eb2f892a1a240e90cf Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Thu Feb 16 06:43:33 2012 -0800 file picker: Enable ok if user double clicks folder and enter it. Validate path if user enter it manually in addressbar. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit 4937b39fb0cf542f57cdadc7d1e2ed9798f7ef87 Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 16:09:14 2012 -0800 fixes to document tabbing Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit 56d2a8d11a73cd04c7f1bc20d1ded52b9c1242f2 Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 10:54:38 2012 -0800 Revert "Revert "Creating NinjaTemplate to HTML function"" This reverts commit 2e308be9bec5e06d81b2905b65005a232f0a190d. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit e2b97c951a9a5a0c4ff831d44fdd82177cbd82ad Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 10:54:14 2012 -0800 Revert "Revert "Reverting text/html document classes and setting up MVC folder structure"" This reverts commit 9048cd50bf5e0a418d1d95498bb593961f72db36. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit aead95ce4b2571356701229567bfde73d54bed93 Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 10:53:55 2012 -0800 Revert "Revert "Cleaning up"" This reverts commit a90e3be8850b64e8e370aa8ff8cadaa448dd0c82. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit a8d1a2e1f4f4ab7b9298bfbd1b49731785c79c3a Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 10:52:56 2012 -0800 Revert "Revert "Merging TextDocument into BaseDocument"" This reverts commit b8782f2e3dd106accbb0160a98e6b498f26752ea. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit e864dc319805e259b7ae39a9d4d96fac552a1f87 Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 10:52:38 2012 -0800 Revert "merging from github.com/joseeight/ninja-internal/tree/FileIO is breaking opening html files… to trying to fix local build" This reverts commit 3cf1d19c5cdc9534d9c87cbc7d1fcf48e68daa42. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit 3cf1d19c5cdc9534d9c87cbc7d1fcf48e68daa42 Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 10:06:42 2012 -0800 merging from github.com/joseeight/ninja-internal/tree/FileIO is breaking opening html files… to trying to fix local build Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit b8782f2e3dd106accbb0160a98e6b498f26752ea Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 10:01:59 2012 -0800 Revert "Merging TextDocument into BaseDocument" This reverts commit 93c8f327d662a7693d1d6ca050a0efd15ebc18ed. Conflicts: js/controllers/document-controller.js Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit a90e3be8850b64e8e370aa8ff8cadaa448dd0c82 Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 09:58:37 2012 -0800 Revert "Cleaning up" This reverts commit a7952c5a16e2cae3fd1a459b03b9f16bba1004da. Conflicts: js/controllers/document-controller.js js/io/document/text-document.js Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit 9048cd50bf5e0a418d1d95498bb593961f72db36 Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 09:51:12 2012 -0800 Revert "Reverting text/html document classes and setting up MVC folder structure" This reverts commit 68ce64a5a2f4a71b54d33916aaf1d57161302425. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> commit 2e308be9bec5e06d81b2905b65005a232f0a190d Author: Ananya Sen <Ananya.Sen@motorola.com> Date: Wed Feb 15 09:50:20 2012 -0800 Revert "Creating NinjaTemplate to HTML function" This reverts commit e327eccb93e2bc513fcbb7ab302783d6bce83884. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
-rwxr-xr-xcss/ninja.css4
-rw-r--r--js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js32
-rwxr-xr-xjs/controllers/document-controller.js32
-rwxr-xr-xjs/ninja.reel/ninja.css2
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.js5
-rwxr-xr-xscss/imports/scss/_MainWindow.scss2
6 files changed, 56 insertions, 21 deletions
diff --git a/css/ninja.css b/css/ninja.css
index 0be30434..824a675a 100755
--- a/css/ninja.css
+++ b/css/ninja.css
@@ -118,9 +118,9 @@ body { position: absolute; margin: 0px; width: 100%; height: 100%; background-co
118 118
119#sceneBar { height: 70px; background-color: #474747; } 119#sceneBar { height: 70px; background-color: #474747; }
120 120
121#mainContainer #rulerTop { background: url("../images/temp/ruler-top.png"); height: 15px; margin-bottom: 0px; } 121#mainContainer #rulerTop { background: url("../images/temp/ruler-top.png"); height: 15px; margin-bottom: 0px; display:none;}
122 122
123#rulerLeft { background: url("../images/temp/ruler-left.png"); width: 16px; } 123#rulerLeft { background: url("../images/temp/ruler-left.png"); width: 16px; display:none;}
124 124
125#stateBar { height: 20px; background-color: #282828; margin-bottom: 0px; } 125#stateBar { height: 20px; background-color: #282828; margin-bottom: 0px; }
126 126
diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
index 6b0d92f7..411386f9 100644
--- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
+++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
@@ -203,6 +203,13 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
203 this.pickerModel.storeHistory(this.pickerModel.currentRoot);//populate history 203 this.pickerModel.storeHistory(this.pickerModel.currentRoot);//populate history
204 204
205 this.updateMetadata(this.currentURI); 205 this.updateMetadata(this.currentURI);
206
207 //for directory selection, selected url is the folder entered
208 if(!this.pickerModel.inFileMode ){
209 this.okButton.removeAttribute("disabled");
210 //put into selectedItems..currently single selection is supported
211 this.selectedItems = [this.pickerModel.currentRoot];
212 }
206 } 213 }
207 214
208 this.element.addEventListener("openFolder", function(evt){that.handlePickerNavOpenFolder(evt);}, false);//add icon double click event listener to reload iconList with new set of data 215 this.element.addEventListener("openFolder", function(evt){that.handlePickerNavOpenFolder(evt);}, false);//add icon double click event listener to reload iconList with new set of data
@@ -211,6 +218,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
211 this.element.addEventListener("updateMetadata", function(evt){that.handlePickerNavUpdateMetadata(evt);}, false);//show metadata on click of icon 218 this.element.addEventListener("updateMetadata", function(evt){that.handlePickerNavUpdateMetadata(evt);}, false);//show metadata on click of icon
212 //this.addressGo.addEventListener("click", this, false); 219 //this.addressGo.addEventListener("click", this, false);
213 this.addressBarUri.addEventListener("keydown", this, false); 220 this.addressBarUri.addEventListener("keydown", this, false);
221 this.addressBarUri.addEventListener("keyup", this, false);
214 this.refreshButton.addEventListener("click", this, false);//refresh - gets from file system directly 222 this.refreshButton.addEventListener("click", this, false);//refresh - gets from file system directly
215 this.backArrow.addEventListener("click", this, false); 223 this.backArrow.addEventListener("click", this, false);
216 this.forwardArrow.addEventListener("click", this, false); 224 this.forwardArrow.addEventListener("click", this, false);
@@ -608,6 +616,13 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
608 this.backArrow.classList.remove("disable"); 616 this.backArrow.classList.remove("disable");
609 } 617 }
610 618
619 //for directory selection, selected url is the folder entered
620 if(!this.pickerModel.inFileMode ){
621 this.okButton.removeAttribute("disabled");
622 //put into selectedItems..currently single selection is supported
623 this.selectedItems = [evt.folderUri];
624 }
625
611 } 626 }
612 }, 627 },
613 628
@@ -720,6 +735,21 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
720 } 735 }
721 }, 736 },
722 737
738 handleAddressBarUriKeyup:{
739 value: function(evt){
740 //disable ok if user enters an invalid uri
741 if(!this.application.ninja.coreIoApi.isValidUri(this.addressBarUri.value)){
742 //disable OK
743 if(!this.okButton.hasAttribute("disabled")){
744 this.okButton.setAttribute("disabled", "true");
745 }
746 }else{
747 this.okButton.removeAttribute("disabled");
748 this.selectedItems = [this.addressBarUri.value];
749 }
750 }
751 },
752
723 handleRefreshButtonClick:{ 753 handleRefreshButtonClick:{
724 value:function(evt){ 754 value:function(evt){
725 var uri = this.addressBarUri.value; 755 var uri = this.addressBarUri.value;
@@ -794,7 +824,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
794 824
795 handleOkButtonAction : { 825 handleOkButtonAction : {
796 value: function(evt){ 826 value: function(evt){
797 console.log("$$$ File Picker : selected "+ this.selectedItems.toString()); 827 //console.log("$$$ File Picker : selected "+ this.selectedItems.toString());
798 var success = true; 828 var success = true;
799 if(!!this.pickerModel.callback && (this.selectedItems.length > 0)){//call the callback if it is available 829 if(!!this.pickerModel.callback && (this.selectedItems.length > 0)){//call the callback if it is available
800 try{ 830 try{
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index f397ace7..b1a22c1b 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -34,17 +34,17 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
34 return this._activeDocument; 34 return this._activeDocument;
35 }, 35 },
36 set: function(doc) { 36 set: function(doc) {
37 if(this._activeDocument) this._activeDocument.isActive = false; 37 if(!!this._activeDocument) this._activeDocument.isActive = false;
38
39 if(this._documents.indexOf(doc) === -1) this._documents.push(doc);
40 38
41 this._activeDocument = doc; 39 this._activeDocument = doc;
42 this._activeDocument.isActive = true; 40 if(!!this._activeDocument){
43 41
44 if(!!this._activeDocument.editor){ 42 if(this._documents.indexOf(doc) === -1) this._documents.push(doc);
45 this._activeDocument.editor.focus(); 43 this._activeDocument.isActive = true;
44 if(!!this._activeDocument.editor){
45 this._activeDocument.editor.focus();
46 }
46 } 47 }
47
48 } 48 }
49 }, 49 },
50 50
@@ -184,7 +184,7 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
184 switch (doc.extension) { 184 switch (doc.extension) {
185 case 'html': case 'html': 185 case 'html': case 'html':
186 //Open in designer view 186 //Open in designer view
187 Montage.create(HTMLDocument).initialize(doc, Uuid.generate(), this._createIframeElement(), this._onOpenDocument); 187 Montage.create(HTMLDocument).initialize(doc, Uuid.generate(), this._createIframeElement(), this._onOpenDocument.bind(this));
188 break; 188 break;
189 default: 189 default:
190 //Open in code view 190 //Open in code view
@@ -250,7 +250,6 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
250 } 250 }
251 251
252 var doc = this._findDocumentByUUID(id); 252 var doc = this._findDocumentByUUID(id);
253 this._removeDocumentView(doc.container);
254 253
255 var closeDocumentIndex = this._findIndexByUUID(id); 254 var closeDocumentIndex = this._findIndexByUUID(id);
256 this._documents.splice(this._findIndexByUUID(id), 1); 255 this._documents.splice(this._findIndexByUUID(id), 1);
@@ -263,8 +262,11 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
263 nextDocumentIndex = closeDocumentIndex - 1; 262 nextDocumentIndex = closeDocumentIndex - 1;
264 } 263 }
265 this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); 264 this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]);
265 this._removeDocumentView(doc.container);
266 }else if(this._documents.length === 0){ 266 }else if(this._documents.length === 0){
267 //if there are no documents to switch to then just show the iframeContainer 267 this.activeDocument = null;
268 this._removeDocumentView(doc.container);
269 this.application.ninja.stage.stageView.hideRulers();
268 document.getElementById("iframeContainer").style.display="block"; 270 document.getElementById("iframeContainer").style.display="block";
269 } 271 }
270 } 272 }
@@ -275,11 +277,15 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
275 _onOpenDocument: { 277 _onOpenDocument: {
276 value: function(doc){ 278 value: function(doc){
277 //var data = DocumentManager.activeDocument; 279 //var data = DocumentManager.activeDocument;
278 //DocumentManager._hideCurrentDocument();
279 280
280 //stageManagerModule.stageManager.toggleCanvas(); 281 this._hideCurrentDocument();
282 this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid);
283
284 this.application.ninja.stage.hideCanvas(false);
285
286 this.activeDocument = doc;
281 287
282 DocumentController.activeDocument = doc; 288 this._showCurrentDocument();
283