diff options
author | Jose Antonio Marquez | 2012-03-21 09:53:08 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-21 09:53:08 -0700 |
commit | beb72aa033f42d09d54a4ea6cc6b5ca59cc6fae7 (patch) | |
tree | 71ee74df0c3a56b680e4aa80f23905fcb1cc84f1 /js/lib | |
parent | 37cafa09653ff3e2cb88c5b51cdc1f6e066aa3e8 (diff) | |
parent | 31eee2972667d7553974f0857fdc458954219203 (diff) | |
download | ninja-beb72aa033f42d09d54a4ea6cc6b5ca59cc6fae7.tar.gz |
Merge branch 'refs/heads/francoisfrisch-Ninja-Internal' into FileIO-Montage-Components
Diffstat (limited to 'js/lib')
-rwxr-xr-x | js/lib/NJUtils.js | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index 4f1082f9..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 | }); |