diff options
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 13 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 7 | ||||
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 53 | ||||
-rw-r--r-- | js/panels/Timeline/Tween.reel/Tween.js | 73 |
4 files changed, 73 insertions, 73 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 4b7fe24c..679b88f3 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -484,9 +484,16 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
484 | // Make it editable! | 484 | // Make it editable! |
485 | this._layerEditable = Hintable.create(); | 485 | this._layerEditable = Hintable.create(); |
486 | this._layerEditable.element = this.titleSelector; | 486 | this._layerEditable.element = this.titleSelector; |
487 | this._layerEditable.addEventListener("blur", this.handleSelectorEditableBlur.bind(this), false); | 487 | this.titleSelector.identifier = "selectorEditable"; |
488 | this._layerEditable.addEventListener("change", this.handleSelectorEditableChange.bind(this), false); | 488 | this.titleSelector.addEventListener("click", this, false); |
489 | 489 | this._layerEditable.addEventListener("blur", function(event) { | |
490 | that.handleSelectorEditableBlur(event); | ||
491 | }, false); | ||
492 | this._layerEditable.addEventListener("change", function(event) { | ||
493 | that.dynamicLayerName.value = that._layerEditable.value; | ||
494 | this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = that.dynamicLayerName.value | ||
495 | that.needsDraw = true; | ||
496 | }, false); | ||
490 | this._layerEditable.editingClass = "editable2"; | 497 | this._layerEditable.editingClass = "editable2"; |
491 | this._layerEditable.value = this.layerName; | 498 | this._layerEditable.value = this.layerName; |
492 | //this._layerEditable.needsDraw = true; | 499 | //this._layerEditable.needsDraw = true; |
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 4177c681..df1a25a8 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -786,6 +786,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
786 | 786 | ||
787 | this.currentLayerNumber = this.currentLayerNumber + 1; | 787 | this.currentLayerNumber = this.currentLayerNumber + 1; |
788 | newLayerName = "Layer " + this.currentLayerNumber; | 788 | newLayerName = "Layer " + this.currentLayerNumber; |
789 | |||
790 | if(ele.dataset.storedLayerName){ | ||
791 | newLayerName = ele.dataset.storedLayerName; | ||
792 | } | ||
789 | thingToPush.layerData.layerName = newLayerName; | 793 | thingToPush.layerData.layerName = newLayerName; |
790 | thingToPush.layerData.layerID = this.currentLayerNumber; | 794 | thingToPush.layerData.layerID = this.currentLayerNumber; |
791 | thingToPush.parentElementUUID = this.hashKey; | 795 | thingToPush.parentElementUUID = this.hashKey; |
@@ -816,6 +820,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
816 | // Delete the selected layer. | 820 | // Delete the selected layer. |
817 | var myIndex = this.layerRepetition.selectedIndexes[0]; | 821 | var myIndex = this.layerRepetition.selectedIndexes[0]; |
818 | this.arrLayers.splice(myIndex, 1); | 822 | this.arrLayers.splice(myIndex, 1); |
823 | var selectIndex = this.arrLayers.length; | ||
824 | this.selectLayer(selectIndex-1); | ||
819 | } | 825 | } |
820 | } | 826 | } |
821 | }, | 827 | }, |
@@ -824,6 +830,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
824 | value:function() { | 830 | value:function() { |
825 | this.createNewLayer(); | 831 | this.createNewLayer(); |
826 | this.currentLayerSelected.layerData.elementsList.push(this.application.ninja.selectedElements[0]._element); | 832 | this.currentLayerSelected.layerData.elementsList.push(this.application.ninja.selectedElements[0]._element); |
833 | this.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.currentLayerSelected.layerData.layerName; | ||
827 | } | 834 | } |
828 | }, | 835 | }, |
829 | 836 | ||
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index e294a69e..edca4306 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -435,6 +435,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
435 | this.init(); | 435 | this.init(); |
436 | this.ninjaStylesContoller = this.application.ninja.stylesController; | 436 | this.ninjaStylesContoller = this.application.ninja.stylesController; |
437 | this.element.addEventListener("click", this, false); | 437 | this.element.addEventListener("click", this, false); |
438 | this.eventManager.addEventListener("tlZoomSlider", this, false); | ||
438 | } | 439 | } |
439 | }, | 440 | }, |
440 | 441 | ||
@@ -467,6 +468,46 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
467 | } | 468 | } |
468 | }, | 469 | }, |
469 | 470 | ||
471 | handleTlZoomSlider: { | ||
472 | value: function(event) { | ||
473 | |||
474 | var currentMilliSecPerPixel , currentMilliSec , clickPos,thingToPush; | ||
475 | var i = 0, | ||
476 | tweensLength = this.tweens.length; | ||
477 | |||
478 | for (i = 0; i < tweensLength; i++) { | ||
479 | |||
480 | if (i === 0) { | ||
481 | // Exception: 0th item does not depend on anything | ||
482 | // TODO: If 0th tween is draggable, this will need to be fixed. | ||
483 | this.tweens[i].tweenData.spanWidth=0; | ||
484 | this.tweens[i].tweenData.spanPosition=0; | ||
485 | this.tweens[i].tweenData.keyFramePosition=0; | ||
486 | this.tweens[i].tweenData.keyFrameMillisec=0; | ||
487 | |||
488 | } else { | ||
489 | var prevKeyFramePosition = this.tweens[i - 1].tweenData.keyFramePosition, | ||
490 | myObj = {}, | ||
491 | thing = {}; | ||
492 | |||
493 | currentMilliSecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); | ||
494 | currentMilliSec = this.tweens[i].tweenData.keyFrameMillisec; | ||
495 | clickPos = currentMilliSec / currentMilliSecPerPixel; | ||
496 | |||
497 | for (thing in this.tweens[i].tweenData) { | ||
498 | myObj[thing] = this.tweens[i].tweenData[thing]; | ||
499 | } | ||
500 | myObj.spanWidth = clickPos - prevKeyFramePosition; | ||
501 | myObj.keyFramePosition = clickPos; | ||
502 | myObj.spanPosition = clickPos - (clickPos - prevKeyFramePosition); | ||
503 | |||
504 | this.tweens[i].tweenData = myObj; | ||
505 | } | ||
506 | |||
507 | |||
508 | } | ||
509 | } | ||
510 | }, | ||
470 | handleClick:{ | 511 | handleClick:{ |
471 | value:function (ev) { | 512 | value:function (ev) { |
472 | // TEMP - if the SHIFT key is down, add a new keyframe or split an existing span | 513 | // TEMP - if the SHIFT key is down, add a new keyframe or split an existing span |
@@ -682,6 +723,18 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
682 | } | 723 | } |
683 | } | 724 | } |
684 | }, | 725 | }, |
726 | getTweenIndexById: { | ||
727 | value: function(intID) { | ||
728 | var i = 0, | ||
729 | arrTweensLength = this.tweens.length; | ||
730 | for (i = 0; i < arrTweensLength; i++) { | ||
731 | if (this.tweens[i].tweenData.tweenID === intID) { | ||
732 | returnVal = i; | ||
733 | } | ||
734 | } | ||
735 | return returnVal; | ||
736 | } | ||
737 | }, | ||
685 | /* Begin: Logging routines */ | 738 | /* Begin: Logging routines */ |
686 | _boolDebug: { | 739 | _boolDebug: { |
687 | enumerable: false, | 740 | enumerable: false, |
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 28c9a585..27828c3c 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js | |||
@@ -44,6 +44,7 @@ var Tween = exports.Tween = Montage.create(Component, { | |||
44 | }, | 44 | }, |
45 | set: function(value){ | 45 | set: function(value){ |
46 | this._spanWidth = value; | 46 | this._spanWidth = value; |
47 | this.tweenData.spanWidth = value; | ||
47 | this.needsDraw=true; | 48 | this.needsDraw=true; |
48 | } | 49 | } |
49 | }, | 50 | }, |
@@ -59,6 +60,7 @@ var Tween = exports.Tween = Montage.create(Component, { | |||
59 | }, | 60 | }, |
60 | set:function (value) { | 61 | set:function (value) { |
61 | this._spanPosition = value; | 62 | this._spanPosition = value; |
63 | this.tweenData.spanPosition = value; | ||
62 | this.needsDraw=true; | 64 | this.needsDraw=true; |
63 | } | 65 | } |
64 | }, | 66 | }, |
@@ -74,6 +76,7 @@ var Tween = exports.Tween = Montage.create(Component, { | |||
74 | }, | 76 | }, |
75 | set:function (value) { | 77 | set:function (value) { |
76 | this._keyFramePosition = value; | 78 | this._keyFramePosition = value; |
79 | this.tweenData.keyFramePosition = value; | ||
77 | this.needsDraw=true; | 80 | this.needsDraw=true; |
78 | } | 81 | } |
79 | }, | 82 | }, |
@@ -136,11 +139,6 @@ var Tween = exports.Tween = Montage.create(Component, { | |||
136 | } | 139 | } |
137 | }, | 140 | }, |
138 | 141 | ||
139 | prepareForDraw:{ | ||
140 | value:function(){ | ||
141 | this.eventManager.addEventListener("tlZoomSlider", this, false); | ||
142 | } | ||
143 | }, | ||
144 | 142 | ||
145 | draw:{ | 143 | draw:{ |
146 | value:function () { | 144 | value:function () { |
@@ -227,71 +225,6 @@ var Tween = exports.Tween = Montage.create(Component, { | |||
227 | // deselect the keyframe for this tween | 225 | // deselect the keyframe for this tween |
228 | this.keyframe.deselectKeyframe(); | 226 | this.keyframe.deselectKeyframe(); |
229 | } | 227 | } |
230 | }, | ||
231 | |||
232 | handleTlZoomSlider:{ | ||
233 | value:function(event){ | ||
234 | var currentMilliSecPerPixel , currentMilliSec , clickPos,i=0; | ||
235 | |||
236 | length = this.application.ninja.timeline.tempArray.length; | ||
237 | if(length > 0 && this.application.ninja.timeline.tempArray[length-1]!== this.parentComponent.parentComponent.trackID){ | ||
238 | this.application.ninja.timeline.tempArray.push(this.parentComponent.parentComponent.trackID); | ||
239 | var i = this.application.ninja.timeline.tweenarray.length-1; | ||
240 | for(;this.currentTween = this.application.ninja.timeline.tweenarray[i];i--){ | ||
241 | if(this.application.ninja.timeline.tweenarray[i].tweenID===0){ | ||
242 | this.currentTween.spanWidth=0; |