From f97080989ee988c1e613915c2d246dc17b104b3b Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 24 Feb 2012 13:27:33 -0800 Subject: clearing the old local setting and using the new version/prefix local settings. Signed-off-by: Valerio Virgillito --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index 0c302436..0fd5b05d 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html @@ -264,7 +264,7 @@ -
+
-- cgit v1.2.3 From fb8aacbadba8dffb9619eb16e4626c197dc9264d Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 27 Feb 2012 10:23:05 -0800 Subject: Timeline : Selection Fix Signed-off-by: Kruti Shah Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 2143dafd..797a7cbf 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -230,8 +230,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { { this._openDoc=true; NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) -// this.selectLayer(myIndex); -// TimelineTrack.retrieveStoredTweens(); myIndex++; } }else{ @@ -488,7 +486,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if(this._openDoc){ event.detail.ele.uuid =nj.generateRandom(); thingToPush.elementsList.push(event.detail.ele); - this._openDoc=false; } newTrack.trackID = this.currentLayerNumber; @@ -534,6 +531,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.selectLayer(0); } + + if(this._openDoc){ + this.hashElementMapToLayer.setItem(event.detail.ele.uuid, event.detail.ele,this.currentLayerSelected); + this._openDoc=false; + } this._LayerUndoObject = thingToPush; this._LayerUndoIndex = thingToPush.layerID; this._LayerUndoStatus = true; @@ -733,6 +735,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } } hashLayerObject[key][index] = value; + console.log(hashLayerObject) this.counter = 0; } }, @@ -827,6 +830,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } this.mappingArray[key]["ele"] = value; this.mappingArray[key].layerID = layer.layerID; + console.log(this.mappingArray) } }, @@ -863,6 +867,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.trackRepetition.selectedIndexes = [layerIndex]; this.currentLayerSelected = this.arrLayers[layerIndex]; this.currentTrackSelected = this.arrTracks[layerIndex]; + if(this._captureSelection){ + this.application.ninja.selectionController.selectElements(this.currentLayerSelected.elementsList) + } + this._captureSelection = true; } else { this.layerRepetition.selectedIndexes = null; this.trackRepetition.selectedIndexes = null; -- cgit v1.2.3 From 125723cf19cf70121bc694909d09a301ca2fc2d6 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 27 Feb 2012 11:40:52 -0800 Subject: Timeline: RetrieveStoredTweens calling fixed Signed-off-by: Kruti Shah Signed-off-by: Jonathan Duran --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 19 ++-- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 121 +++++++++++---------- 2 files changed, 71 insertions(+), 69 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 797a7cbf..92bb3405 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -224,13 +224,15 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this._hashKey = "123"; _firstLayerDraw = false; - if(this.application.ninja.currentDocument.documentRoot.children[0]){ - myIndex=0; - while(this.application.ninja.currentDocument.documentRoot.children[myIndex]) - { - this._openDoc=true; - NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) - myIndex++; + if(!this.application.ninja.documentController.creatingNewFile){ + if(this.application.ninja.currentDocument.documentRoot.children[0]){ + myIndex=0; + while(this.application.ninja.currentDocument.documentRoot.children[myIndex]) + { + this._openDoc=true; + NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) + myIndex++; + } } }else{ NJevent('newLayer', this._hashKey); @@ -476,6 +478,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { thingToPush.elementsList = []; thingToPush.deleted = false; thingToPush.isSelected = false; + thingToPush.created=false; if (_firstLayerDraw) { this.application.ninja.currentSelectedContainer.uuid=this._hashKey; @@ -735,7 +738,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } } hashLayerObject[key][index] = value; - console.log(hashLayerObject) this.counter = 0; } }, @@ -830,7 +832,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } this.mappingArray[key]["ele"] = value; this.mappingArray[key].layerID = layer.layerID; - console.log(this.mappingArray) } }, diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index a36e666b..55c84dce 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -331,10 +331,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { _styleCollapser:{ value:null }, - _openDocRedrawCheck:{ - value:true, - writable:true - }, prepareForDraw:{ value:function () { this.init(); @@ -364,10 +360,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { didDraw:{ value:function () { - if(this.application.ninja.currentDocument.documentRoot.children[0]){ - if (this._openDocRedrawCheck) { - this.retrieveStoredTweens(); - this._openDocRedrawCheck = false; + if(!this.application.ninja.documentController.creatingNewFile){ + if(this.application.ninja.currentDocument.documentRoot.children[0]){ + var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); + if(!this.application.ninja.timeline.arrLayers[selectedIndex].created){ + this.retrieveStoredTweens(); + } } } } @@ -465,60 +463,63 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { var percentValue, fraction, splitValue,offsetAttribute,topOffSetAttribute,leftOffsetAttribute, i = 0; var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); + this.application.ninja.timeline.arrLayers[selectedIndex].created=true; this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].elementsList[0]; - this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); - this.animationDuration = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); - if(this.animationDuration){ - this.trackDuration = this.animationDuration.split("s"); - this.currentMilliSec = this.trackDuration[0] * 1000; - this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); - this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; - this.nextKeyframe = 0; - - this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); - while (this.currentKeyframeRule[i]) { - var newTween = {}; - - offsetAttribute = this.currentKeyframeRule[i].cssText.split(" "); - topOffSetAttribute = offsetAttribute[3].split("px"); - leftOffsetAttribute = offsetAttribute[5].split("px"); - - parseInt(topOffSetAttribute[0]); - parseInt(leftOffsetAttribute[0]); - - if (this.currentKeyframeRule[i].keyText === "0%") { - newTween.spanWidth = 0; - newTween.keyFramePosition = 0; - newTween.keyFrameMillisec = 0; - newTween.tweenID = 0; - newTween.spanPosition = 0; - newTween.tweenedProperties = []; - newTween.tweenedProperties["top"] = topOffSetAttribute[0]; - newTween.tweenedProperties["left"] = leftOffsetAttribute[0]; - this.tweens.push(newTween); - - } - else { - percentValue = this.currentKeyframeRule[i].keyText; - splitValue = percentValue.split("%"); - fraction = splitValue[0] / 100; - this.currentMilliSec = fraction * this.trackDuration[0] * 1000; - this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); - this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; - newTween.spanWidth = this.clickPos - this.tweens[this.tweens.length - 1].keyFramePosition; - newTween.keyFramePosition = this.clickPos; - newTween.keyFrameMillisec = this.currentMilliSec; - newTween.tweenID = this.nextKeyframe; - newTween.spanPosition = this.clickPos - newTween.spanWidth; - newTween.tweenedProperties=[]; - newTween.tweenedProperties["top"] = topOffSetAttribute[0]; - newTween.tweenedProperties["left"] = leftOffsetAttribute[0]; - this.tweens.push(newTween); - - + if(this.animatedElement!==undefined){ + this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); + if(this.animationName){ + this.animationDuration = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); + this.trackDuration = this.animationDuration.split("s"); + this.currentMilliSec = this.trackDuration[0] * 1000; + this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); + this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; + this.nextKeyframe = 0; + + this.currentKeyframeRule = this.application.ninja.stylesController.getAnimationRuleWithName(this.animationName, this.application.ninja.currentDocument._document); + while (this.currentKeyframeRule[i]) { + var newTween = {}; + + offsetAttribute = this.currentKeyframeRule[i].cssText.split(" "); + topOffSetAttribute = offsetAttribute[3].split("px"); + leftOffsetAttribute = offsetAttribute[5].split("px"); + + parseInt(topOffSetAttribute[0]); + parseInt(leftOffsetAttribute[0]); + + if (this.currentKeyframeRule[i].keyText === "0%") { + newTween.spanWidth = 0; + newTween.keyFramePosition = 0; + newTween.keyFrameMillisec = 0; + newTween.tweenID = 0; + newTween.spanPosition = 0; + newTween.tweenedProperties = []; + newTween.tweenedProperties["top"] = topOffSetAttribute[0]; + newTween.tweenedProperties["left"] = leftOffsetAttribute[0]; + this.tweens.push(newTween); + + } + else { + percentValue = this.currentKeyframeRule[i].keyText; + splitValue = percentValue.split("%"); + fraction = splitValue[0] / 100; + this.currentMilliSec = fraction * this.trackDuration[0] * 1000; + this.currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); + this.clickPos = this.currentMilliSec / this.currentMillisecPerPixel; + newTween.spanWidth = this.clickPos - this.tweens[this.tweens.length - 1].keyFramePosition; + newTween.keyFramePosition = this.clickPos; + newTween.keyFrameMillisec = this.currentMilliSec; + newTween.tweenID = this.nextKeyframe; + newTween.spanPosition = this.clickPos - newTween.spanWidth; + newTween.tweenedProperties=[]; + newTween.tweenedProperties["top"] = topOffSetAttribute[0]; + newTween.tweenedProperties["left"] = leftOffsetAttribute[0]; + this.tweens.push(newTween); + + + } + i++; + this.nextKeyframe += 1; } - i++; - this.nextKeyframe += 1; } } else{ -- cgit v1.2.3 From cf9e9b711ba3d77a2a0888f8ab763383f53a1619 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 27 Feb 2012 11:49:34 -0800 Subject: Timeline : Reopening Doc has layer 1 default fix Signed-off-by: Kruti Shah Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 92bb3405..d7d5328e 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -234,6 +234,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { myIndex++; } } + else{ + NJevent('newLayer', this._hashKey); + this.selectLayer(0); + } }else{ NJevent('newLayer', this._hashKey); this.selectLayer(0); -- cgit v1.2.3