From 4a4bee3c7f1132d069926a5a8a67817a9df7a7e8 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 25 May 2012 11:02:26 -0700 Subject: update retrieveStoredTweens method change the method to retrieve the keyframe styles for each keyframe generically instead of hard coding for top, left, width and height Signed-off-by: Jonathan Duran --- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 40 ++++++++++------------ 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 9c8b5206..8d9fd964 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -764,17 +764,25 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { var newTween = {}; newTween.tweenData = {}; - offsetAttribute = this.currentKeyframeRule[i].cssText.split(" "); - - topOffSetAttribute = offsetAttribute[3].split("px"); - leftOffsetAttribute = offsetAttribute[5].split("px"); - widthOffsetAttribute = offsetAttribute[7].split("px"); - heightOffsetAttribute = offsetAttribute[9].split("px"); - - var tempTopOffset = parseInt(topOffSetAttribute[0]); - var tempLeftOffset = parseInt(leftOffsetAttribute[0]); - var tempWidthOffset = parseInt(widthOffsetAttribute[0]); - var tempHeightOffset = parseInt(heightOffsetAttribute[0]); + var j, styleLength = this.currentKeyframeRule[i].style.length, keyframeStyles = []; + + for(j=0; j --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 8d9fd964..5839e0ac 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -819,7 +819,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { getAllAnimationRules:{ value:function(ruleNames){ - //console.log(ruleNames); for(var i in ruleNames){ var currentName = ruleNames[i].replace(/^\s+|\s+$/g,""); // trim whitespace @@ -833,17 +832,11 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { recreatePropertyTracks:{ value:function(ruleSet){ - //var selectIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); - //var test = this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(); - //console.log(test); - for(var i in ruleSet){ - console.log(i); - //console.log(ruleSet[i]); var styleProp = ruleSet[i][0].style[0]; - console.log(styleProp); this.application.ninja.timeline.layerRepetition.childComponents[0].addStyle(styleProp); } + } }, @@ -881,14 +874,13 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { var keyframePercent = Math.round((keyMill / trackDur) * 100) + "%"; var keyframePropertyString = " " + keyframePercent + " {"; for(var prop in this.tweens[i].tweenData.tweenedProperties){ - console.log(prop + " - " + this.tweens[i].tweenData.tweenedProperties[prop]); + //console.log(prop + " - " + this.tweens[i].tweenData.tweenedProperties[prop]); keyframePropertyString += prop + ": " + this.tweens[i].tweenData.tweenedProperties[prop] + ";"; } keyframePropertyString += "}"; keyframeString += keyframePropertyString; } keyframeString += " }"; - console.log(keyframeString); // set the keyframe string as the new rule this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); this.application.ninja.documentController.activeDocument.needsSave = true; -- cgit v1.2.3 From 6808427d3c0defa9f00884711b316f4e76ac54fc Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 25 May 2012 14:08:44 -0700 Subject: animation name string fix Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 5839e0ac..f90e10c2 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -747,12 +747,13 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { // check for multiple animation names var animationNameList = this.animationName.split(","); if(animationNameList.length > 1){ + this.animationNamesString = this.animationName; this.animationName = animationNameList[0]; this.getAllAnimationRules(animationNameList); + } else { + this.animationNamesString = this.animationName; } - this.animationNamesString = this.animationName; - // build tweens for this tracks's keyframe rule if(this.animationName){ trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); -- cgit v1.2.3