diff options
-rwxr-xr-x | js/lib/geom/line.js | 70 | ||||
-rwxr-xr-x | js/panels/Splitter.js | 2 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css | 4 | ||||
-rw-r--r-- | js/panels/presets/animations-presets.reel/animations-presets.js | 47 | ||||
-rw-r--r-- | js/panels/presets/default-animation-presets.js | 2 | ||||
-rw-r--r-- | js/panels/presets/default-style-presets.js | 11 | ||||
-rw-r--r-- | js/panels/presets/default-transition-presets.js | 8 | ||||
-rw-r--r-- | js/panels/presets/style-presets.reel/style-presets.js | 49 | ||||
-rw-r--r-- | js/panels/presets/transitions-presets.reel/transitions-presets.js | 20 | ||||
-rw-r--r-- | js/panels/resize-composer.js | 34 | ||||
-rwxr-xr-x | js/tools/Translate3DToolBase.js | 21 | ||||
-rwxr-xr-x | js/tools/TranslateObject3DTool.js | 21 | ||||
-rwxr-xr-x | js/tools/modifier-tool-base.js | 14 |
13 files changed, 179 insertions, 124 deletions
diff --git a/js/lib/geom/line.js b/js/lib/geom/line.js index f3806fac..1e98855e 100755 --- a/js/lib/geom/line.js +++ b/js/lib/geom/line.js | |||
@@ -148,76 +148,6 @@ var Line = function GLLine( world, xOffset, yOffset, width, height, slope, strok | |||
148 | this.importMaterialsJSON( jObj.materials ); | 148 | this.importMaterialsJSON( jObj.materials ); |
149 | }; | 149 | }; |
150 | 150 | ||
151 | this.export = function() { | ||
152 | var rtnStr = "type: " + this.geomType() + "\n"; | ||
153 | |||
154 | rtnStr += "xoff: " + this._xOffset + "\n"; | ||
155 | rtnStr += "yoff: " + this._yOffset + "\n"; | ||
156 | rtnStr += "width: " + this._width + "\n"; | ||
157 | rtnStr += "height: " + this._height + "\n"; | ||
158 | rtnStr += "xAdj: " + this._xAdj + "\n"; | ||
159 | rtnStr += "yAdj: " + this._yAdj + "\n"; | ||
160 | rtnStr += "strokeWidth: " + this._strokeWidth + "\n"; | ||
161 | |||
162 | if(this._strokeColor.gradientMode) { | ||
163 | rtnStr += "strokeGradientMode: " + this._strokeColor.gradientMode + "\n"; | ||
164 | rtnStr += "strokeColor: " + this.gradientToString(this._strokeColor.color) + "\n"; | ||
165 | } else { | ||
166 | rtnStr += "strokeColor: " + String(this._strokeColor) + "\n"; | ||
167 | } | ||
168 | |||
169 | rtnStr += "strokeStyle: " + this._strokeStyle + "\n"; | ||
170 | rtnStr += "slope: " + String(this._slope) + "\n"; | ||
171 | |||
172 | rtnStr += "strokeMat: "; | ||
173 | if (this._strokeMaterial) { | ||
174 | rtnStr += this._strokeMaterial.getName(); | ||
175 | } else { | ||
176 | rtnStr += MaterialsModel.getDefaultMaterialName(); | ||
177 | } | ||
178 | |||
179 | rtnStr += "\n"; | ||
180 | return rtnStr; | ||
181 | }; | ||
182 | |||
183 | this.import = function( importStr ) { | ||
184 | this._xOffset = Number( this.getPropertyFromString( "xoff: ", importStr ) ); | ||
185 | this._yOffset = Number( this.getPropertyFromString( "yoff: ", importStr ) ); | ||
186 | this._width = Number( this.getPropertyFromString( "width: ", importStr ) ); | ||
187 | this._height = Number( this.getPropertyFromString( "height: ", importStr ) ); | ||
188 | this._xAdj = Number( this.getPropertyFromString( "xAdj: ", importStr ) ); | ||
189 | this._yAdj = Number( this.getPropertyFromString( "yAdj: ", importStr ) ); | ||
190 | this._strokeWidth = Number( this.getPropertyFromString( "strokeWidth: ", importStr ) ); | ||
191 | var slope = this.getPropertyFromString( "slope: ", importStr ); | ||
192 | |||
193 | if(isNaN(Number(slope))) { | ||
194 | this._slope = slope; | ||
195 | } else { | ||
196 | this._slope = Number(slope); | ||
197 | } | ||
198 | |||
199 | var strokeMaterialName = this.getPropertyFromString( "strokeMat: ", importStr ); | ||
200 | this._strokeStyle = this.getPropertyFromString( "strokeStyle: ", importStr ); | ||
201 | |||
202 | if(importStr.indexOf("strokeGradientMode: ") < 0) | ||
203 | { | ||
204 | this._strokeColor = eval( "[" + this.getPropertyFromString( "strokeColor: ", importStr ) + "]" ); | ||
205 | } else { | ||
206 | this._strokeColor = {}; | ||
207 | this._strokeColor.gradientMode = this.getPropertyFromString( "strokeGradientMode: ", importStr ); | ||
208 | this._strokeColor.color = this.stringToGradient(this.getPropertyFromString( "strokeColor: ", importStr )); | ||
209 | } | ||
210 | |||
211 | var strokeMat = MaterialsModel.getMaterial( strokeMaterialName ); | ||
212 | if (!strokeMat) { | ||
213 | console.log( "object material not found in library: " + strokeMaterialName ); | ||
214 | strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | ||
215 | } | ||
216 | |||
217 | this._strokeMaterial = strokeMat; | ||
218 | |||
219 | }; | ||
220 | |||
221 | /////////////////////////////////////////////////////////////////////// | 151 | /////////////////////////////////////////////////////////////////////// |
222 | // Methods | 152 | // Methods |
223 | /////////////////////////////////////////////////////////////////////// | 153 | /////////////////////////////////////////////////////////////////////// |
diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index 6791e0d5..e92cb2dd 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js | |||
@@ -55,7 +55,7 @@ exports.Splitter = Montage.create(Component, { | |||
55 | }, | 55 | }, |
56 | set: function(value) { | 56 | set: function(value) { |
57 | this._collapsed = value; | 57 | this._collapsed = value; |
58 | this.needsDraw = true; | 58 | |
59 | this.application.localStorage.setItem(this.element.getAttribute("data-montage-id"), {"version": this.version, "value": value}); | 59 | this.application.localStorage.setItem(this.element.getAttribute("data-montage-id"), {"version": this.version, "value": value}); |
60 | } | 60 | } |
61 | }, | 61 | }, |
diff --git a/js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css b/js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css index 067285ae..129b9771 100644 --- a/js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css +++ b/js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css | |||
@@ -10,12 +10,12 @@ | |||
10 | height: 100%; | 10 | height: 100%; |
11 | } | 11 | } |
12 | .maintimeline{ | 12 | .maintimeline{ |
13 | border-style: double; | ||
13 | -webkit-box-flex: 1; | 14 | -webkit-box-flex: 1; |
14 | display: -webkit-box; | 15 | display: -webkit-box; |
15 | -webkit-box-orient: horizontal; | 16 | -webkit-box-orient: horizontal |
16 | height : 100%; | 17 | height : 100%; |
17 | position: relative; | 18 | position: relative; |
18 | margin-top:1px; | ||
19 | } | 19 | } |
20 | .leftinside{ | 20 | .leftinside{ |
21 | height: 100%; | 21 | height: 100%; |
diff --git a/js/panels/presets/animations-presets.reel/animations-presets.js b/js/panels/presets/animations-presets.reel/animations-presets.js index 6a16da54..ab200212 100644 --- a/js/panels/presets/animations-presets.reel/animations-presets.js +++ b/js/panels/presets/animations-presets.reel/animations-presets.js | |||
@@ -22,7 +22,52 @@ exports.AnimationsLibrary = Montage.create(Component, { | |||
22 | }, | 22 | }, |
23 | handleNodeActivation: { | 23 | handleNodeActivation: { |
24 | value: function(presetData) { | 24 | value: function(presetData) { |
25 | this.application.ninja.presetsController.applyPreset(presetData); | 25 | //debugger; |
26 | var selection = this.application.ninja.selectedElements, | ||
27 | stylesController = this.application.ninja.stylesController, | ||
28 | selectorBase = presetData.selectorBase, | ||
29 | self = this; | ||
30 | |||
31 | if(!selection || !selection.length || selection.length === 0) { | ||
32 | return false; | ||
33 | } | ||
34 | |||
35 | selectorBase = stylesController.generateClassName(selectorBase); | ||
36 | |||
37 | presetData.rules.forEach(function(rule) { | ||
38 | if(rule.isKeyFrameRule) { | ||
39 | this.application.ninja.stylesController.addRule( | ||
40 | '@-webkit-keyframes ' + presetData.selectorBase, | ||
41 | this.stringifyKeys(rule.keys) | ||
42 | ); | ||
43 | } else { | ||
44 | this.application.ninja.stylesController.addRule('.' + selectorBase + rule.selectorSuffix, rule.styles); | ||
45 | } | ||
46 | |||
47 | }, this); | ||
48 | |||
49 | selection.forEach(function(el) { | ||
50 | el._element.classList.add(selectorBase); | ||
51 | }, this); | ||
52 | |||
53 | } | ||
54 | }, | ||
55 | |||
56 | stringifyKeys : { | ||
57 | value: function(keysArray) { | ||
58 | var keysString = ''; | ||
59 | |||
60 | keysArray.forEach(function(key) { | ||
61 | var styles = '', style; | ||
62 | |||
63 | for(style in key.styles) { | ||
64 | styles += style + ':' + key.styles[style] + '; '; | ||
65 | } | ||
66 | |||
67 | keysString += key.keyText + ' {' + styles + ' }'; | ||
68 | }); | ||
69 | |||
70 | return keysString; | ||
26 | } | 71 | } |
27 | } | 72 | } |
28 | }); | 73 | }); |
diff --git a/js/panels/presets/default-animation-presets.js b/js/panels/presets/default-animation-presets.js index b12a94b2..64f91ea6 100644 --- a/js/panels/presets/default-animation-presets.js +++ b/js/panels/presets/default-animation-presets.js | |||
@@ -13,6 +13,7 @@ exports.animationPresets = { | |||
13 | "text": "Border Morph", | 13 | "text": "Border Morph", |
14 | "selectorBase" : "border-morph", | 14 | "selectorBase" : "border-morph", |
15 | "rules" : [{ | 15 | "rules" : [{ |
16 | "selectorSuffix" : "", | ||
16 | "styles" : { | 17 | "styles" : { |
17 | "-webkit-animation": "border-morph 2s infinite" | 18 | "-webkit-animation": "border-morph 2s infinite" |
18 | } | 19 | } |
@@ -90,6 +91,7 @@ exports.animationPresets = { | |||
90 | "text": "Rotater", | 91 | "text": "Rotater", |
91 | "selectorBase" : "rotate-with-alpha-keyframes", | 92 | "selectorBase" : "rotate-with-alpha-keyframes", |
92 | "rules" : [{ | 93 | "rules" : [{ |
94 | "selectorSuffix" : "", | ||
93 | "styles" : { | 95 | "styles" : { |
94 | "-webkit-animation-name": "rotate-with-alpha-keyframes", | 96 | "-webkit-animation-name": "rotate-with-alpha-keyframes", |
95 | "-webkit-animation-duration": "5s", | 97 | "-webkit-animation-duration": "5s", |
diff --git a/js/panels/presets/default-style-presets.js b/js/panels/presets/default-style-presets.js index 10b24ff4..82bec34f 100644 --- a/js/panels/presets/default-style-presets.js +++ b/js/panels/presets/default-style-presets.js | |||
@@ -11,9 +11,9 @@ exports.stylePresets = { | |||
11 | "children": [ | 11 | "children": [ |
12 | { | 12 |