diff options
author | John Mayhew | 2012-04-02 16:28:39 -0700 |
---|---|---|
committer | John Mayhew | 2012-04-02 16:28:39 -0700 |
commit | b4155fb4c33675a8a7cd37473513718043fdf0ba (patch) | |
tree | 3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/lib/NJUtils.js | |
parent | 5ba9aeac94c86049423fd5d4b37b277263939c13 (diff) | |
parent | c6de22bf42be90b403491b5f87b1818d9020310c (diff) | |
download | ninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts:
js/helper-classes/RDGE/rdge-compiled.js
js/helper-classes/RDGE/runtime/GLRuntime.js
js/helper-classes/RDGE/src/core/script/MeshManager.js
js/helper-classes/RDGE/src/core/script/engine.js
js/helper-classes/RDGE/src/core/script/fx/ssao.js
js/helper-classes/RDGE/src/core/script/init_state.js
js/helper-classes/RDGE/src/core/script/run_state.js
js/helper-classes/RDGE/src/core/script/scenegraphNodes.js
js/helper-classes/RDGE/src/core/script/utilities.js
js/helper-classes/RDGE/src/tools/compile-rdge-core.bat
js/helper-classes/RDGE/src/tools/compile-rdge-core.sh
js/helper-classes/RDGE/src/tools/rdge-compiled.js
js/lib/drawing/world.js
js/lib/rdge/materials/bump-metal-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/fly-material.js
js/lib/rdge/materials/julia-material.js
js/lib/rdge/materials/keleidoscope-material.js
js/lib/rdge/materials/linear-gradient-material.js
js/lib/rdge/materials/mandel-material.js
js/lib/rdge/materials/plasma-material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/radial-blur-material.js
js/lib/rdge/materials/radial-gradient-material.js
js/lib/rdge/materials/relief-tunnel-material.js
js/lib/rdge/materials/square-tunnel-material.js
js/lib/rdge/materials/star-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/tunnel-material.js
js/lib/rdge/materials/twist-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/uber-material.js
js/lib/rdge/materials/water-material.js
js/lib/rdge/materials/z-invert-material.js
js/preloader/Preloader.js
Diffstat (limited to 'js/lib/NJUtils.js')
-rwxr-xr-x | js/lib/NJUtils.js | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index e16715a4..904aa41e 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js | |||
@@ -96,15 +96,45 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
96 | value: function(el, selection, controller, isShape) { | 96 | value: function(el, selection, controller, isShape) { |
97 | var p3d = Montage.create(Properties3D).init(el); | 97 | var p3d = Montage.create(Properties3D).init(el); |
98 | var shapeProps = null; | 98 | var shapeProps = null; |
99 | var pi = controller + "Pi"; | ||
100 | |||
99 | if(isShape) { | 101 | if(isShape) { |
100 | shapeProps = Montage.create(ShapeModel); | 102 | shapeProps = Montage.create(ShapeModel); |
101 | } | 103 | } |
102 | 104 | ||
105 | if(el.controller) { | ||
106 | |||
107 | var componentInfo = Montage.getInfoForObject(el.controller); | ||
108 | var componentName = componentInfo.objectName.toLowerCase(); | ||
109 | |||
110 | controller = "component"; | ||
111 | isShape = false; | ||
112 | |||
113 | switch(componentName) { | ||
114 | case "feedreader": | ||
115 | selection = "Feed Reader"; | ||
116 | pi = "FeedReaderPi"; | ||
117 | break; | ||
118 | case "map": | ||
119 | selection = "Map"; | ||
120 | pi = "MapPi"; | ||
121 | break; | ||
122 | case "youtubechannel": | ||
123 | selection = "Youtube Channel"; | ||
124 | pi = "YoutubeChannelPi"; | ||
125 | break; | ||
126 | case "picasacarousel": | ||
127 | selection = "Picasa Carousel"; | ||
128 | pi = "PicasaCarouselPi"; | ||
129 | break; | ||
130 | } | ||
131 | } | ||
132 | |||
103 | el.elementModel = Montage.create(ElementModel, { | 133 | el.elementModel = Montage.create(ElementModel, { |
104 | type: { value: el.nodeName}, | 134 | type: { value: el.nodeName}, |
105 | selection: { value: selection}, | 135 | selection: { value: selection}, |
106 | controller: { value: ControllerFactory.getController(controller)}, | 136 | controller: { value: ControllerFactory.getController(controller)}, |
107 | pi: { value: controller + "Pi"}, | 137 | pi: { value: pi}, |
108 | props3D: { value: p3d}, | 138 | props3D: { value: p3d}, |
109 | shapeModel: { value: shapeProps} | 139 | shapeModel: { value: shapeProps} |
110 | }); | 140 | }); |
@@ -116,7 +146,39 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
116 | ///// TODO: Selection and model should be based on the element type | 146 | ///// TODO: Selection and model should be based on the element type |
117 | makeModelFromElement: { | 147 | makeModelFromElement: { |
118 | value: function(el) { | 148 | value: function(el) { |
119 | this.makeElementModel(el, "Div", "block", false); | 149 | var selection = "div", |
150 | controller = "block", | ||
151 | isShape = false; | ||
152 | switch(el.nodeName.toLowerCase()) | ||
153 | { | ||
154 | case "div": | ||
155 | break; | ||
156 | case "img": | ||
157 | selection = "image"; | ||
158 | controller = "image"; | ||
159 | break; | ||
160 | case "video": | ||
161 | selection = "video"; | ||
162 | controller = "video"; | ||
163 | break; | ||
164 | case "canvas": | ||
165 | isShape = el.getAttribute("data-RDGE-id"); | ||
166 | if(isShape) | ||
167 | { | ||
168 | // TODO - Need more info about the shape | ||
169 | selection = "canvas"; | ||
170 | controller = "shape"; | ||
171 | } | ||
172 | else | ||
173 | { | ||
174 | selection = "canvas"; | ||
175 | controller = "canvas"; | ||
176 | } | ||
177 | break; | ||
178 | case "shape": | ||
179 | break; | ||
180 | } | ||
181 | this.makeElementModel(el, selection, controller, isShape); | ||
120 | } | 182 | } |
121 | }, | 183 | }, |
122 | 184 | ||