aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/flow.reel
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-18 13:48:51 -0700
committerValerio Virgillito2012-04-18 13:48:51 -0700
commit2e04af953463643791f6362bd8ef4c6ba190abfa (patch)
treed07aaf646091ddf9dad5b030a7905055fd323490 /node_modules/montage/ui/flow.reel
parent616a8532099fec2a15855eac97cd85cb60c4451c (diff)
downloadninja-2e04af953463643791f6362bd8ef4c6ba190abfa.tar.gz
Squashed commit of the following:
commit 2054551bfb01a0f4ca2e138b9d724835462d45cd Merge: 765c2da 616a853 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Apr 18 13:48:21 2012 -0700 Merge branch 'refs/heads/master' into integration commit 765c2da8e1aa03550caf42b2bd5f367555ad2843 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 17 15:29:41 2012 -0700 updating the picasa carousel Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 9484f1c82b81e27edf2dc0a1bcc1fa3b12077406 Merge: d27f2df cacb4a2 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 17 15:03:50 2012 -0700 Merge branch 'refs/heads/master' into integration commit d27f2df4d846064444263d7832d213535962abe7 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Apr 11 10:39:36 2012 -0700 integrating new picasa carousel component Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 6f98384c9ecbc8abe55ccfe1fc25a0c7ce22c493 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 10 14:33:00 2012 -0700 fixed the text area case issue Text area was renamed from TextArea to Textarea Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 1e83e26652266136802bc7af930379c1ecd631a6 Author: Valerio Virgillito <valerio@motorola.com> Date: Mon Apr 9 22:10:45 2012 -0700 integrating montage v0.8 into ninja. Signed-off-by: Valerio Virgillito <valerio@motorola.com> Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/flow.reel')
-rw-r--r--node_modules/montage/ui/flow.reel/flow.html48
-rw-r--r--node_modules/montage/ui/flow.reel/flow.js1002
2 files changed, 778 insertions, 272 deletions
diff --git a/node_modules/montage/ui/flow.reel/flow.html b/node_modules/montage/ui/flow.reel/flow.html
index 646c87f8..8a9603bf 100644
--- a/node_modules/montage/ui/flow.reel/flow.html
+++ b/node_modules/montage/ui/flow.reel/flow.html
@@ -9,24 +9,43 @@
9 <title></title> 9 <title></title>
10 <script type="text/montage-serialization"> 10 <script type="text/montage-serialization">
11 { 11 {
12 "repetition1": { 12 "repetition": {
13 "module": "montage/ui/repetition.reel", 13 "prototype": "montage/ui/repetition.reel",
14 "name": "Repetition",
15 "properties": { 14 "properties": {
16 "element": { 15 "element": {
17 "#": "montage-flow-repetition" 16 "#": "montage-flow-repetition"
18 } 17 }
19 } 18 }
20 }, 19 },
20 "translateComposer": {
21 "prototype": "montage/ui/composer/translate-composer",
22 "properties": {
23 "component": {"@": "owner"},
24 "maxTranslateX": 250000,
25 "invertAxis": true
26 },
27 "bindings": {
28 "element": {"<-": "@owner._element"}
29 }
30 },
21 "owner": { 31 "owner": {
22 "module": "montage/ui/flow.reel", 32 "prototype": "montage/ui/flow.reel",
23 "name": "Flow",
24 "properties": { 33 "properties": {
25 "element": { 34 "element": {
26 "#": "montage-flow" 35 "#": "montage-flow"
27 }, 36 },
28 "_repetition": { 37 "_repetition": {
29 "@": "repetition1" 38 "@": "repetition"
39 },
40 "_translateComposer": {
41 "@": "translateComposer"
42 }
43 },
44 "bindings": {
45 "translateX": {"<-": "@translateComposer.translateX"},
46 "isSelectionEnabled": {
47 "boundObject": {"@": "repetition"},
48 "boundObjectPropertyPath": "isSelectionEnabled"
30 } 49 }
31 } 50 }
32 } 51 }
@@ -47,14 +66,23 @@
47 -webkit-transform-style: preserve-3d; 66 -webkit-transform-style: preserve-3d;
48 -webkit-transform: translateZ(0); 67 -webkit-transform: translateZ(0);
49 } 68 }
50 .montage-flow-repetition > * { 69 .montage-flow-repetition > div {
51 position: absolute !important; 70 position: absolute;
71 top: 50%;
72 left: 50%;
73 width: 0;
74 height: 0;
75 -webkit-transform: translateZ(0);
76 -webkit-transform-style: preserve-3d;
77 }
78 .montage-flow-pointer-events-none {
79 pointer-events: none;
52 } 80 }
53 </style> 81 </style>
54</head> 82</head>
55<body> 83<body>
56 <div id="montage-flow" class="montage-flow"> 84 <div data-montage-id="montage-flow" class="montage-flow">
57 <div id="montage-flow-repetition" class="montage-flow-repetition"></div> 85 <div data-montage-id="montage-flow-repetition" class="montage-flow-repetition"></div>
58 </div> 86 </div>
59</body> 87</body>
60</html> 88</html>
diff --git a/node_modules/montage/ui/flow.reel/flow.js b/node_modules/montage/ui/flow.reel/flow.js
index 089353a8..929e61b8 100644
--- a/node_modules/montage/ui/flow.reel/flow.js
+++ b/node_modules/montage/ui/flow.reel/flow.js
@@ -5,145 +5,319 @@
5 </copyright> */ 5 </copyright> */
6 6
7var Montage = require("montage").Montage, 7var Montage = require("montage").Montage,
8 Component = require("ui/component").Component; 8 Component = require("ui/component").Component,
9 FlowBezierSpline = require("ui/flow-bezier-spline").FlowBezierSpline;
9 10
10var Flow = exports.Flow = Montage.create(Component, { 11var Flow = exports.Flow = Montage.create(Component, {
11 12
12 // TODO: Review _externalUpdate 13 _splinePaths: {
14 enumerable: false,
15 value: null
16 },
13 17
14 _externalUpdate: { 18 splinePaths: {
15 enumerable: false, 19 enumerable: false,
16 value: true 20 get: function () {
21 if (!this._splinePaths) {
22 this._splinePaths = [];
23 }
24 return this._splinePaths;
25 },
26 set: function (value) {
27 this._splinePaths = value;
28 }
17 }, 29 },
18 30
19 _isCameraUpdated: { 31 appendPath: {
32 value: function (path) {
33 var splinePath = Object.create(FlowBezierSpline),
34 pathKnots = path.knots,
35 length = path.knots.length,
36 knots = [],
37 nextHandlers = [],
38 previousHandlers = [],
39 densities = [],
40 i;
41
42 for (i = 0; i < length; i++) {
43 knots[i] = pathKnots[i].knotPosition;
44 previousHandlers[i] = pathKnots[i].previousHandlerPosition;
45 nextHandlers[i] = pathKnots[i].nextHandlerPosition;
46 densities[i] = pathKnots[i].previousDensity; // TODO: implement previous/next density
47 // TODO: add rotations, arbitrary CSS and units
48 }
49 splinePath.knots = knots;
50 splinePath.previousHandlers = previousHandlers;
51 splinePath.nextHandlers = nextHandlers;
52 splinePath.densities = densities;
53 splinePath._computeDensitySummation();
54 this.splinePaths.push(splinePath);
55 this._paths.push(path);
56 }
57 },
58
59 _paths: {
20 enumerable: false, 60 enumerable: false,
21 value: false 61 value: null
22 }, 62 },
23 63
24 // Camera rotation based in CSS3 rotate3D axis/angle system 64 paths: { // TODO: listen for changes?
65 get: function () {
66 return this._paths;
67 },
68 set: function (value) {
69 var length = value.length,
70 i;
25 71
26 _cameraRotationAxisX: { 72 if (length) {
73 this._paths = [];
74 for (i = 0; i < length; i++) {
75 this.appendPath(value[i]);
76 }
77 }
78 }
79 },
80
81 _cameraPosition: {
27 enumerable: false, 82 enumerable: false,
28 value: 0 83 value: [0, 0, 800]
29 }, 84 },
30 85
31 _cameraRotationAxisY: { 86 _cameraTargetPoint: {
32 enumerable: false, 87 enumerable: false,
33 value: 0 88 value: [0, 0, 0]
34 }, 89 },
35 90
36 _cameraRotationAxisZ: { 91 _cameraFov: {
37 enumerable: false, 92 enumerable: false,
38 value: 1 93 value: 50
39 }, 94 },
40 95
41 _cameraRotationAngle: { 96 // TODO: Implement camera roll
97
98 _cameraRoll: {
42 enumerable: false, 99 enumerable: false,
43 value: 0 100 value: 0
44 }, 101 },
45 102
46 cameraRotationAxisX: { 103 cameraPosition: {
47 get: function () {