aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/selection-controller.js22
-rwxr-xr-xjs/lib/NJUtils.js32
-rwxr-xr-xjs/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js7
-rw-r--r--js/panels/presets/default-animation-presets.js79
4 files changed, 100 insertions, 40 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index fa82d4cc..9b0e638a 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -155,28 +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 }
178 }
179
180 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 158 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
181 159
182 } 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/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
index 87c68a52..599eeda3 100755
--- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
+++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
@@ -291,6 +291,13 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
291 '-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)'
292 }; 292 };
293 293
294 var defaultStyles = component.defaultStyles;
295 if(defaultStyles) {
296 for(var n in defaultStyles) {
297 styles[n] = defaultStyles[n];
298 }
299 }
300
294 that.application.ninja.currentDocument.setComponentInstance(instance, element); 301 that.application.ninja.currentDocument.setComponentInstance(instance, element);
295 302
296 NJevent("elementAdding", {"el": element, "data":styles}); 303 NJevent("elementAdding", {"el": element, "data":styles});
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 }
90 }] 90 }]
91 }] 91 }]
92 },
93 {
94 "text": "Rotate with Fade In",
95 "selectorBase" : "rotate-with-fade-in",
96 "rules" : [{
97 "selectorSuffix" : "",
98 "styles" : {
99 "-webkit-animation-name": "rotate-with-fade-in",
100 "-webkit-animation-duration": "5s",
101 "-webkit-animation-iteration-count": "infinite",
102 "-webkit-animation-direction": "normal",
103 "-webkit-animation-timing-function": "ease-out",
104 "-webkit-transform-origin": "100% 50%",
105 "-webkit-transform-style": "preserve-3d",
106 "-webkit-transform": "perspective(1000)",
107 "-webkit-animation-delay": "0s"
108 }
109 },{
110 "isKeyFrameRule": true,
111 "keys" : [{
112 "keyText": "0%",
113 "styles": {
114 "opacity": "0",
115 "-webkit-transform": "perspective(1000) rotateY(-90deg)"
116 }
117 }, {
118 "keyText": "15%",
119 "styles": {
120 "opacity": "1",
121 "-webkit-transform": "perspective(1000) rotateY(0deg)"
122 }
123 }, {
124 "keyText": "85%",
125 "styles": {
126 "opacity": "1",
127 "-webkit-transform": "perspective(1000) rotateY(0deg)"
128 }
129 }, {
130 "keyText": "100%",
131 "styles": {
132 "opacity": "0",
133 "-webkit-transform": "perspective(1000) rotateY(95deg)"
134 }
135 }]
136 }]
92 }] 137 }]
93 }] 138 }]
94}; \ No newline at end of file 139}; \ No newline at end of file