aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/controllers/selection-controller.js27
-rwxr-xr-xjs/lib/NJUtils.js32
-rw-r--r--node_modules/components-data/feed-reader.json6
-rw-r--r--node_modules/montage/examples/feed-reader/main.reel/main.html42
-rw-r--r--node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html4
-rw-r--r--node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js83
-rw-r--r--node_modules/montage/ui/youtube-channel.reel/youtube-channel.html14
-rw-r--r--node_modules/montage/ui/youtube-channel.reel/youtube-channel.js4
8 files changed, 141 insertions, 71 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index 5091f99a..9b0e638a 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -155,33 +155,6 @@ exports.SelectionController = Montage.create(Component, {
155 this._isDocument = true; 155 this._isDocument = true;
156 } 156 }
157 157
158 if(item && item.controller && !item.elementModel.isComponent) {
159 var componentInfo = Montage.getInfoForObject(item.controller);
160 var componentName = componentInfo.objectName.toLowerCase();
161 switch(componentName) {
162 case "feedreader":
163 NJUtils.makeElementModel(item, "Feed Reader", "component", false);
164 item.elementModel.pi = "FeedReaderPi";
165 item.elementModel.isComponent = true;
166 break;
167 case "map":
168 NJUtils.makeElementModel(item, "Map", "component", false);
169 item.elementModel.pi = "MapPi";
170 item.elementModel.isComponent = true;
171 break;
172 case "youtubechannel":
173 NJUtils.makeElementModel(item, "Youtube Channel", "component", false);
174 item.elementModel.pi = "YoutubeChannelPi";
175 item.elementModel.isComponent = true;
176 break;
177 case "picasacarousel":
178 NJUtils.makeElementModel(item, "Picasa Carousel", "component", false);
179 item.elementModel.pi = "PicasaCarouselPi";
180 item.elementModel.isComponent = true;
181 break;
182 }
183 }
184
185 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 158 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
186 159
187 } 160 }
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 });
diff --git a/node_modules/components-data/feed-reader.json b/node_modules/components-data/feed-reader.json
index 6caf768d..aa9bf340 100644
--- a/node_modules/components-data/feed-reader.json
+++ b/node_modules/components-data/feed-reader.json
@@ -11,5 +11,9 @@
11 "type": "string", 11 "type": "string",
12 "default": null 12 "default": null
13 } 13 }
14 ] 14 ],
15 "defaultStyles": {
16 "width":"350px",
17 "height":"250px"
18 }
15} \ No newline at end of file 19} \ No newline at end of file
diff --git a/node_modules/montage/examples/feed-reader/main.reel/main.html b/node_modules/montage/examples/feed-reader/main.reel/main.html
index 50bac601..1313219f 100644
--- a/node_modules/montage/examples/feed-reader/main.reel/main.html
+++ b/node_modules/montage/examples/feed-reader/main.reel/main.html
@@ -45,8 +45,8 @@
45 "name": "FeedReader", 45 "name": "FeedReader",
46 "properties": { 46 "properties": {
47 "element": {"#": "feed-reader"}, 47 "element": {"#": "feed-reader"},
48 "feedDisplayMode": "timed", 48 "feedDisplayMode": "animation",
49 "interval": "5" 49 "interval": "3"
50 } 50 }
51 }, 51 },
52 52
@@ -170,6 +170,7 @@
170 margin-top: 10px; 170 margin-top: 10px;
171 } 171 }
172 172
173
173 /* 174 /*
174 .feed-reader .feed-entry { 175 .feed-reader .feed-entry {
175 visibility:hidden; 176 visibility:hidden;
@@ -182,7 +183,42 @@
182 transition-delay:0s; 183 transition-delay:0s;
183 } 184 }
184 */ 185 */
186
187 @-webkit-keyframes rotateWithAlphaKeyframes {
188 0% {
189 opacity: 0;
190 -webkit-transform: perspective(1000) rotateY(95deg);
191 }
192 1% {
193 opacity: 0;
194 -webkit-transform: perspective(1000) rotateY(-90deg);
195 }
196 15% {
197 opacity: 1;
198 -webkit-transform: perspective(1000) rotateY(0deg);
199 }
200 85% {
201 opacity: 1;
202 -webkit-transform: perspective(1000) rotateY(0deg);
203 }
204 100% {
205 opacity: 0;
206 -webkit-transform: perspective(1000) rotateY(95deg);
207 }
208 }
209
210 .rotateWithAlphaAnimation {
211 -webkit-animation-name: rotateWithAlphaKeyframes;
212 -webkit-animation-duration: 5s;
213 -webkit-animation-iteration-count: infinite;
214 -webkit-animation-direction: normal;
215 -webkit-animation-timing-function: ease-out;
216 -webkit-transform-origin: 200% 50%;
217 -webkit-transform-style: preserve-3d;
218 -webkit-transform: perspective(1000);
219 }
185 220
221
186 </style> 222 </style>
187 223
188 224
@@ -201,7 +237,7 @@
201 <input type="button" id="btn-go" class="btn primary" value="OK"></button> 237 <input type="button" id="btn-go" class="btn primary" value="OK"></button>
202 </form> 238 </form>
203 </div> 239 </div>
204 <div class="feed-reader" id="feed-reader"></div> 240 <div class="feed-reader rotateWithAlphaAnimation" id="feed-reader" ></div>
205 </section> 241 </section>
206 242
207 <section class="map-container"> 243 <section class="map-container">
diff --git a/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html b/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html
index e5251e0a..21f3d4ee 100644
--- a/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html
+++ b/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.html
@@ -52,7 +52,9 @@
52 52
53 <style> 53 <style>
54 div.feed-reader { 54 div.feed-reader {
55 padding: 10px; 55 padding: 10px;
56 height: 250px;
57 width: 350px;
56 } 58 }
57 59
58 .feed-entry { 60 .feed-entry {
diff --git a/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js b/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js
index 8fd9ae22..0d5d7bb1 100644
--- a/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js
+++ b/node_modules/montage/ui/feed-reader/feed-reader.reel/feed-reader.js
@@ -40,35 +40,39 @@ exports.FeedReader = Montage.create(Component, {
40 this._fetchFeed();