aboutsummaryrefslogtreecommitdiff
path: root/js/lib/NJUtils.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/NJUtils.js')
-rwxr-xr-xjs/lib/NJUtils.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js
index 4c181ab8..96e1d6da 100755
--- a/js/lib/NJUtils.js
+++ b/js/lib/NJUtils.js
@@ -98,15 +98,45 @@ exports.NJUtils = Object.create(Object.prototype, {
98 value: function(el, selection, controller, isShape) { 98 value: function(el, selection, controller, isShape) {
99 var p3d = Montage.create(Properties3D).init(el); 99 var p3d = Montage.create(Properties3D).init(el);
100 var shapeProps = null; 100 var shapeProps = null;
101 var pi = controller + "Pi";
102
101 if(isShape) { 103 if(isShape) {
102 shapeProps = Montage.create(ShapeModel); 104 shapeProps = Montage.create(ShapeModel);
103 } 105 }
104 106
107 if(el.controller) {
108
109 var componentInfo = Montage.getInfoForObject(el.controller);
110 var componentName = componentInfo.objectName.toLowerCase();
111
112 controller = "component";
113 isShape = false;
114
115 switch(componentName) {
116 case "feedreader":
117 selection = "Feed Reader";
118 pi = "FeedReaderPi";
119 break;
120 case "map":
121 selection = "Map";
122 pi = "MapPi";
123 break;
124 case "youtubechannel":
125 selection = "Youtube Channel";
126 pi = "YoutubeChannelPi";
127 break;
128 case "picasacarousel":
129 selection = "Picasa Carousel";
130 pi = "PicasaCarouselPi";
131 break;
132 }
133 }
134
105 el.elementModel = Montage.create(ElementModel, { 135 el.elementModel = Montage.create(ElementModel, {
106 type: { value: el.nodeName}, 136 type: { value: el.nodeName},
107 selection: { value: selection}, 137 selection: { value: selection},
108 controller: { value: ControllerFactory.getController(controller)}, 138 controller: { value: ControllerFactory.getController(controller)},
109 pi: { value: controller + "Pi"}, 139 pi: { value: pi},
110 props3D: { value: p3d}, 140 props3D: { value: p3d},
111 shapeModel: { value: shapeProps} 141 shapeModel: { value: shapeProps}
112 }); 142 });