aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/Splitter.js2
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css4
-rw-r--r--js/panels/presets/animations-presets.reel/animations-presets.js47
-rw-r--r--js/panels/presets/default-animation-presets.js2
-rw-r--r--js/panels/presets/default-style-presets.js11
-rw-r--r--js/panels/presets/default-transition-presets.js8
-rw-r--r--js/panels/presets/style-presets.reel/style-presets.js49
-rw-r--r--js/panels/presets/transitions-presets.reel/transitions-presets.js20
-rw-r--r--js/panels/resize-composer.js34
9 files changed, 138 insertions, 39 deletions
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 {
13 "text": "Border-Radius", 13 "text": "Border-Radius",
14 "id": "njBorderRadius",
15 "selectorBase" : "border-radius-preset", 14 "selectorBase" : "border-radius-preset",
16 "rules" : [{ 15 "rules" : [{
16 "selectorSuffix" : "",
17 "styles" : { 17 "styles" : {
18 "border-radius": "100px", 18 "border-radius": "100px",
19 "border" : "1px solid #333" 19 "border" : "1px solid #333"
@@ -22,9 +22,9 @@ exports.stylePresets = {
22 }, 22 },
23 { 23 {
24 "text": "Drop Shadow", 24 "text": "Drop Shadow",
25 "id": "njDropShadow",
26 "selectorBase" : "drop-shadow", 25 "selectorBase" : "drop-shadow",
27 "rules" : [{ 26 "rules" : [{
27 "selectorSuffix" : "",
28 "styles" : { 28 "styles" : {
29 "box-shadow": "2px 2px 50px rgba(0,0,0,0.5)", 29 "box-shadow": "2px 2px 50px rgba(0,0,0,0.5)",
30 "border" : "1px solid #CCC" 30 "border" : "1px solid #CCC"
@@ -33,10 +33,9 @@ exports.stylePresets = {
33 }, 33 },
34 { 34 {
35 "text": "Fancy Box", 35 "text": "Fancy Box",
36 "id": "njFancyBox",
37 "selectorBase" : "fancy-box", 36 "selectorBase" : "fancy-box",
38 "rules" : [{ 37 "rules" : [{
39 "selectorSuffix": "", 38 "selectorSuffix" : "",
40 "styles" : { 39 "styles" : {
41 "box-shadow": "inset 0 0 0 1px #666, inset 0 0 0 2px rgba(225, 225, 225, 0.4), 0 0 20px -10px #333", 40 "box-shadow": "inset 0 0 0 1px #666, inset 0 0 0 2px rgba(225, 225, 225, 0.4), 0 0 20px -10px #333",
42 "border" : "1px solid #FFF", 41 "border" : "1px solid #FFF",
@@ -51,9 +50,9 @@ exports.stylePresets = {
51 "children": [ 50 "children": [
52 { 51 {
53 "text": "Italic", 52 "text": "Italic",
54 "id": "njItalic",
55 "selectorBase" : "italicize", 53 "selectorBase" : "italicize",
56 "rules" : [{ 54 "rules" : [{
55 "selectorSuffix" : "",
57 "styles" : { 56 "styles" : {
58 "font-style": "italic" 57 "font-style": "italic"
59 } 58 }
@@ -61,9 +60,9 @@ exports.stylePresets = {
61 }, 60 },
62 { 61 {
63 "text": "Text Shadow", 62 "text": "Text Shadow",
64 "id": "njTextShadow",
65 "selectorBase" : "italicize", 63 "selectorBase" : "italicize",
66 "rules" : [{ 64 "rules" : [{
65 "selectorSuffix" : "",
67 "styles" : { 66 "styles" : {
68 "text-shadow": "1px 1px 3px #333" 67 "text-shadow": "1px 1px 3px #333"
69 } 68 }
diff --git a/js/panels/presets/default-transition-presets.js b/js/panels/presets/default-transition-presets.js
index f8968085..15f4882f 100644
--- a/js/panels/presets/default-transition-presets.js
+++ b/js/panels/presets/default-transition-presets.js
@@ -13,6 +13,7 @@ exports.transitionPresets = {
13 "text": "Fade In", 13 "text": "Fade In",
14 "selectorBase" : "fade-in", 14 "selectorBase" : "fade-in",
15 "rules" : [{ 15 "rules" : [{
16 "selectorSuffix": "",
16 "styles" : { 17 "styles" : {
17 "opacity": "0.25", 18 "opacity": "0.25",
18 "-webkit-transition": "all 0.4s ease-in" 19 "-webkit-transition": "all