aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-03 12:20:10 -0800
committerValerio Virgillito2012-02-03 12:20:10 -0800
commite6e539f345f5e1ac36a595db5d1a1c3700715e88 (patch)
tree39846bf1570f9b5a4057b726c54905de9e9e1c02 /js/controllers
parent7950424cf704bb221971f4645406b01e6979db18 (diff)
parentc630ead20487c3948fa36448d3e7d5f7b5cba782 (diff)
downloadninja-e6e539f345f5e1ac36a595db5d1a1c3700715e88.tar.gz
Merge branch 'master' into components
Conflicts: node_modules/montage/ui/bluemoon/progress.reel/progress.html node_modules/montage/ui/image2.reel/image2.html node_modules/ninja-components/effect/desaturate-effect.js node_modules/ninja-components/effect/effect.js node_modules/ninja-components/effect/invert-effect.js node_modules/ninja-components/effect/kaliedoscope-effect.js node_modules/ninja-components/effect/multiply-effect.js node_modules/ninja-components/effect/sepia-effect.js node_modules/ninja-components/flow-controller.reel/flow-controller.html node_modules/ninja-components/flow-controller.reel/flow-controller.js node_modules/ninja-components/flow-offset.js node_modules/ninja-components/hottext.reel/hottext.css node_modules/ninja-components/hottext.reel/hottext.html node_modules/ninja-components/hottext.reel/hottext.js node_modules/ninja-components/hottextunit.reel/hottextunit.css node_modules/ninja-components/hottextunit.reel/hottextunit.html node_modules/ninja-components/hottextunit.reel/hottextunit.js node_modules/ninja-components/image2.reel/image2.html node_modules/ninja-components/image2.reel/image2.js node_modules/ninja-components/image3d.reel/image3d.html node_modules/ninja-components/image3d.reel/image3d.js node_modules/ninja-components/photo-editor.reel/photo-editor.css node_modules/ninja-components/photo-editor.reel/photo-editor.html node_modules/ninja-components/photo-editor.reel/photo-editor.js node_modules/ninja-components/slider-base.js user-document-templates/montage-application-cloud/appdelegate.js Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers')
-rw-r--r--js/controllers/elements/canvas-controller.js14
-rw-r--r--js/controllers/elements/element-controller.js61
-rw-r--r--js/controllers/elements/shapes-controller.js28
-rw-r--r--js/controllers/styles-controller.js2
4 files changed, 66 insertions, 39 deletions
diff --git a/js/controllers/elements/canvas-controller.js b/js/controllers/elements/canvas-controller.js
index 21de9879..b5df3911 100644
--- a/js/controllers/elements/canvas-controller.js
+++ b/js/controllers/elements/canvas-controller.js
@@ -34,12 +34,12 @@ exports.CanvasController = Montage.create(ElementController, {
34 } 34 }
35 } 35 }
36 }, 36 },
37 37
38 setProperties: { 38 setProperties: {
39 value: function(el, props, index) { 39 value: function(el, props, index) {
40 for(var p in props) { 40 for(var p in props) {
41 el.elementModel.controller.setProperty(el, p, props[p][index]); 41 el.elementModel.controller.setProperty(el, p, props[p][index]);
42 } 42 }
43 } 43 }
44 } 44 }
45}); \ No newline at end of file 45}); \ No newline at end of file
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index f254220c..f2b54014 100644
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -127,36 +127,35 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
127 } 127 }
128 else 128 else
129 { 129 {
130 // TODO - for now, just return the identity matrix 130 var mat;
131 return Matrix.I(4); 131
132// var mat; 132 if (el)
133// 133 {
134// if (elt) 134 var xformStr = this.application.ninja.elementMediator.getProperty(el, "-webkit-transform");
135// { 135 if (xformStr)
136// var xformStr = ElementsMediator.getProperty(elt, "-webkit-transform"); 136 mat = this.transformStringToMat( xformStr );
137// if (xformStr) 137 if (!mat)
138// mat = this.transformStringToMat( xformStr ); 138 mat = Matrix.I(4);
139// if (!mat) 139
140// mat = Matrix.I(4); 140 var zoom = this.application.ninja.elementMediator.getProperty(el, "zoom");
141// 141 if (zoom)
142// if (elt.style && elt.style.zoom) 142 {
143// { 143 zoom = Number(zoom);
144// var zoom = Number(elt.style.zoom); 144 if (zoom != 1)
145// if (zoom != 1) 145 {
146// { 146 var zoomMat = Matrix.create( [
147// var zoomMat = Matrix.create( [ 147 [ zoom, 0, 0, 0],
148// [ zoom, 0, 0, 0], 148 [ 0, zoom, 0, 0],
149// [ 0, zoom, 0, 0], 149 [ 0, 0, zoom, 0],
150// [ 0, 0, zoom, 0], 150 [ 0, 0, 0, 1]
151// [ 0, 0, 0, 1] 151 ] );
152// ] ); 152 glmat4.multiply( zoomMat, mat, mat );
153// glmat4.multiply( zoomMat, mat, mat ); 153 }
154// } 154 }
155// } 155 }
156// } 156
157// 157 el.elementModel.props3D.matrix3d = mat;
158// elt.elementModel.props3D.matrix3d = mat; 158 return mat;
159// return mat;
160 } 159 }
161 } 160 }
162 }, 161 },
@@ -207,7 +206,7 @@ var ElementController = exports.ElementController = Montage.create(NJComponent,
207 el.elementModel.props3D.matrix3d = mat; 206 el.elementModel.props3D.matrix3d = mat;
208 el.elementModel.props3D.perspectiveDist = dist; 207 el.elementModel.props3D.perspectiveDist = dist;
209 208
210// if(update3DModel) 209 if(update3DModel)
211 { 210 {
212 this._update3DProperties(el, mat, dist); 211 this._update3DProperties(el, mat, dist);
213 } 212 }
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index d34644a7..c5f22138 100644
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -24,6 +24,26 @@ exports.ShapesController = Montage.create(CanvasController, {
24 el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100); 24 el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100);
25 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 25 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
26 break; 26 break;
27 case "tlRadius":
28 this.setShapeProperty(el, "tlRadius", value);
29 el.elementModel.shapeModel.GLGeomObj.setTLRadius(val);
30 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
31 break;
32 case "trRadius":
33 this.setShapeProperty(el, "trRadius", value);
34 el.elementModel.shapeModel.GLGeomObj.setTRRadius(val);
35 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
36 break;
37 case "blRadius":
38 this.setShapeProperty(el, "blRadius", value);
39 el.elementModel.shapeModel.GLGeomObj.setBLRadius(val);
40 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
41 break;
42 case "brRadius":
43 this.setShapeProperty(el, "brRadius", value);
44 el.elementModel.shapeModel.GLGeomObj.setBRRadius(val);
45 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
46 break;
27 case "width": 47 case "width":
28 el.elementModel.shapeModel.GLGeomObj.setWidth(val); 48 el.elementModel.shapeModel.GLGeomObj.setWidth(val);
29 CanvasController.setProperty(el, p, value); 49 CanvasController.setProperty(el, p, value);
@@ -46,8 +66,16 @@ exports.ShapesController = Montage.create(CanvasController, {
46 getProperty: { 66 getProperty: {
47 value: function(el, p) { 67 value: function(el, p) {
48 switch(p) { 68 switch(p) {
69 case "stroke":
70 case "fill":
49 case "strokeSize": 71 case "strokeSize":
50 case "innerRadius": 72 case "innerRadius":
73 case "tlRadius":
74 case "trRadius":
75 case "blRadius":
76 case "brRadius":
77 case "strokeMaterial":
78 case "fillMaterial":
51 return this.getShapeProperty(el, p); 79 return this.getShapeProperty(el, p);
52 default: 80 default:
53 return CanvasController.getProperty(el, p); 81 return CanvasController.getProperty(el, p);
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js
index d462bc98..afd298c9 100644
--- a/js/controllers/styles-controller.js
+++ b/js/controllers/styles-controller.js
@@ -7,7 +7,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
7var Montage = require("montage/core/core").Montage, 7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component, 8 Component = require("montage/ui/component").Component,
9 cssShorthandMap = require("js/panels/CSSPanel/css-shorthand-map").CSS_SHORTHAND_MAP, 9 cssShorthandMap = require("js/panels/CSSPanel/css-shorthand-map").CSS_SHORTHAND_MAP,
10 nj = require("js/lib/NJUtils.js").NJUtils; 10 nj = require("js/lib/NJUtils").NJUtils;
11 11
12/* 12/*
13 13