From 68ce64a5a2f4a71b54d33916aaf1d57161302425 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 14 Feb 2012 20:48:40 -0800 Subject: Reverting text/html document classes and setting up MVC folder structure Setting up the folder structure for the proposed set up for documents in Ninja. Reverted to have a temp HTML/Text document class. Tweak some UI for file pickers. --- .../FilePicker/pickerNavigator.reel/pickerNavigator.css | 3 ++- js/components/ui/icon-list-basic/icon.reel/icon.css | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'js/components') diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css index 9c85c6b5..796c283f 100644 --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css +++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css @@ -6,7 +6,7 @@ .picker{ font-size:12px; - width:510px; + width:523px; height:500px; padding-top:15px; padding-left:15px; @@ -53,6 +53,7 @@ height:75%; width:auto; border-right: none; + margin: 8px 0px 0px 8px; } .picker .right-bottom{ 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 4d71f6b8..9fb180d2 100644 --- a/js/components/ui/icon-list-basic/icon.reel/icon.css +++ b/js/components/ui/icon-list-basic/icon.reel/icon.css @@ -5,14 +5,14 @@ */ .icon{ - width:90px; - height:80px; + width:88px; + height:78px; display: inline; float: left; -moz-border-radius: 8px; border-radius: 8px; - margin-bottom: 5px; - margin-right: 5px; + margin-bottom: 8px; + margin-right: 8px; background-color: #5f5f5f; } @@ -29,17 +29,17 @@ .icon .iconImg{ width:35px; height:35px; - margin-left: 20px; + margin-left: 26px; margin-top: 10px; } .icon .iconLabel{ margin-top:8px; white-space: nowrap; - text-overflow:ellipsis; + text-overflow: ellipsis; line-height:15px; overflow: hidden; - max-width:80%; + width: 72px; + padding: 0px 8px; text-align: center; - padding-left: 2px; } \ No newline at end of file -- cgit v1.2.3 From 23071f9cb32e1783d8c0aa960a8407e9024876c9 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 15 Feb 2012 21:51:28 -0800 Subject: Tree Node - fix for applying tree child nodes array twice (and getting duplicates) --- js/components/treeview/tree-node.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/components') diff --git a/js/components/treeview/tree-node.js b/js/components/treeview/tree-node.js index 689fc233..d7b864b5 100644 --- a/js/components/treeview/tree-node.js +++ b/js/components/treeview/tree-node.js @@ -44,7 +44,9 @@ exports.TreeNode = Montage.create(Component, { if(!object) { return; } + if(object[this.branchKey]) { + this.childNodes.length = 0; object[this.branchKey].forEach(function(node) { this.childNodes.push(node); }, this); -- cgit v1.2.3 From e5654b593f0371ac218af2f542d4ab904dbca746 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 15 Feb 2012 21:51:58 -0800 Subject: Ninja Leaf/Branch - Minor CSS fixes --- js/components/treeview/ninja-branch.reel/ninja-branch.css | 2 +- js/components/treeview/ninja-leaf.reel/ninja-leaf.css | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'js/components') diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.css b/js/components/treeview/ninja-branch.reel/ninja-branch.css index d8c212e8..a3a9350e 100644 --- a/js/components/treeview/ninja-branch.reel/ninja-branch.css +++ b/js/components/treeview/ninja-branch.reel/ninja-branch.css @@ -26,7 +26,7 @@ cursor: pointer; font-weight: bold; padding: 3px 0 4px; - text-shadow: 1px 1px 0 #000; + text-shadow: 1px 1px 1px #000; } /* First Level */ diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.css b/js/components/treeview/ninja-leaf.reel/ninja-leaf.css index 085b11e0..fedc1d9d 100644 --- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.css +++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.css @@ -19,7 +19,6 @@ /* Second level */ .branch .branch .leaf-label { background-position: 25px center; - box-shadow: 0 3px 4px -4px rgba(0,0,0,0.2); color: #FFF; padding-left: 45px; } -- cgit v1.2.3 From 8195f0c948f145b5883dd7298649ef24b7e941ae Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 15 Feb 2012 21:52:57 -0800 Subject: Tree view event delegate map fix --- js/components/treeview/ninja-leaf.reel/ninja-leaf.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/components') diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js index c6416693..1bfe66a4 100644 --- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js +++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js @@ -63,7 +63,8 @@ exports.Leaf = Montage.create(TreeNode, { 'dblclick' : 'handleDblclick', 'dragstart' : 'handleDragStart', 'dragend' : 'handleDragEnd' - } + }, + distinct: true } -- cgit v1.2.3 From 966f0adaf1d4b7f2dd5a6e31643df58bff713884 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 15 Feb 2012 21:53:24 -0800 Subject: Tree controller - Minor change (to use "distinct" descriptor) --- js/components/controllers/tree-controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/components') diff --git a/js/components/controllers/tree-controller.js b/js/components/controllers/tree-controller.js index 03ef7b9e..1e9222fd 100644 --- a/js/components/controllers/tree-controller.js +++ b/js/components/controllers/tree-controller.js @@ -28,7 +28,7 @@ var TreeController = exports.TreeController = Montage.create(ObjectController, / }, branchKey : { - value: 'children' + value: null }, _root : { @@ -98,7 +98,8 @@ var TreeController = exports.TreeController = Montage.create(ObjectController, / }, branchControllers: { - value: [] + value: [], + distinct: true }, addBranchController : { -- cgit v1.2.3 From 729e32ee70b0dd30a3b498ed7d1636b1b5b56a43 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 16 Feb 2012 11:18:21 -0800 Subject: Squashed commit of the following: commit 302ae3c1812086d976eb67c9cf693c43205f3904 Author: Ananya Sen Date: Thu Feb 16 11:13:05 2012 -0800 hide the rulers when no document is open Signed-off-by: Ananya Sen commit 2e766c9eaa98fa20f311b3eb2f892a1a240e90cf Author: Ananya Sen 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 commit 4937b39fb0cf542f57cdadc7d1e2ed9798f7ef87 Author: Ananya Sen Date: Wed Feb 15 16:09:14 2012 -0800 fixes to document tabbing Signed-off-by: Ananya Sen commit 56d2a8d11a73cd04c7f1bc20d1ded52b9c1242f2 Author: Ananya Sen 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 commit e2b97c951a9a5a0c4ff831d44fdd82177cbd82ad Author: Ananya Sen 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 commit aead95ce4b2571356701229567bfde73d54bed93 Author: Ananya Sen Date: Wed Feb 15 10:53:55 2012 -0800 Revert "Revert "Cleaning up"" This reverts commit a90e3be8850b64e8e370aa8ff8cadaa448dd0c82. Signed-off-by: Ananya Sen commit a8d1a2e1f4f4ab7b9298bfbd1b49731785c79c3a Author: Ananya Sen Date: Wed Feb 15 10:52:56 2012 -0800 Revert "Revert "Merging TextDocument into BaseDocument"" This reverts commit b8782f2e3dd106accbb0160a98e6b498f26752ea. Signed-off-by: Ananya Sen commit e864dc319805e259b7ae39a9d4d96fac552a1f87 Author: Ananya Sen 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 commit 3cf1d19c5cdc9534d9c87cbc7d1fcf48e68daa42 Author: Ananya Sen 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 commit b8782f2e3dd106accbb0160a98e6b498f26752ea Author: Ananya Sen 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 commit a90e3be8850b64e8e370aa8ff8cadaa448dd0c82 Author: Ananya Sen 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 commit 9048cd50bf5e0a418d1d95498bb593961f72db36 Author: Ananya Sen 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 commit 2e308be9bec5e06d81b2905b65005a232f0a190d Author: Ananya Sen Date: Wed Feb 15 09:50:20 2012 -0800 Revert "Creating NinjaTemplate to HTML function" This reverts commit e327eccb93e2bc513fcbb7ab302783d6bce83884. Signed-off-by: Ananya Sen --- .../pickerNavigator.reel/pickerNavigator.js | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'js/components') 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, { this.pickerModel.storeHistory(this.pickerModel.currentRoot);//populate history this.updateMetadata(this.currentURI); + + //for directory selection, selected url is the folder entered + if(!this.pickerModel.inFileMode ){ + this.okButton.removeAttribute("disabled"); + //put into selectedItems..currently single selection is supported + this.selectedItems = [this.pickerModel.currentRoot]; + } } 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, { this.element.addEventListener("updateMetadata", function(evt){that.handlePickerNavUpdateMetadata(evt);}, false);//show metadata on click of icon //this.addressGo.addEventListener("click", this, false); this.addressBarUri.addEventListener("keydown", this, false); + this.addressBarUri.addEventListener("keyup", this, false); this.refreshButton.addEventListener("click", this, false);//refresh - gets from file system directly this.backArrow.addEventListener("click", this, false); this.forwardArrow.addEventListener("click", this, false); @@ -608,6 +616,13 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { this.backArrow.classList.remove("disable"); } + //for directory selection, selected url is the folder entered + if(!this.pickerModel.inFileMode ){ + this.okButton.removeAttribute("disabled"); + //put into selectedItems..currently single selection is supported + this.selectedItems = [evt.folderUri]; + } + } }, @@ -720,6 +735,21 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { } }, + handleAddressBarUriKeyup:{ + value: function(evt){ + //disable ok if user enters an invalid uri + if(!this.application.ninja.coreIoApi.isValidUri(this.addressBarUri.value)){ + //disable OK + if(!this.okButton.hasAttribute("disabled")){ + this.okButton.setAttribute("disabled", "true"); + } + }else{ + this.okButton.removeAttribute("disabled"); + this.selectedItems = [this.addressBarUri.value]; + } + } + }, + handleRefreshButtonClick:{ value:function(evt){ var uri = this.addressBarUri.value; @@ -794,7 +824,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { handleOkButtonAction : { value: function(evt){ - console.log("$$$ File Picker : selected "+ this.selectedItems.toString()); + //console.log("$$$ File Picker : selected "+ this.selectedItems.toString()); var success = true; if(!!this.pickerModel.callback && (this.selectedItems.length > 0)){//call the callback if it is available try{ -- cgit v1.2.3