aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-03-16 21:03:58 -0700
committerJose Antonio Marquez2012-03-16 21:03:58 -0700
commit415bab69cca4e8511144407b67bec80f2ba95422 (patch)
treec336ca8ae1bcd6761c924bacf8bfe7143b2c7885 /js/panels
parente7e18f02870a0cfe06e550acf8ffef6eab945231 (diff)
parent954f5a13e371febcb1c0fb8015c577ee51c23130 (diff)
downloadninja-415bab69cca4e8511144407b67bec80f2ba95422.tar.gz
Merge branch 'refs/heads/Ninja-Internal' into Document
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js2
-rwxr-xr-xjs/panels/Splitter.js6
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js20
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js86
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js5
-rw-r--r--js/panels/presets/animations-presets.reel/animations-presets.css5
-rw-r--r--js/panels/presets/animations-presets.reel/animations-presets.html59
-rw-r--r--js/panels/presets/animations-presets.reel/animations-presets.js73
-rw-r--r--js/panels/presets/content.reel/content.html12
-rw-r--r--js/panels/presets/default-animation-presets.js94
-rw-r--r--js/panels/presets/default-transition-presets.js30
-rwxr-xr-xjs/panels/properties.reel/properties.html72
-rwxr-xr-xjs/panels/properties.reel/properties.js64
13 files changed, 385 insertions, 143 deletions
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
index b6bee37d..b4eec771 100755
--- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
+++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
@@ -118,7 +118,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
118 didCreate: { 118 didCreate: {
119 value: function() { 119 value: function() {
120 // Setup the drop delegate 120 // Setup the drop delegate
121// this.application.ninja.dragDropMediator.dropDelegate = this; 121 this.application.ninja.dragDropMediator.dropDelegate = this;
122 // Loop through the component and load the JSON data for them 122 // Loop through the component and load the JSON data for them
123 this._loadComponents(); 123 this._loadComponents();
124 } 124 }
diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js
index a396ea28..e92cb2dd 100755
--- a/js/panels/Splitter.js
+++ b/js/panels/Splitter.js
@@ -91,12 +91,6 @@ exports.Splitter = Montage.create(Component, {
91 } 91 }
92 }, 92 },
93 93
94 didDraw: {
95 value: function() {
96 this.application.ninja.stage.resizeCanvases = true;
97 }
98 },
99
100 handleClick : { 94 handleClick : {
101 value: function() { 95 value: function() {
102 if (!this.disabled) { 96 if (!this.disabled) {
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index b41680be..5206ae16 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -255,12 +255,12 @@ var Layer = exports.Layer = Montage.create(Component, {
255 if (value !== this._isSelected) { 255 if (value !== this._isSelected) {
256 // Only concerned about different values 256 // Only concerned about different values
257 if (value === false) { 257 if (value === false) {
258 // If changing from false to true, we need to deselect any associated styles 258 // If changing from true to false, we need to deselect any associated styles
259 this.selectStyle(false); 259 this.selectStyle(false);
260 } 260 }
261 this._isSelected = value; 261 this._isSelected = value;
262 this.layerData.isSelected = value; 262 this.layerData.isSelected = value;
263 //this.needsDraw = true; 263 this.needsDraw = true;
264 } 264 }
265 265
266 } 266 }
@@ -381,7 +381,6 @@ var Layer = exports.Layer = Montage.create(Component, {
381 return this._bypassAnimation; 381 return this._bypassAnimation;
382 }, 382 },
383 set: function(newVal) { 383 set: function(newVal) {
384 //console.log("layer.js _bypassAnimation setter " + newVal)
385 this._bypassAnimation = newVal; 384 this._bypassAnimation = newVal;
386 } 385 }
387 }, 386 },
@@ -406,7 +405,6 @@ var Layer = exports.Layer = Montage.create(Component, {
406 405
407 setData:{ 406 setData:{
408 value:function(){ 407 value:function(){
409 this.log('layer: setData called')
410 this.layerName = this.layerData.layerName; 408 this.layerName = this.layerData.layerName;
411 this.layerID = this.layerData.layerID; 409 this.layerID = this.layerData.layerID;
412 this.arrLayerStyles = this.layerData.arrLayerStyles; 410 this.arrLayerStyles = this.layerData.arrLayerStyles;
@@ -424,9 +422,13 @@ var Layer = exports.Layer = Montage.create(Component, {
424 this.dtextScaleX = this.layerData.dtextScaleX; 422 this.dtextScaleX = this.layerData.dtextScaleX;
425 this.dtextScaleY = this.layerData.dtextScaleY; 423 this.dtextScaleY = this.layerData.dtextScaleY;
426 this.dtextRotate = this.layerData.dtextRotate; 424 this.dtextRotate = this.layerData.dtextRotate;
425 this._isFirstDraw = this.layerData._isFirstDraw;
427 this.needsDraw = true; 426 this.needsDraw = true;
428 } 427 }
429 }, 428 },
429 _isFirstDraw : {
430 value: true
431 },
430 432
431 /* END: Models */ 433 /* END: Models */
432 434
@@ -483,6 +485,16 @@ var Layer = exports.Layer = Montage.create(Component, {
483 } 485 }
484 } 486 }
485 }, 487 },
488 didDraw: {
489 value: function() {
490 if ((this.isSelected === true) && (this._isFirstDraw === true)) {
491 // Once we're done drawing the first time we need to tell the TimelinePanel if
492 // this layer is supposed to be selected.
493 this.parentComponent.parentComponent.selectedLayerID = this.layerID;
494 this._isFirstDraw = false;
495 }
496 }
497 },
486 /* End: Draw cycle */ 498 /* End: Draw cycle */
487 499
488 /* Begin: Controllers */ 500 /* Begin: Controllers */
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 1afb9e5a..a1e320c4 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -139,6 +139,28 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
139 } 139 }
140 }, 140 },
141 141
142 _selectedLayerID:{
143 value: false
144 },
145 selectedLayerID : {
146 get: function() {
147 return this._selectedLayerID;
148 },
149 set: function(newVal) {
150 if (newVal === false) {
151 // We are clearing the timeline, so just set the value and return.
152 this._selectedLayerID = newVal;
153 return;
154 }
155 if (newVal !== this._selectedLayerID) {
156 var selectIndex = this.getLayerIndexByID(newVal);
157 this._selectedLayerID = newVal;
158 this._captureSelection = true;
159 this.selectLayer(selectIndex, true);
160 }
161 }
162 },
163
142 millisecondsOffset:{ 164 millisecondsOffset:{
143 value:1000 165 value:1000
144 }, 166 },
@@ -374,14 +396,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
374 396
375 // Feed the new array of objects into the repetitions 397 // Feed the new array of objects into the repetitions
376 // and select the first layer. 398 // and select the first layer.
399 this.temparrLayers[0].layerData.isSelected = true;
400 this.temparrLayers[0].layerData._isFirstDraw = true;
401
377 this.arrLayers=this.temparrLayers; 402 this.arrLayers=this.temparrLayers;
378 403
379 // TODO: We need a better solution to this race condition than a timeout.
380 this._captureSelection = true;
381 var that = this;
382 setTimeout(function() {
383 that.selectLayer(0, true);
384 }, 1000)
385 } else { 404 } else {
386 // New document. Create default layer. 405 // New document. Create default layer.
387 this.createNewLayer(1); 406 this.createNewLayer(1);
@@ -397,31 +416,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
397 } else { 416 } else {
398 // we do have information stored. Use it. 417 // we do have information stored. Use it.
399 this._boolCacheArrays = false; 418 this._boolCacheArrays = false;
419 //var myIndex = 0;
420 for (var i = 0; i < this.application.ninja.currentDocument.tlArrLayers.length; i++) {
421 if ( this.application.ninja.currentDocument.tlArrLayers[i].layerData.isSelected === true ) {
422 this.application.ninja.currentDocument.tlArrLayers[i].layerData._isFirstDraw = true;
423 }
424 }
425
426
400 this.arrLayers = this.application.ninja.currentDocument.tlArrLayers; 427 this.arrLayers = this.application.ninja.currentDocument.tlArrLayers;
401 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 428 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
402 this.currentLayerSelected = this.application.ninja.currentDocument.tlCurrentLayerSelected; 429 this.currentLayerSelected = this.application.ninja.currentDocument.tlCurrentLayerSelected;
403 this.hashInstance = this.application.ninja.currentDocument.tlLayerHashTable; 430 this.hashInstance = this.application.ninja.currentDocument.tlLayerHashTable;
404 this.hashElementMapToLayer = this.application.ninja.currentDocument.tlElementHashTable; 431 this.hashElementMapToLayer = this.application.ninja.currentDocument.tlElementHashTable;
405 this.hashKey = this.application.ninja.currentDocument.hashKey; 432 this.hashKey = this.application.ninja.currentDocument.hashKey;
406 this._boolCacheArrays = true;
407
408 // Search through the arrL