aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorEric Guzman2012-04-02 15:36:08 -0700
committerEric Guzman2012-04-02 15:36:08 -0700
commit0241bf331b7e06e206a54be441edf2f4c7261f63 (patch)
treeb7e2f9cad73eed4fc616cf1841cd0be02bd955d4 /js/panels
parentdde5b5054f93db493e5d4d502e677f5781334b08 (diff)
parentc6de22bf42be90b403491b5f87b1818d9020310c (diff)
downloadninja-0241bf331b7e06e206a54be441edf2f4c7261f63.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js4
-rwxr-xr-xjs/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js89
-rwxr-xr-xjs/panels/Materials/Materials.xml14
-rw-r--r--js/panels/Materials/materials-data.json43
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.css8
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.html83
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.js87
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.html8
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.js11
-rwxr-xr-xjs/panels/Splitter.js2
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css4
-rwxr-xr-xjs/panels/color/colorchippopup.reel/colorchippopup.js1
-rwxr-xr-xjs/panels/color/colorpanelpopup.reel/colorpanelpopup.js1
-rwxr-xr-xjs/panels/color/colorpopup-manager.js2
-rw-r--r--js/panels/presets/animations-presets.reel/animations-presets.js47
-rw-r--r--js/panels/presets/content.reel/content.html6
-rw-r--r--js/panels/presets/default-animation-presets.js127
-rw-r--r--js/panels/presets/default-style-presets.js29
-rw-r--r--js/panels/presets/default-transition-presets.js26
-rw-r--r--js/panels/presets/style-presets.reel/style-presets.js49
-rw-r--r--js/panels/presets/transitions-presets.reel/transitions-presets.js20
-rwxr-xr-xjs/panels/properties.reel/properties.css13
-rwxr-xr-xjs/panels/properties.reel/sections/custom-rows/dual-row.reel/dual-row.js8
-rwxr-xr-xjs/panels/properties.reel/sections/custom.reel/custom.js57
-rwxr-xr-xjs/panels/properties.reel/sections/position-and-size.reel/position-and-size.css32
-rwxr-xr-xjs/panels/properties.reel/sections/position-and-size.reel/position-and-size.html13
-rwxr-xr-xjs/panels/properties.reel/sections/position-and-size.reel/position-and-size.js10
-rw-r--r--js/panels/resize-composer.js34
28 files changed, 531 insertions, 297 deletions
diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
index 0c950ffd..ecf0f9cd 100755
--- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
+++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
@@ -1691,7 +1691,7 @@ NJCSSStyle.prototype.styleChange = function() {
1691NJCSSStyle.prototype.getUnits = function(val) { 1691NJCSSStyle.prototype.getUnits = function(val) {
1692 if(val.split(/\s/).length > 1) { 1692 if(val.split(/\s/).length > 1) {
1693 return false; 1693 return false;
1694 } else if(/px|em|pt|in|cm|mm|ex|pc|%/.test(val)) { 1694 } else if(/(px|em|pt|in|cm|mm|ex|pc|%)$/.test(val)) {
1695 return val.replace(/^.*(px|em|pt|in|cm|mm|ex|pc|%).*/, '$1'); 1695 return val.replace(/^.*(px|em|pt|in|cm|mm|ex|pc|%).*/, '$1');
1696 } 1696 }
1697 return null; 1697 return null;
@@ -1771,7 +1771,7 @@ NJCSSStyle.prototype.updateValue = function(newValue, bypassUndo) {
1771 this.styleChange(); 1771 this.styleChange();
1772 return true; 1772 return true;
1773 } 1773 }
1774 1774
1775 var IMPORTANT_FLAG = ' !important', 1775 var IMPORTANT_FLAG = ' !important',
1776 dec = this.njRule.declaration, 1776 dec = this.njRule.declaration,
1777 acceptAsValid = false, 1777 acceptAsValid = false,
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
index b4eec771..3505393c 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,15 @@ 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
301 instance.addEventListener('firstDraw', that, false);
302
260 that.application.ninja.currentDocument.setComponentInstance(instance, element); 303 that.application.ninja.currentDocument.setComponentInstance(instance, element);
261 304
262 NJevent("elementAdding", {"el": element, "data":styles}); 305 NJevent("elementAdding", {"el": element, "data":styles});
@@ -264,6 +307,12 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
264 307
265 } 308 }
266 }, 309 },
310
311 handleFirstDraw: {
312 value: function (e) {
313 NJevent("addComponentFirstDraw");
314 }
315 },
267 316
268 makeComponent: { 317 makeComponent: {
269 value: function(name) { 318 value: function(name) {
@@ -313,6 +362,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
313 el.setAttribute("type", "range"); 362 el.setAttribute("type", "range");
314 break; 363 break;
315 case "textfield": 364 case "textfield":
365 case "searchfield":
316 el = NJUtils.makeNJElement("input", "Textfield", "component"); 366 el = NJUtils.makeNJElement("input", "Textfield", "component");
317 el.elementModel.pi = "TextfieldPi"; 367 el.elementModel.pi = "TextfieldPi";
318 el.setAttribute("type", "text");</