diff options
Diffstat (limited to 'js/panels')
6 files changed, 174 insertions, 54 deletions
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js index b4eec771..599eeda3 100755 --- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js +++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | |||
@@ -23,6 +23,36 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
23 | "text": "styles", | 23 | "text": "styles", |
24 | "children": [ | 24 | "children": [ |
25 | { | 25 | { |
26 | "text": "Widgets", | ||
27 | "children": [ | ||
28 | { | ||
29 | "text": "Feed Reader", | ||
30 | "dataFile" : "node_modules/components-data/feed-reader.json", | ||
31 | "component": "feedreader" | ||
32 | }, | ||
33 | { | ||
34 | "text": "Map", | ||
35 | "dataFile" : "node_modules/components-data/map.json", | ||
36 | "component": "map" | ||
37 | }, | ||
38 | { | ||
39 | "text": "Picasa Carousel", | ||
40 | "dataFile" : "node_modules/components-data/picasa-carousel.json", | ||
41 | "component": "picasa-carousel" | ||
42 | }, | ||
43 | { | ||
44 | "text": "Search Bar", | ||
45 | "dataFile" : "node_modules/components-data/searchfield.json", | ||
46 | "component": "searchfield" | ||
47 | }, | ||
48 | { | ||
49 | "text": "Youtube Channel", | ||
50 | "dataFile" : "node_modules/components-data/youtube-channel.json", | ||
51 | "component": "youtube-channel" | ||
52 | } | ||
53 | ] | ||
54 | }, | ||
55 | { | ||
26 | "text": "Montage Components", | 56 | "text": "Montage Components", |
27 | "children": [ | 57 | "children": [ |
28 | { | 58 | { |
@@ -50,7 +80,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
50 | "dataFile" : "node_modules/components-data/number-input.json", | 80 | "dataFile" : "node_modules/components-data/number-input.json", |
51 | "component": "numberInput" | 81 | "component": "numberInput" |
52 | }, | 82 | }, |
53 | { | 83 | { |
54 | "text": "Select Input", | 84 | "text": "Select Input", |
55 | "dataFile" : "node_modules/components-data/select.json", | 85 | "dataFile" : "node_modules/components-data/select.json", |
56 | "component": "select" | 86 | "component": "select" |
@@ -129,15 +159,19 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
129 | _loadComponents: { | 159 | _loadComponents: { |
130 | value: function() { | 160 | value: function() { |
131 | 161 | ||
132 | this.componentsToLoad = this.components.children[0].children.length; | 162 | for(var cat in this.components.children) { |
163 | |||
164 | this.componentsToLoad += this.components.children[cat].children.length; | ||
165 | |||
166 | for(var i = 0, component; component = this.components.children[cat].children[i]; i++) { | ||
167 | var req = new XMLHttpRequest(); | ||
168 | //req.identifier = "searchRequest"; | ||
169 | req.open("GET", component.dataFile); | ||
170 | req.addEventListener("load", this, false); | ||
171 | req.addEventListener("error", this, false); | ||
172 | req.send(); | ||
173 | } | ||
133 | 174 | ||
134 | for(var i = 0, component; component = this.components.children[0].children[i]; i++) { | ||
135 | var req = new XMLHttpRequest(); | ||
136 | //req.identifier = "searchRequest"; | ||
137 | req.open("GET", component.dataFile); | ||
138 | req.addEventListener("load", this, false); | ||
139 | req.addEventListener("error", this, false); | ||
140 | req.send(); | ||
141 | } | 175 | } |
142 | } | 176 | } |
143 | }, | 177 | }, |
@@ -257,6 +291,13 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
257 | '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' | 291 | '-webkit-transform' : 'perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)' |
258 | }; | 292 | }; |
259 | 293 | ||
294 | var defaultStyles = component.defaultStyles; | ||
295 | if(defaultStyles) { | ||
296 | for(var n in defaultStyles) { | ||
297 | styles[n] = defaultStyles[n]; | ||
298 | } | ||
299 | } | ||
300 | |||
260 | that.application.ninja.currentDocument.setComponentInstance(instance, element); | 301 | that.application.ninja.currentDocument.setComponentInstance(instance, element); |
261 | 302 | ||
262 | NJevent("elementAdding", {"el": element, "data":styles}); | 303 | NJevent("elementAdding", {"el": element, "data":styles}); |
@@ -313,6 +354,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
313 | el.setAttribute("type", "range"); | 354 | el.setAttribute("type", "range"); |
314 | break; | 355 | break; |
315 | case "textfield": | 356 | case "textfield": |
357 | case "searchfield": | ||
316 | el = NJUtils.makeNJElement("input", "Textfield", "component"); | 358 | el = NJUtils.makeNJElement("input", "Textfield", "component"); |
317 | el.elementModel.pi = "TextfieldPi"; | 359 | el.elementModel.pi = "TextfieldPi"; |
318 | el.setAttribute("type", "text"); | 360 | el.setAttribute("type", "text"); |
@@ -326,6 +368,27 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component | |||
326 | el.elementModel.pi = "ToggleButtonPi"; | 368 | el.elementModel.pi = "ToggleButtonPi"; |
327 | el.innerHTML = "Off"; | 369 | el.innerHTML = "Off"; |
328 | break; | 370 | break; |
371 | case "map": | ||
372 | el = NJUtils.makeNJElement("div", "Map", "component"); | ||
373 | el.elementModel.pi = "MapPi"; | ||
374 | el.elementModel.isComponent = true; | ||
375 | break; | ||
376 | case "feedreader": | ||
377 | el = NJUtils.makeNJElement("div", "Feed Reader", "component"); | ||
378 | el.elementModel.pi = "FeedReaderPi"; | ||
379 | el.elementModel.isComponent = true; | ||
380 | break; | ||
381 | case "picasa-carousel": | ||
382 | el = NJUtils.makeNJElement("div", "Picasa Carousel", "component"); | ||
383 | el.elementModel.pi = "PicasaCarouselPi"; | ||
384 | el.elementModel.isComponent = true; | ||
385 | break; | ||
386 | case "youtube-channel": | ||
387 | el = NJUtils.makeNJElement("div", "Youtube Channel", "component"); | ||
388 | el.elementModel.pi = "YoutubeChannelPi"; | ||
389 | el.elementModel.isComponent = true; | ||
390 | break; | ||
391 | |||
329 | } | 392 | } |
330 | 393 | ||
331 | return el; | 394 | return el; |
diff --git a/js/panels/presets/default-animation-presets.js b/js/panels/presets/default-animation-presets.js index 10a3e906..2e656e86 100644 --- a/js/panels/presets/default-animation-presets.js +++ b/js/panels/presets/default-animation-presets.js | |||
@@ -18,23 +18,23 @@ exports.animationPresets = { | |||
18 | "-webkit-animation": "border-morph 2s infinite" | 18 | "-webkit-animation": "border-morph 2s infinite" |
19 | } | 19 | } |
20 | }, | 20 | }, |
21 | { | 21 | { |
22 | "isKeyFrameRule": true, | 22 | "isKeyFrameRule": true, |
23 | "keys" : [{ | 23 | "keys" : [{ |
24 | "keyText": "0%", | 24 | "keyText": "0%", |
25 | "styles": { "border-radius": "0" } | 25 | "styles": { "border-radius": "0" } |
26 | }, { | 26 | }, { |
27 | "keyText": "50%", | 27 | "keyText": "50%", |
28 | "styles": { | 28 | "styles": { |
29 | "border-radius": "100%" | 29 | "border-radius": "100%" |
30 | } | 30 | } |
31 | }, { | 31 | }, { |
32 | "keyText": "100%", | 32 | "keyText": "100%", |
33 | "styles": { | 33 | "styles": { |
34 | "border-radius": "0%" | 34 | "border-radius": "0%" |
35 | } | 35 | } |
36 | }] | ||
36 | }] | 37 | }] |
37 | }] | ||
38 | }] | 38 | }] |
39 | }, { | 39 | }, { |
40 | "text": "3D Animations", | 40 | "text": "3D Animations", |
@@ -50,7 +50,7 @@ exports.animationPresets = { | |||
50 | "-webkit-animation-iteration-count": "infinite", | 50 | "-webkit-animation-iteration-count": "infinite", |
51 | "-webkit-animation-direction": "normal", | 51 | "-webkit-animation-direction": "normal", |
52 | "-webkit-animation-timing-function": "ease-out", | 52 | "-webkit-animation-timing-function": "ease-out", |
53 | "-webkit-transform-origin": "200% 50%", | 53 | "-webkit-transform-origin": "100% 50%", |
54 | "-webkit-transform-style": "preserve-3d", | 54 | "-webkit-transform-style": "preserve-3d", |
55 | "-webkit-transform": "perspective(1000)", | 55 | "-webkit-transform": "perspective(1000)", |
56 | "-webkit-animation-delay": "0s" | 56 | "-webkit-animation-delay": "0s" |
@@ -89,6 +89,51 @@ exports.animationPresets = { | |||
89 | } | 89 | } |