aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-16 11:39:42 -0800
committerValerio Virgillito2012-02-16 11:39:42 -0800
commiteaee73ccaf271f5c82fdf67b35c71510f308fb6e (patch)
tree798eb17a926cd8fd16bd025ecd392d3e2f63226e /js
parentb12b167116b757e1a945c05f45991d0ed385aed3 (diff)
parent71619045b692015b0889a4f5c381c1dee9c056cd (diff)
downloadninja-eaee73ccaf271f5c82fdf67b35c71510f308fb6e.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Diffstat (limited to 'js')
-rw-r--r--js/components/controllers/tree-controller.js5
-rw-r--r--js/components/treeview/ninja-branch.reel/ninja-branch.css2
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.css1
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.js3
-rw-r--r--js/components/treeview/tree-node.js2
-rw-r--r--js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css3
-rw-r--r--js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js32
-rw-r--r--js/components/ui/icon-list-basic/icon.reel/icon.css16
-rwxr-xr-xjs/controllers/document-controller.js71
-rwxr-xr-xjs/document/controllers/base-controller.js32
-rwxr-xr-xjs/document/html-document.js (renamed from js/io/document/html-document.js)44
-rwxr-xr-xjs/document/mediators/base-mediator.js32
-rwxr-xr-xjs/document/models/base-model.js32
-rwxr-xr-xjs/document/text-document.js195
-rwxr-xr-xjs/document/views/base-view.js32
-rwxr-xr-xjs/io/document/base-document.js93
-rwxr-xr-xjs/io/document/text-document.js156
-rwxr-xr-xjs/io/system/coreioapi.js18
-rw-r--r--js/io/system/ninjalibrary.js25
-rw-r--r--js/io/system/ninjalibrary.json5
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.css57
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.html4
-rw-r--r--js/mediators/io-mediator.js47
-rwxr-xr-xjs/ninja.reel/ninja.css2
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.js5
25 files changed, 524 insertions, 390 deletions
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, /
28 }, 28 },
29 29
30 branchKey : { 30 branchKey : {
31 value: 'children' 31 value: null
32 }, 32 },
33 33
34 _root : { 34 _root : {
@@ -98,7 +98,8 @@ var TreeController = exports.TreeController = Montage.create(ObjectController, /
98 }, 98 },
99 99
100 branchControllers: { 100 branchControllers: {
101 value: [] 101 value: [],
102 distinct: true
102 }, 103 },
103 104
104 addBranchController : { 105 addBranchController : {
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 @@
26 cursor: pointer; 26 cursor: pointer;
27 font-weight: bold; 27 font-weight: bold;
28 padding: 3px 0 4px; 28 padding: 3px 0 4px;
29 text-shadow: 1px 1px 0 #000; 29 text-shadow: 1px 1px 1px #000;
30} 30}
31 31
32/* First Level */ 32/* 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 @@
19/* Second level */ 19/* Second level */
20.branch .branch .leaf-label { 20.branch .branch .leaf-label {
21 background-position: 25px center; 21 background-position: 25px center;
22 box-shadow: 0 3px 4px -4px rgba(0,0,0,0.2);
23 color: #FFF; 22 color: #FFF;
24 padding-left: 45px; 23 padding-left: 45px;
25} 24}
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, {
63 'dblclick' : 'handleDblclick', 63 'dblclick' : 'handleDblclick',
64 'dragstart' : 'handleDragStart', 64 'dragstart' : 'handleDragStart',
65 'dragend' : 'handleDragEnd' 65 'dragend' : 'handleDragEnd'
66 } 66 },
67 distinct: true
67 } 68 }
68 69
69 70
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, {
44 if(!object) { 44 if(!object) {
45 return; 45 return;
46 } 46 }
47
47 if(object[this.branchKey]) { 48 if(object[this.branchKey]) {
49 this.childNodes.length = 0;
48 object[this.branchKey].forEach(function(node) { 50 object[this.branchKey].forEach(function(node) {
49 this.childNodes.push(node); 51 this.childNodes.push(node);
50 }, this); 52 }, this);
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 @@
6 6
7.picker{ 7.picker{
8 font-size:12px; 8 font-size:12px;
9 width:510px; 9 width:523px;
10 height:500px; 10 height:500px;
11 padding-top:15px; 11 padding-top:15px;
12 padding-left:15px; 12 padding-left:15px;
@@ -53,6 +53,7 @@
53 height:75%; 53 height:75%;
54 width:auto; 54 width:auto;
55 border-right: none; 55 border-right: none;
56 margin: 8px 0px 0px 8px;
56} 57}
57 58
58.picker .right-bottom{ 59.picker .right-bottom{
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 }