// (c) Copyright Microsoft Corporation. // This source is subject to the Microsoft Permissive License. // See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. // All other rights reserved. Type.registerNamespace("Telerik.Web.Animation"); var $TWA=Telerik.Web.Animation; $TWA.registerAnimation=function(_1,_2){ if(_2&&((_2===$TWA.Animation)||(_2.inheritsFrom&&_2.inheritsFrom($TWA.Animation)))){ if(!$TWA.__animations){ $TWA.__animations={}; } $TWA.__animations[_1.toLowerCase()]=_2; _2.play=function(){ var _3=new _2(); _2.apply(_3,arguments); _3.initialize(); var _4=Function.createDelegate(_3,function(){ _3.remove_ended(_4); _4=null; _3.dispose(); }); _3.add_ended(_4); _3.play(); }; }else{ throw Error.argumentType("type",_2,$TWA.Animation,Telerik.Web.Resources.Animation_InvalidBaseType); } }; $TWA.buildAnimation=function(_5,_6){ if(!_5||_5===""){ return null; } var _7; _5="("+_5+")"; if(!Sys.Debug.isDebug){ try{ _7=Sys.Serialization.JavaScriptSerializer.deserialize(_5); } catch(ex){ } }else{ _7=Sys.Serialization.JavaScriptSerializer.deserialize(_5); } return $TWA.createAnimation(_7,_6); }; $TWA.createAnimation=function(_8,_9){ if(!_8||!_8.AnimationName){ throw Error.argument("obj",Telerik.Web.Resources.Animation_MissingAnimationName); } var _a=$TWA.__animations[_8.AnimationName.toLowerCase()]; if(!_a){ throw Error.argument("type",String.format(Telerik.Web.Resources.Animation_UknownAnimationName,_8.AnimationName)); } var _b=new _a(); if(_9){ _b.set_target(_9); } if(_8.AnimationChildren&&_8.AnimationChildren.length){ if($TWA.ParentAnimation.isInstanceOfType(_b)){ for(var i=0;i<_8.AnimationChildren.length;i++){ var _d=$TWA.createAnimation(_8.AnimationChildren[i]); if(_d){ _b.add(_d); } } }else{ throw Error.argument("obj",String.format(Telerik.Web.Resources.Animation_ChildrenNotAllowed,_a.getName())); } } var _e=_a.__animationProperties; if(!_e){ _a.__animationProperties={}; _a.resolveInheritance(); for(var _f in _a.prototype){ if(_f.startsWith("set_")){ _a.__animationProperties[_f.substr(4).toLowerCase()]=_f; } } delete _a.__animationProperties["id"]; _e=_a.__animationProperties; } for(var _10 in _8){ var _11=_10.toLowerCase(); if(_11=="animationname"||_11=="animationchildren"){ continue; } var _12=_8[_10]; var _13=_e[_11]; if(_13&&String.isInstanceOfType(_13)&&_b[_13]){ if(!Sys.Debug.isDebug){ try{ _b[_13](_12); } catch(ex){ } }else{ _b[_13](_12); } }else{ if(_11.endsWith("script")){ _13=_e[_11.substr(0,_10.length-6)]; if(_13&&String.isInstanceOfType(_13)&&_b[_13]){ _b.DynamicProperties[_13]=_12; }else{ if(Sys.Debug.isDebug){ throw Error.argument("obj",String.format(Telerik.Web.Resources.Animation_NoDynamicPropertyFound,_10,_10.substr(0,_10.length-5))); } } }else{ if(Sys.Debug.isDebug){ throw Error.argument("obj",String.format(Telerik.Web.Resources.Animation_NoPropertyFound,_10)); } } } } return _b; }; $TWA.Animation=function(_14,_15,fps){ $TWA.Animation.initializeBase(this); this._duration=1; this._fps=25; this._target=null; this._tickHandler=null; this._timer=null; this._percentComplete=0; this._percentDelta=null; this._owner=null; this._parentAnimation=null; this.DynamicProperties={}; if(_14){ this.set_target(_14); } if(_15){ this.set_duration(_15); } if(fps){ this.set_fps(fps); } }; $TWA.Animation.prototype={dispose:function(){ if(this._timer){ this._timer.dispose(); this._timer=null; } this._tickHandler=null; this._target=null; $TWA.Animation.callBaseMethod(this,"dispose"); },play:function(){ if(!this._owner){ var _17=true; if(!this._timer){ _17=false; if(!this._tickHandler){ this._tickHandler=Function.createDelegate(this,this._onTimerTick); } this._timer=new Telerik.Web.Timer(); this._timer.add_tick(this._tickHandler); this.onStart(); this._timer.set_interval(1000/this._fps); this._percentDelta=100/(this._duration*this._fps); this._updatePercentComplete(0,true); } this._timer.set_enabled(true); this.raisePropertyChanged("isPlaying"); if(!_17){ this.raisePropertyChanged("isActive"); } } },pause:function(){ if(!this._owner){ if(this._timer){ this._timer.set_enabled(false); this.raisePropertyChanged("isPlaying"); } } },stop:function(_18){ if(!this._owner){ var t=this._timer; this._timer=null; if(t){ t.dispose(); if(this._percentComplete!==100){ this._percentComplete=100; this.raisePropertyChanged("percentComplete"); if(_18||_18===undefined){ this.onStep(100); } } this.onEnd(); this.raisePropertyChanged("isPlaying"); this.raisePropertyChanged("isActive"); } } },onStart:function(){ this.raiseStarted(); for(var _1a in this.DynamicProperties){ try{ this[_1a](eval(this.DynamicProperties[_1a])); } catch(ex){ if(Sys.Debug.isDebug){ throw ex; } } } },onStep:function(_1b){ this.setValue(this.getAnimatedValue(_1b)); },onEnd:function(){ this.raiseEnded(); },getAnimatedValue:function(_1c){ throw Error.notImplemented(); },setValue:function(_1d){ throw Error.notImplemented(); },interpolate:function(_1e,end,_20){ return _1e+(end-_1e)*(_20/100); },_onTimerTick:function(){ this._updatePercentComplete(this._percentComplete+this._percentDelta,true); },_updatePercentComplete:function(_21,_22){ if(_21>100){ _21=100; } this._percentComplete=_21; this.raisePropertyChanged("percentComplete"); if(_22){ this.onStep(_21); } if(_21===100){ this.stop(false); } },setOwner:function(_23){ this._owner=_23; },raiseStarted:function(){ var _24=this.get_events().getHandler("started"); if(_24){ _24(this,Sys.EventArgs.Empty); } },add_started:function(_25){ this.get_events().addHandler("started",_25); },remove_started:function(_26){ this.get_events().removeHandler("started",_26); },raiseEnded:function(){ var _27=this.get_events().getHandler("ended"); if(_27){ _27(this,Sys.EventArgs.Empty); } },add_ended:function(_28){ this.get_events().addHandler("ended",_28); },remove_ended:function(_29){ this.get_events().removeHandler("ended",_29); },get_target:function(){ if(!this._target&&this._parentAnimation){ return this._parentAnimation.get_target(); } return this._target; },set_target:function(_2a){ if(this._target!=_2a){ this._target=_2a; this.raisePropertyChanged("target"); } },set_animationTarget:function(id){ var _2c=null; var _2d=$get(id); if(_2d){ _2c=_2d; }else{ var _2e=$find(id); if(_2e){ _2d=_2e.get_element(); if(_2d){ _2c=_2d; } } } if(_2c){ this.set_target(_2c); }else{ throw Error.argument("id",String.format(Telerik.Web.Resources.Animation_TargetNotFound,id)); } },get_duration:function(){ return this._duration; },set_duration:function(_2f){ _2f=this._getFloat(_2f); if(this._duration!=_2f){ this._duration=_2f; this.raisePropertyChanged("duration"); } },get_fps:function(){ return this._fps; },set_fps:function(_30){ _30=this._getInteger(_30); if(this.fps!=_30){ this._fps=_30; this.raisePropertyChanged("fps"); } },get_isActive:function(){ return (this._timer!==null); },get_isPlaying:function(){ return (this._timer!==null)&&this._timer.get_enabled(); },get_percentComplete:function(){ return this._percentComplete; },_getBoolean:function(_31){ if(String.isInstanceOfType(_31)){ return Boolean.parse(_31); } return _31; },_getInteger:function(_32){ if(String.isInstanceOfType(_32)){ return parseInt(_32); } return _32; },_getFloat:function(_33){ if(String.isInstanceOfType(_33)){ return parseFloat(_33); } return _33; },_getEnum:function(_34,_35){ if(String.isInstanceOfType(_34)&&_35&&_35.parse){ return _35.parse(_34); } return _34; }}; $TWA.Animation.registerClass("Telerik.Web.Animation.Animation",Sys.Component); $TWA.registerAnimation("animation",$TWA.Animation); $TWA.ParentAnimation=function(_36,_37,fps,_39){ $TWA.ParentAnimation.initializeBase(this,[_36,_37,fps]); this._animations=[]; if(_39&&_39.length){ for(var i=0;i<_39.length;i++){ this.add(_39[i]); } } }; $TWA.ParentAnimation.prototype={initialize:function(){ $TWA.ParentAnimation.callBaseMethod(this,"initialize"); if(this._animations){ for(var i=0;i=0;i--){ this._animations[i].dispose(); this._animations[i]=null; } Array.clear(this._animations); this._animations=[]; this.raisePropertyChanged("animations"); } }}; $TWA.ParentAnimation.registerClass("Telerik.Web.Animation.ParentAnimation",$TWA.Animation); $TWA.registerAnimation("parent",$TWA.ParentAnimation); $TWA.ParallelAnimation=function(_42,_43,fps,_45){ $TWA.ParallelAnimation.initializeBase(this,[_42,_43,fps,_45]); }; $TWA.ParallelAnimation.prototype={add:function(_46){ $TWA.ParallelAnimation.callBaseMethod(this,"add",[_46]); _46.setOwner(this); },onStart:function(){ $TWA.ParallelAnimation.callBaseMethod(this,"onStart"); var _47=this.get_animations(); for(var i=0;i<_47.length;i++){ _47[i].onStart(); } },onStep:function(_49){ var _4a=this.get_animations(); for(var i=0;i<_4a.length;i++){ _4a[i].onStep(_49); } },onEnd:function(){ var _4c=this.get_animations(); for(var i=0;i<_4c.length;i++){ _4c[i].onEnd(); } $TWA.ParallelAnimation.callBaseMethod(this,"onEnd"); }}; $TWA.ParallelAnimation.registerClass("Telerik.Web.Animation.ParallelAnimation",$TWA.ParentAnimation); $TWA.registerAnimation("parallel",$TWA.ParallelAnimation); $TWA.SequenceAnimation=function(_4e,_4f,fps,_51,_52){ $TWA.SequenceAnimation.initializeBase(this,[_4e,_4f,fps,_51]); this._handler=null; this._paused=false; this._playing=false; this._index=0; this._remainingIterations=0; this._iterations=(_52!==undefined)?_52:1; }; $TWA.SequenceAnimation.prototype={dispose:function(){ this._handler=null; $TWA.SequenceAnimation.callBaseMethod(this,"dispose"); },stop:function(){ if(this._playing){ var _53=this.get_animations(); if(this._index<_53.length){ _53[this._index].remove_ended(this._handler); for(var i=this._index;i<_53.length;i++){ _53[i].stop(); } } this._playing=false; this._paused=false; this.raisePropertyChanged("isPlaying"); this.onEnd(); } },pause:function(){ if(this.get_isPlaying()){ var _55=this.get_animations()[this._index]; if(_55!=null){ _55.pause(); } this._paused=true; this.raisePropertyChanged("isPlaying"); } },play:function(){ var _56=this.get_animations(); if(!this._playing){ this._playing=true; if(this._paused){ this._paused=false; var _57=_56[this._index]; if(_57!=null){ _57.play(); this.raisePropertyChanged("isPlaying"); } }else{ this.onStart(); this._index=0; var _58=_56[this._index]; if(_58){ _58.add_ended(this._handler); _58.play(); this.raisePropertyChanged("isPlaying"); }else{ this.stop(); } } } },onStart:function(){ $TWA.SequenceAnimation.callBaseMethod(this,"onStart"); this._remainingIterations=this._iterations-1; if(!this._handler){ this._handler=Function.createDelegate(this,this._onEndAnimation); } },_onEndAnimation:function(){ var _59=this.get_animations(); var _5a=_59[this._index++]; if(_5a){ _5a.remove_ended(this._handler); } if(this._index<_59.length){ var _5b=_59[this._index]; _5b.add_ended(this._handler); _5b.play(); }else{ if(this._remainingIterations>=1||this._iterations<=0){ this._remainingIterations--; this._index=0; var _5c=_59[0]; _5c.add_ended(this._handler); _5c.play(); }else{ this.stop(); } } },onStep:function(_5d){ throw Error.invalidOperation(Telerik.Web.Resources.Animation_CannotNestSequence); },onEnd:function(){ this._remainingIterations=0; $TWA.SequenceAnimation.callBaseMethod(this,"onEnd"); },get_isActive:function(){ return true; },get_isPlaying:function(){ return this._playing&&!this._paused; },get_iterations:function(){ return this._iterations; },set_iterations:function(_5e){ _5e=this._getInteger(_5e); if(this._iterations!=_5e){ this._iterations=_5e; this.raisePropertyChanged("iterations"); } },get_isInfinite:function(){ return this._iterations<=0; }}; $TWA.SequenceAnimation.registerClass("Telerik.Web.Animation.SequenceAnimation",$TWA.ParentAnimation); $TWA.registerAnimation("sequence",$TWA.SequenceAnimation); $TWA.SelectionAnimation=function(_5f,_60,fps,_62){ $TWA.SelectionAnimation.initializeBase(this,[_5f,_60,fps,_62]); this._selectedIndex=-1; this._selected=null; }; $TWA.SelectionAnimation.prototype={getSelectedIndex:function(){ throw Error.notImplemented(); },onStart:function(){ $TWA.SelectionAnimation.callBaseMethod(this,"onStart"); var _63=this.get_animations(); this._selectedIndex=this.getSelectedIndex(); if(this._selectedIndex>=0&&this._selectedIndex<_63.length){ this._selected=_63[this._selectedIndex]; if(this._selected){ this._selected.setOwner(this); this._selected.onStart(); } } },onStep:function(_64){ if(this._selected){ this._selected.onStep(_64); } },onEnd:function(){ if(this._selected){ this._selected.onEnd(); this._selected.setOwner(null); } this._selected=null; this._selectedIndex=null; $TWA.SelectionAnimation.callBaseMethod(this,"onEnd"); }}; $TWA.SelectionAnimation.registerClass("Telerik.Web.Animation.SelectionAnimation",$TWA.ParentAnimation); $TWA.registerAnimation("selection",$TWA.SelectionAnimation); $TWA.ConditionAnimation=function(_65,_66,fps,_68,_69){ $TWA.ConditionAnimation.initializeBase(this,[_65,_66,fps,_68]); this._conditionScript=_69; }; $TWA.ConditionAnimation.prototype={getSelectedIndex:function(){ var _6a=-1; if(this._conditionScript&&this._conditionScript.length>0){ try{ _6a=eval(this._conditionScript)?0:1; } catch(ex){ } } return _6a; },get_conditionScript:function(){ return this._conditionScript; },set_conditionScript:function(_6b){ if(this._conditionScript!=_6b){ this._conditionScript=_6b; this.raisePropertyChanged("conditionScript"); } }}; $TWA.ConditionAnimation.registerClass("Telerik.Web.Animation.ConditionAnimation",$TWA.SelectionAnimation); $TWA.registerAnimation("condition",$TWA.ConditionAnimation); $TWA.CaseAnimation=function(_6c,_6d,fps,_6f,_70){ $TWA.CaseAnimation.initializeBase(this,[_6c,_6d,fps,_6f]); this._selectScript=_70; }; $TWA.CaseAnimation.prototype={getSelectedIndex:function(){ var _71=-1; if(this._selectScript&&this._selectScript.length>0){ try{ var _72=eval(this._selectScript); if(_72!==undefined){ _71=_72; } } catch(ex){ } } return _71; },get_selectScript:function(){ return this._selectScript; },set_selectScript:function(_73){ if(this._selectScript!=_73){ this._selectScript=_73; this.raisePropertyChanged("selectScript"); } }}; $TWA.CaseAnimation.registerClass("Telerik.Web.Animation.CaseAnimation",$TWA.SelectionAnimation); $TWA.registerAnimation("case",$TWA.CaseAnimation); $TWA.FadeEffect=function(){ throw Error.invalidOperation(); }; $TWA.FadeEffect.prototype={FadeIn:0,FadeOut:1}; $TWA.FadeEffect.registerEnum("Telerik.Web.Animation.FadeEffect",false); $TWA.FadeAnimation=function(_74,_75,fps,_77,_78,_79,_7a){ $TWA.FadeAnimation.initializeBase(this,[_74,_75,fps]); this._effect=(_77!==undefined)?_77:$TWA.FadeEffect.FadeIn; this._max=(_79!==undefined)?_79:1; this._min=(_78!==undefined)?_78:0; this._start=this._min; this._end=this._max; this._layoutCreated=false; this._forceLayoutInIE=(_7a===undefined||_7a===null)?true:_7a; this._currentTarget=null; this._resetOpacities(); }; $TWA.FadeAnimation.prototype={_resetOpacities:function(){ if(this._effect==$TWA.FadeEffect.FadeIn){ this._start=this._min; this._end=this._max; }else{ this._start=this._max; this._end=this._min; } },_createLayout:function(){ var _7b=this._currentTarget; if(_7b){ var _7c=TelerikCommonScripts.getCurrentStyle(_7b,"width"); var _7d=TelerikCommonScripts.getCurrentStyle(_7b,"height"); var _7e=TelerikCommonScripts.getCurrentStyle(_7b,"backgroundColor"); if((!_7c||_7c==""||_7c=="auto")&&(!_7d||_7d==""||_7d=="auto")){ _7b.style.width=_7b.offsetWidth+"px"; } if(!_7e||_7e==""||_7e=="transparent"||_7e=="rgba(0, 0, 0, 0)"){ _7b.style.backgroundColor=TelerikCommonScripts.getInheritedBackgroundColor(_7b); } this._layoutCreated=true; } },onStart:function(){ $TWA.FadeAnimation.callBaseMethod(this,"onStart"); this._currentTarget=this.get_target(); this.setValue(this._start); if(this._forceLayoutInIE&&!this._layoutCreated&&Sys.Browser.agent==Sys.Browser.InternetExplorer){ this._createLayout(); } },getAnimatedValue:function(_7f){ return this.interpolate(this._start,this._end,_7f); },setValue:function(_80){ if(this._currentTarget){ TelerikCommonScripts.setElementOpacity(this._currentTarget,_80); } },get_effect:function(){ return this._effect; },set_effect:function(_81){ _81=this._getEnum(_81,$TWA.FadeEffect); if(this._effect!=_81){ this._effect=_81; this._resetOpacities(); this.raisePropertyChanged("effect"); } },get_minimumOpacity:function(){ return this._min; },set_minimumOpacity:function(_82){ _82=this._getFloat(_82); if(this._min!=_82){ this._min=_82; this._resetOpacities(); this.raisePropertyChanged("minimumOpacity"); } },get_maximumOpacity:function(){ return this._max; },set_maximumOpacity:function(_83){ _83=this._getFloat(_83); if(this._max!=_83){ this._max=_83; this._resetOpacities(); this.raisePropertyChanged("maximumOpacity"); } },get_forceLayoutInIE:function(){ return this._forceLayoutInIE; },set_forceLayoutInIE:function(_84){ _84=this._getBoolean(_84); if(this._forceLayoutInIE!=_84){ this._forceLayoutInIE=_84; this.raisePropertyChanged("forceLayoutInIE"); } },set_startValue:function(_85){ _85=this._getFloat(_85); this._start=_85; }}; $TWA.FadeAnimation.registerClass("Telerik.Web.Animation.FadeAnimation",$TWA.Animation); $TWA.registerAnimation("fade",$TWA.FadeAnimation); $TWA.FadeInAnimation=function(_86,_87,fps,_89,_8a,_8b){ $TWA.FadeInAnimation.initializeBase(this,[_86,_87,fps,$TWA.FadeEffect.FadeIn,_89,_8a,_8b]); }; $TWA.FadeInAnimation.prototype={onStart:function(){ $TWA.FadeInAnimation.callBaseMethod(this,"onStart"); if(this._currentTarget){ this.set_startValue(TelerikCommonScripts.getElementOpacity(this._currentTarget)); } }}; $TWA.FadeInAnimation.registerClass("Telerik.Web.Animation.FadeInAnimation",$TWA.FadeAnimation); $TWA.registerAnimation("fadeIn",$TWA.FadeInAnimation); $TWA.FadeOutAnimation=function(_8c,_8d,fps,_8f,_90,_91){ $TWA.FadeOutAnimation.initializeBase(this,[_8c,_8d,fps,$TWA.FadeEffect.FadeOut,_8f,_90,_91]); }; $TWA.FadeOutAnimation.prototype={onStart:function(){ $TWA.FadeOutAnimation.callBaseMethod(this,"onStart"); if(this._currentTarget){ this.set_startValue(TelerikCommonScripts.getElementOpacity(this._currentTarget)); } }}; $TWA.FadeOutAnimation.registerClass("Telerik.Web.Animation.FadeOutAnimation",$TWA.FadeAnimation); $TWA.registerAnimation("fadeOut",$TWA.FadeOutAnimation); $TWA.PulseAnimation=function(_92,_93,fps,_95,_96,_97,_98){ $TWA.PulseAnimation.initializeBase(this,[_92,_93,fps,null,((_95!==undefined)?_95:3)]); this._out=new $TWA.FadeOutAnimation(_92,_93,fps,_96,_97,_98); this.add(this._out); this._in=new $TWA.FadeInAnimation(_92,_93,fps,_96,_97,_98); this.add(this._in); }; $TWA.PulseAnimation.prototype={get_minimumOpacity:function(){ return this._out.get_minimumOpacity(); },set_minimumOpacity:function(_99){ _99=this._getFloat(_99); this._out.set_minimumOpacity(_99); this._in.set_minimumOpacity(_99); this.raisePropertyChanged("minimumOpacity"); },get_maximumOpacity:function(){ return this._out.get_maximumOpacity(); },set_maximumOpacity:function(_9a){ _9a=this._getFloat(_9a); this._out.set_maximumOpacity(_9a); this._in.set_maximumOpacity(_9a); this.raisePropertyChanged("maximumOpacity"); },get_forceLayoutInIE:function(){ return this._out.get_forceLayoutInIE(); },set_forceLayoutInIE:function(_9b){ _9b=this._getBoolean(_9b); this._out.set_forceLayoutInIE(_9b); this._in.set_forceLayoutInIE(_9b); this.raisePropertyChanged("forceLayoutInIE"); },set_duration:function(_9c){ _9c=this._getFloat(_9c); $TWA.PulseAnimation.callBaseMethod(this,"set_duration",[_9c]); this._in.set_duration(_9c); this._out.set_duration(_9c); },set_fps:function(_9d){ _9d=this._getInteger(_9d); $TWA.PulseAnimation.callBaseMethod(this,"set_fps",[_9d]); this._in.set_fps(_9d); this._out.set_fps(_9d); }}; $TWA.PulseAnimation.registerClass("Telerik.Web.Animation.PulseAnimation",$TWA.SequenceAnimation); $TWA.registerAnimation("pulse",$TWA.PulseAnimation); $TWA.PropertyAnimation=function(_9e,_9f,fps,_a1,_a2){ $TWA.PropertyAnimation.initializeBase(this,[_9e,_9f,fps]); this._property=_a1; this._propertyKey=_a2; this._currentTarget=null; }; $TWA.PropertyAnimation.prototype={onStart:function(){ $TWA.PropertyAnimation.callBaseMethod(this,"onStart"); this._currentTarget=this.get_target(); },setValue:function(_a3){ var _a4=this._currentTarget; if(_a4&&this._property&&this._property.length>0){ if(this._propertyKey&&this._propertyKey.length>0&&_a4[this._property]){ _a4[this._property][this._propertyKey]=_a3; }else{ _a4[this._property]=_a3; } } },getValue:function(){ var _a5=this.get_target(); if(_a5&&this._property&&this._property.length>0){ var _a6=_a5[this._property]; if(_a6){ if(this._propertyKey&&this._propertyKey.length>0){ return _a6[this._propertyKey]; } return _a6; } } return null; },get_property:function(){ return this._property; },set_property:function(_a7){ if(this._property!=_a7){ this._property=_a7; this.raisePropertyChanged("property"); } },get_propertyKey:function(){ return this._propertyKey; },set_propertyKey:function(_a8){ if(this._propertyKey!=_a8){ this._propertyKey=_a8; this.raisePropertyChanged("propertyKey"); } }}; $TWA.PropertyAnimation.registerClass("Telerik.Web.Animation.PropertyAnimation",$TWA.Animation); $TWA.registerAnimation("property",$TWA.PropertyAnimation); $TWA.DiscreteAnimation=function(_a9,_aa,fps,_ac,_ad,_ae){ $TWA.DiscreteAnimation.initializeBase(this,[_a9,_aa,fps,_ac,_ad]); this._values=(_ae&&_ae.length)?_ae:[]; }; $TWA.DiscreteAnimation.prototype={getAnimatedValue:function(_af){ var _b0=Math.floor(this.interpolate(0,this._values.length-1,_af)); return this._values[_b0]; },get_values:function(){ return this._values; },set_values:function(_b1){ if(this._values!=_b1){ this._values=_b1; this.raisePropertyChanged("values"); } }}; $TWA.DiscreteAnimation.registerClass("Telerik.Web.Animation.DiscreteAnimation",$TWA.PropertyAnimation); $TWA.registerAnimation("discrete",$TWA.DiscreteAnimation); $TWA.InterpolatedAnimation=function(_b2,_b3,fps,_b5,_b6,_b7,_b8){ $TWA.InterpolatedAnimation.initializeBase(this,[_b2,_b3,fps,((_b5!==undefined)?_b5:"style"),_b6]); this._startValue=_b7; this._endValue=_b8; }; $TWA.InterpolatedAnimation.prototype={get_startValue:function(){ return this._startValue; },set_startValue:function(_b9){ _b9=this._getFloat(_b9); if(this._startValue!=_b9){ this._startValue=_b9; this.raisePropertyChanged("startValue"); } },get_endValue:function(){ return this._endValue; },set_endValue:function(_ba){ _ba=this._getFloat(_ba); if(this._endValue!=_ba){ this._endValue=_ba; this.raisePropertyChanged("endValue"); } }}; $TWA.InterpolatedAnimation.registerClass("Telerik.Web.Animation.InterpolatedAnimation",$TWA.PropertyAnimation); $TWA.registerAnimation("interpolated",$TWA.InterpolatedAnimation); $TWA.ColorAnimation=function(_bb,_bc,fps,_be,_bf,_c0,_c1){ $TWA.ColorAnimation.initializeBase(this,[_bb,_bc,fps,_be,_bf,_c0,_c1]); this._start=null; this._end=null; this._interpolateRed=false; this._interpolateGreen=false; this._interpolateBlue=false; }; $TWA.ColorAnimation.prototype={onStart:function(){ $TWA.ColorAnimation.callBaseMethod(this,"onStart"); this._start=$TWA.ColorAnimation.getRGB(this.get_startValue()); this._end=$TWA.ColorAnimation.getRGB(this.get_endValue()); this._interpolateRed=(this._start.Red!=this._end.Red); this._interpolateGreen=(this._start.Green!=this._end.Green); this._interpolateBlue=(this._start.Blue!=this._end.Blue); },getAnimatedValue:function(_c2){ var r=this._start.Red; var g=this._start.Green; var b=this._start.Blue; if(this._interpolateRed){ r=Math.round(this.interpolate(r,this._end.Red,_c2)); } if(this._interpolateGreen){ g=Math.round(this.interpolate(g,this._end.Green,_c2)); } if(this._interpolateBlue){ b=Math.round(this.interpolate(b,this._end.Blue,_c2)); } return $TWA.ColorAnimation.toColor(r,g,b); },set_startValue:function(_c6){ if(this._startValue!=_c6){ this._startValue=_c6; this.raisePropertyChanged("startValue"); } },set_endValue:function(_c7){ if(this._endValue!=_c7){ this._endValue=_c7; this.raisePropertyChanged("endValue"); } }}; $TWA.ColorAnimation.getRGB=function(_c8){ if(!_c8||_c8.length!=7){ throw String.format(Telerik.Web.Resources.Animation_InvalidColor,_c8); } return {"Red":parseInt(_c8.substr(1,2),16),"Green":parseInt(_c8.substr(3,2),16),"Blue":parseInt(_c8.substr(5,2),16)}; }; $TWA.ColorAnimation.toColor=function(red,_ca,_cb){ var r=red.toString(16); var g=_ca.toString(16); var b=_cb.toString(16); if(r.length==1){ r="0"+r; } if(g.length==1){ g="0"+g; } if(b.length==1){ b="0"+b; } return "#"+r+g+b; }; $TWA.ColorAnimation.registerClass("Telerik.Web.Animation.ColorAnimation",$TWA.InterpolatedAnimation); $TWA.registerAnimation("color",$TWA.ColorAnimation); $TWA.LengthAnimation=function(_cf,_d0,fps,_d2,_d3,_d4,_d5,_d6){ $TWA.LengthAnimation.initializeBase(this,[_cf,_d0,fps,_d2,_d3,_d4,_d5]); this._unit=(_d6!=null)?_d6:"px"; }; $TWA.LengthAnimation.prototype={getAnimatedValue:function(_d7){ var _d8=this.interpolate(this.get_startValue(),this.get_endValue(),_d7); return Math.round(_d8)+this._unit; },get_unit:function(){ return this._unit; },set_unit:function(_d9){ if(this._unit!=_d9){ this._unit=_d9; this.raisePropertyChanged("unit"); } }}; $TWA.LengthAnimation.registerClass("Telerik.Web.Animation.LengthAnimation",$TWA.InterpolatedAnimation); $TWA.registerAnimation("length",$TWA.LengthAnimation); $TWA.MoveAnimation=function(_da,_db,fps,_dd,_de,_df,_e0){ $TWA.MoveAnimation.initializeBase(this,[_da,_db,fps,null]); this._horizontal=_dd?_dd:0; this._vertical=_de?_de:0; this._relative=(_df===undefined)?true:_df; this._horizontalAnimation=new $TWA.LengthAnimation(_da,_db,fps,"style","left",null,null,_e0); this._verticalAnimation=new $TWA.LengthAnimation(_da,_db,fps,"style","top",null,null,_e0); this.add(this._verticalAnimation); this.add(this._horizontalAnimation); }; $TWA.MoveAnimation.prototype={onStart:function(){ $TWA.MoveAnimation.callBaseMethod(this,"onStart"); var _e1=this.get_target(); this._horizontalAnimation.set_startValue(_e1.offsetLeft); this._horizontalAnimation.set_endValue(this._relative?_e1.offsetLeft+this._horizontal:this._horizontal); this._verticalAnimation.set_startValue(_e1.offsetTop); this._verticalAnimation.set_endValue(this._relative?_e1.offsetTop+this._vertical:this._vertical); },get_horizontal:function(){ return this._horizontal; },set_horizontal:function(_e2){ _e2=this._getFloat(_e2); if(this._horizontal!=_e2){ this._horizontal=_e2; this.raisePropertyChanged("horizontal"); } },get_vertical:function(){ return this._vertical; },set_vertical:function(_e3){ _e3=this._getFloat(_e3); if(this._vertical!=_e3){ this._vertical=_e3; this.raisePropertyChanged("vertical"); } },get_relative:function(){ return this._relative; },set_relative:function(_e4){ _e4=this._getBoolean(_e4); if(this._relative!=_e4){ this._relative=_e4; this.raisePropertyChanged("relative"); } },get_unit:function(){ this._horizontalAnimation.get_unit(); },set_unit:function(_e5){ var _e6=this._horizontalAnimation.get_unit(); if(_e6!=_e5){ this._horizontalAnimation.set_unit(_e5); this._verticalAnimation.set_unit(_e5); this.raisePropertyChanged("unit"); } }}; $TWA.MoveAnimation.registerClass("Telerik.Web.Animation.MoveAnimation",$TWA.ParallelAnimation); $TWA.registerAnimation("move",$TWA.MoveAnimation); $TWA.ResizeAnimation=function(_e7,_e8,fps,_ea,_eb,_ec){ $TWA.ResizeAnimation.initializeBase(this,[_e7,_e8,fps,null]); this._width=_ea; this._height=_eb; this._horizontalAnimation=new $TWA.LengthAnimation(_e7,_e8,fps,"style","width",null,null,_ec); this._verticalAnimation=new $TWA.LengthAnimation(_e7,_e8,fps,"style","height",null,null,_ec); this.add(this._horizontalAnimation); this.add(this._verticalAnimation); }; $TWA.ResizeAnimation.prototype={onStart:function(){ $TWA.ResizeAnimation.callBaseMethod(this,"onStart"); var _ed=this.get_target(); this._horizontalAnimation.set_startValue(_ed.offsetWidth); this._verticalAnimation.set_startValue(_ed.offsetHeight); this._horizontalAnimation.set_endValue((this._width!==null&&this._width!==undefined)?this._width:_ed.offsetWidth); this._verticalAnimation.set_endValue((this._height!==null&&this._height!==undefined)?this._height:_ed.offsetHeight); },get_width:function(){ return this._width; },set_width:function(_ee){ _ee=this._getFloat(_ee); if(this._width!=_ee){ this._width=_ee; this.raisePropertyChanged("width"); } },get_height:function(){ return this._height; },set_height:function(_ef){ _ef=this._getFloat(_ef); if(this._height!=_ef){ this._height=_ef; this.raisePropertyChanged("height"); } },get_unit:function(){ this._horizontalAnimation.get_unit(); },set_unit:function(_f0){ var _f1=this._horizontalAnimation.get_unit(); if(_f1!=_f0){ this._horizontalAnimation.set_unit(_f0); this._verticalAnimation.set_unit(_f0); this.raisePropertyChanged("unit"); } }}; $TWA.ResizeAnimation.registerClass("Telerik.Web.Animation.ResizeAnimation",$TWA.ParallelAnimation); $TWA.registerAnimation("resize",$TWA.ResizeAnimation); $TWA.ScaleAnimation=function(_f2,_f3,fps,_f5,_f6,_f7,_f8,_f9){ $TWA.ScaleAnimation.initializeBase(this,[_f2,_f3,fps]); this._scaleFactor=(_f5!==undefined)?_f5:1; this._unit=(_f6!==undefined)?_f6:"px"; this._center=_f7; this._scaleFont=_f8; this._fontUnit=(_f9!==undefined)?_f9:"pt"; this._element=null; this._initialHeight=null; this._initialWidth=null; this._initialTop=null; this._initialLeft=null; this._initialFontSize=null; }; $TWA.ScaleAnimation.prototype={getAnimatedValue:function(_fa){ return this.interpolate(1,this._scaleFactor,_fa); },onStart:function(){ $TWA.ScaleAnimation.callBaseMethod(this,"onStart"); this._element=this.get_target(); if(this._element){ this._initialHeight=this._element.offsetHeight; this._initialWidth=this._element.offsetWidth; if(this._center){ this._initialTop=this._element.offsetTop; this._initialLeft=this._element.offsetLeft; } if(this._scaleFont){ this._initialFontSize=parseFloat(TelerikCommonScripts.getCurrentStyle(this._element,"fontSize")); } } },setValue:function(_fb){ if(this._element){ var _fc=Math.round(this._initialWidth*_fb); var _fd=Math.round(this._initialHeight*_fb); this._element.style.width=_fc+this._unit; this._element.style.height=_fd+this._unit; if(this._center){ this._element.style.top=(this._initialTop+Math.round((this._initialHeight-_fd)/2))+this._unit; this._element.style.left=(this._initialLeft+Math.round((this._initialWidth-_fc)/2))+this._unit; } if(this._scaleFont){ var _fe=this._initialFontSize*_fb; if(this._fontUnit=="px"||this._fontUnit=="pt"){ _fe=Math.round(_fe); } this._element.style.fontSize=_fe+this._fontUnit; } } },onEnd:function(){ this._element=null; this._initialHeight=null; this._initialWidth=null; this._initialTop=null; this._initialLeft=null; this._initialFontSize=null; $TWA.ScaleAnimation.callBaseMethod(this,"onEnd"); },get_scaleFactor:function(){ return this._scaleFactor; },set_scaleFactor:function(_ff){ _ff=this._getFloat(_ff); if(this._scaleFactor!=_ff){ this._scaleFactor=_ff; this.raisePropertyChanged("scaleFactor"); } },get_unit:function(){ return this._unit; },set_unit:function(_100){ if(this._unit!=_100){ this._unit=_100; this.raisePropertyChanged("unit"); } },get_center:function(){ return this._center; },set_center:function(_101){ _101=this._getBoolean(_101); if(this._center!=_101){ this._center=_101; this.raisePropertyChanged("center"); } },get_scaleFont:function(){ return this._scaleFont; },set_scaleFont:function(_102){ _102=this._getBoolean(_102); if(this._scaleFont!=_102){ this._scaleFont=_102; this.raisePropertyChanged("scaleFont"); } },get_fontUnit:function(){ return this._fontUnit; },set_fontUnit:function(_103){ if(this._fontUnit!=_103){ this._fontUnit=_103; this.raisePropertyChanged("fontUnit"); } }}; $TWA.ScaleAnimation.registerClass("Telerik.Web.Animation.ScaleAnimation",$TWA.Animation); $TWA.registerAnimation("scale",$TWA.ScaleAnimation); $TWA.Action=function(_104,_105,fps){ $TWA.Action.initializeBase(this,[_104,_105,fps]); if(_105===undefined){ this.set_duration(0); } }; $TWA.Action.prototype={onEnd:function(){ this.doAction(); $TWA.Action.callBaseMethod(this,"onEnd"); },doAction:function(){ throw Error.notImplemented(); },getAnimatedValue:function(){ },setValue:function(){ }}; $TWA.Action.registerClass("Telerik.Web.Animation.Action",$TWA.Animation); $TWA.registerAnimation("action",$TWA.Action); $TWA.EnableAction=function(_107,_108,fps,_10a){ $TWA.EnableAction.initializeBase(this,[_107,_108,fps]); this._enabled=(_10a!==undefined)?_10a:true; }; $TWA.EnableAction.prototype={doAction:function(){ var _10b=this.get_target(); if(_10b){ _10b.disabled=!this._enabled; } },get_enabled:function(){ return this._enabled; },set_enabled:function(_10c){ _10c=this._getBoolean(_10c); if(this._enabled!=_10c){ this._enabled=_10c; this.raisePropertyChanged("enabled"); } }}; $TWA.EnableAction.registerClass("Telerik.Web.Animation.EnableAction",$TWA.Action); $TWA.registerAnimation("enableAction",$TWA.EnableAction); $TWA.HideAction=function(_10d,_10e,fps){ $TWA.HideAction.initializeBase(this,[_10d,_10e,fps]); }; $TWA.HideAction.prototype={doAction:function(){ var _110=this.get_target(); if(_110){ _110.style.display="none"; } }}; $TWA.HideAction.registerClass("Telerik.Web.Animation.HideAction",$TWA.Action); $TWA.registerAnimation("hideAction",$TWA.HideAction); $TWA.StyleAction=function(_111,_112,fps,_114,_115){ $TWA.StyleAction.initializeBase(this,[_111,_112,fps]); this._attribute=_114; this._value=_115; }; $TWA.StyleAction.prototype={doAction:function(){ var _116=this.get_target(); if(_116){ _116.style[this._attribute]=this._value; } },get_attribute:function(){ return this._attribute; },set_attribute:function(_117){ if(this._attribute!=_117){ this._attribute=_117; this.raisePropertyChanged("attribute"); } },get_value:function(){ return this._value; },set_value:function(_118){ if(this._value!=_118){ this._value=_118; this.raisePropertyChanged("value"); } }}; $TWA.StyleAction.registerClass("Telerik.Web.Animation.StyleAction",$TWA.Action); $TWA.registerAnimation("styleAction",$TWA.StyleAction); $TWA.OpacityAction=function(_119,_11a,fps,_11c){ $TWA.OpacityAction.initializeBase(this,[_119,_11a,fps]); this._opacity=_11c; }; $TWA.OpacityAction.prototype={doAction:function(){ var _11d=this.get_target(); if(_11d){ TelerikCommonScripts.setElementOpacity(_11d,this._opacity); } },get_opacity:function(){ return this._opacity; },set_opacity:function(_11e){ _11e=this._getFloat(_11e); if(this._opacity!=_11e){ this._opacity=_11e; this.raisePropertyChanged("opacity"); } }}; $TWA.OpacityAction.registerClass("Telerik.Web.Animation.OpacityAction",$TWA.Action); $TWA.registerAnimation("opacityAction",$TWA.OpacityAction); $TWA.ScriptAction=function(_11f,_120,fps,_122){ $TWA.ScriptAction.initializeBase(this,[_11f,_120,fps]); this._script=_122; }; $TWA.ScriptAction.prototype={doAction:function(){ try{ eval(this._script); } catch(ex){ } },get_script:function(){ return this._script; },set_script:function(_123){ if(this._script!=_123){ this._script=_123; this.raisePropertyChanged("script"); } }}; $TWA.ScriptAction.registerClass("Telerik.Web.Animation.ScriptAction",$TWA.Action); $TWA.registerAnimation("scriptAction",$TWA.ScriptAction); if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();