aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorEric Guzman2012-05-25 16:37:43 -0700
committerEric Guzman2012-05-25 16:37:43 -0700
commite884d2769a53dd8920b485672631b50158ed0800 (patch)
tree526934085f973f0bcfef5a3f130794530396aa03 /js/stage
parent1f7c17d688c3340b31d2e1c2b7205b10bd806968 (diff)
parent81239571c538f72e398fafa5b07725bf1bbb2d5d (diff)
downloadninja-e884d2769a53dd8920b485672631b50158ed0800.tar.gz
Merge branch 'binding' of github.com:dhg637/ninja-internal into binding
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/binding-view.reel/binding-hud.reel/binding-hud.html8
-rwxr-xr-xjs/stage/binding-view.reel/binding-view.html31
-rwxr-xr-xjs/stage/binding-view.reel/binding-view.js25
-rwxr-xr-xjs/stage/layout.js12
-rwxr-xr-xjs/stage/stage-deps.js46
-rwxr-xr-xjs/stage/stage.reel/stage.js109
-rwxr-xr-xjs/stage/tool-handle.js4
7 files changed, 106 insertions, 129 deletions
diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html
index c81b70d3..1c73fd77 100755
--- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html
+++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html
@@ -23,11 +23,7 @@
23 "element": {"#": "hudRepetition"} 23 "element": {"#": "hudRepetition"}
24 }, 24 },
25 "bindings": { 25 "bindings": {
26 "objects": { 26 "objects": {"<-": "@owner.properties"}
27 "boundObject": {"@": "owner"},
28 "boundObjectPropertyPath": "properties",
29 "oneway": true
30 }
31 } 27 }
32 }, 28 },
33 "hudOption": { 29 "hudOption": {
@@ -36,7 +32,7 @@
36 "element": {"#" : "hudOption"} 32 "element": {"#" : "hudOption"}
37 }, 33 },
38 "bindings": { 34 "bindings": {
39 "title": {"<-": "@objectAtCurrentIteration.title"} 35 "title": {"<-": "@repeater.objectAtCurrentIteration.title"}
40 } 36 }
41 } 37 }
42 } 38 }
diff --git a/js/stage/binding-view.reel/binding-view.html b/js/stage/binding-view.reel/binding-view.html
index 152345d4..b77f8e27 100755
--- a/js/stage/binding-view.reel/binding-view.html
+++ b/js/stage/binding-view.reel/binding-view.html
@@ -24,17 +24,16 @@
24 "element": {"#": "hudRepeater"} 24 "element": {"#": "hudRepeater"}
25 }, 25 },
26 "bindings": { 26 "bindings": {
27 "objects": { 27 "objects": {"<-": "@owner.bindables"}
28 "boundObject": {"@": "owner"},
29 "boundObjectPropertyPath": "bindables",
30 "oneway": true
31 }
32 } 28 }
33 }, 29 },
34 "hud": { 30 "hud": {
35 "prototype": "js/stage/binding-view.reel/binding-hud.reel", 31 "prototype": "js/stage/binding-view.reel/binding-hud.reel",
36 "properties": { 32 "properties": {
37 "element": {"#" : "hud"} 33 "element": {"#" : "hud"}
34 },
35 "bindings": {
36 "name": {
38 } 37 }
39 }, 38 },
40 "nonVisualRepeater": { 39 "nonVisualRepeater": {
@@ -43,11 +42,7 @@
43 "element": {"#": "nonVisualRepeater"} 42 "element": {"#": "nonVisualRepeater"}
44 }, 43 },
45 "bindings": { 44 "bindings": {
46 "objects": { 45 "objects": {"<-": "@owner.nonVisualComponents"}
47 "boundObject": {"@": "owner"},
48 "boundObjectPropertyPath": "nonVisualComponents",
49 "oneway": true
50 }
51 } 46 }
52 }, 47 },
53 "nonVisualComponent": { 48 "nonVisualComponent": {
@@ -56,16 +51,8 @@
56 "element": {"#": "nonVisualComponent"} 51 "element": {"#": "nonVisualComponent"}
57 }, 52 },
58 "bindings": { 53 "bindings": {
59 "objectName": { 54 "objectName": {"<-": "@hudRepeater.objectAtCurrentIteration.objectName"},
60 "boundObject": {"@": "hudRepeater"}, 55 "objectImage": {"<-": "@hudRepeater.objectAtCurrentIteration.objectImage"}
61 "boundObjectPropertyPath": "objectAtCurrentIteration.objectName",
62 "oneway": true
63 },
64 "objectImage": {
65 "boundObject": {"@": "hudRepeater"},
66 "boundObjectPropertyPath": "objectAtCurrentIteration.objectImage",
67 "oneway": true
68 }
69 } 56 }
70 } 57 }
71 } 58 }
@@ -82,7 +69,9 @@
82 </div> 69 </div>
83 </div> 70 </div>
84 <div data-montage-id="nonVisualRepeater"> 71 <div data-montage-id="nonVisualRepeater">
85 <div data-montage-id="nonVisualComponent"></div> 72 <div data-montage-id="nonVisualComponent">
73
74 </div>
86 </div> 75 </div>
87 </section> 76 </section>
88 77
diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js
index df3bc3ee..97593c66 100755
--- a/js/stage/binding-view.reel/binding-view.js
+++ b/js/stage/binding-view.reel/binding-view.js
@@ -34,6 +34,7 @@ exports.BindingView = Montage.create(Component, {
34 }, 34 },
35 set: function(val) { 35 set: function(val) {
36 this._selectedElement = val; 36 this._selectedElement = val;
37 this.needsDraw = true;
37 } 38 }
38 }, 39 },
39 bindables: { 40 bindables: {
@@ -51,9 +52,31 @@ exports.BindingView = Montage.create(Component, {
51 set: function(val) { 52 set: function(val) {
52 this._nonVisualComponents = val; 53 this._nonVisualComponents = val;
53 } 54 }
54 } 55 },
55 56
56 //Methods 57 //Methods
57 58
59 //Montage Draw Cycle
60 prepareForDraw: {
61 value: function() {
62
63 }
64 },
65
66 draw: {
67 value: function() {
68 if(this.selectedElement !== null) {
69 this.bindables = [
70 {"objectName": "Input1", "objectTitle": ""},
71 ]
72 }
73 }
74 },
75
76 didDraw: {
77 value: function() {
78
79 }
80 }
58 81
59}); \ No newline at end of file 82}); \ No newline at end of file
diff --git a/js/stage/layout.js b/js/stage/layout.js
index 9c5e2167..460c8b4a 100755
--- a/js/stage/layout.js
+++ b/js/stage/layout.js
@@ -62,12 +62,8 @@ exports.Layout = Montage.create(Component, {
62 value: function() { 62 value: function() {
63 // Initial elements to draw are the childrens of the root element 63 // Initial elements to draw are the childrens of the root element
64 if(this.application.ninja.documentController.activeDocument.currentView === "design") { 64 if(this.application.ninja.documentController.activeDocument.currentView === "design") {
65 this.elementsToDraw = this.application.ninja.documentController.activeDocument.documentRoot.childNodes; 65 this.elementsToDraw = this.application.ninja.documentController.activeDocument.model.documentRoot.childNodes;
66 } 66 }
67
68 // Draw the elements and the 3d info
69 this.draw();
70 this.draw3DInfo(false);
71 } 67 }
72 }, 68 },
73 69
@@ -89,7 +85,7 @@ exports.Layout = Montage.create(Component, {
89 85
90 if(this.application.ninja.documentController.activeDocument.currentView === "design"){ 86 if(this.application.ninja.documentController.activeDocument.currentView === "design"){
91 // Make an array copy of the line node list which is not an array like object 87 // Make an array copy of the line node list which is not an array like object
92 this.domTree = Array.prototype.slice.call(this.application.ninja.documentController.activeDocument._liveNodeList, 0); 88 this.domTree = this.application.ninja.currentDocument.model.views.design.getLiveNodeList(true);
93 // Index of the current container 89 // Index of the current container
94 containerIndex = this.domTree.indexOf(this.application.ninja.currentSelectedContainer); 90 containerIndex = this.domTree.indexOf(this.application.ninja.currentSelectedContainer);
95 91
@@ -241,7 +237,7 @@ exports.Layout = Montage.create(Component, {
241 value: function() { 237 value: function() {
242 if(this.application.ninja.currentDocument) { 238 if(this.application.ninja.currentDocument) {
243 this.clearCanvas(); 239 this.clearCanvas();
244 this.WalkDOM(this.application.ninja.currentDocument.documentRoot); 240 this.WalkDOM(this.application.ninja.currentDocument.model.documentRoot);
245 241
246 //drawUtils.updatePlanes(); 242 //drawUtils.updatePlanes();
247 //if(this.application.ninja.currentDocument.draw3DGrid) drawUtils.drawWorkingPlane(); 243 //if(this.application.ninja.currentDocument.draw3DGrid) drawUtils.drawWorkingPlane();
@@ -253,7 +249,7 @@ exports.Layout = Montage.create(Component, {
253 drawElementsOutline: { 249 drawElementsOutline: {
254 value: function(elements) { 250 value: function(elements) {
255 this.clearCanvas(); 251 this.clearCanvas();
256 this.WalkDOM(this.application.ninja.currentDocument.documentRoot, elements); 252 this.WalkDOM(this.application.ninja.currentDocument.model.documentRoot, elements);
257 } 253 }
258 }, 254 },
259 255
diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js
index 0d53696b..896d4a5b 100755
--- a/js/stage/stage-deps.js
+++ b/js/stage/stage-deps.js
@@ -26,38 +26,10 @@ exports.StageDeps = Montage.create(Component, {
26 value: drawUtils 26 value: drawUtils
27 }, 27 },
28 28