From 2f01fe57a8d37767827d6db42850aef86a767c53 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Nov 2010 10:39:52 +0300 Subject: add dijit/dojo stuff; initial ui mockup --- lib/dojo/fx.js | 252 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 lib/dojo/fx.js (limited to 'lib/dojo/fx.js') diff --git a/lib/dojo/fx.js b/lib/dojo/fx.js new file mode 100644 index 000000000..39ae253fd --- /dev/null +++ b/lib/dojo/fx.js @@ -0,0 +1,252 @@ +/* + Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Available via Academic Free License >= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dojo.fx"]){ +dojo._hasResource["dojo.fx"]=true; +dojo.provide("dojo.fx"); +dojo.require("dojo.fx.Toggler"); +(function(){ +var d=dojo,_1={_fire:function(_2,_3){ +if(this[_2]){ +this[_2].apply(this,_3||[]); +} +return this; +}}; +var _4=function(_5){ +this._index=-1; +this._animations=_5||[]; +this._current=this._onAnimateCtx=this._onEndCtx=null; +this.duration=0; +d.forEach(this._animations,function(a){ +this.duration+=a.duration; +if(a.delay){ +this.duration+=a.delay; +} +},this); +}; +d.extend(_4,{_onAnimate:function(){ +this._fire("onAnimate",arguments); +},_onEnd:function(){ +d.disconnect(this._onAnimateCtx); +d.disconnect(this._onEndCtx); +this._onAnimateCtx=this._onEndCtx=null; +if(this._index+1==this._animations.length){ +this._fire("onEnd"); +}else{ +this._current=this._animations[++this._index]; +this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate"); +this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd"); +this._current.play(0,true); +} +},play:function(_6,_7){ +if(!this._current){ +this._current=this._animations[this._index=0]; +} +if(!_7&&this._current.status()=="playing"){ +return this; +} +var _8=d.connect(this._current,"beforeBegin",this,function(){ +this._fire("beforeBegin"); +}),_9=d.connect(this._current,"onBegin",this,function(_a){ +this._fire("onBegin",arguments); +}),_b=d.connect(this._current,"onPlay",this,function(_c){ +this._fire("onPlay",arguments); +d.disconnect(_8); +d.disconnect(_9); +d.disconnect(_b); +}); +if(this._onAnimateCtx){ +d.disconnect(this._onAnimateCtx); +} +this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate"); +if(this._onEndCtx){ +d.disconnect(this._onEndCtx); +} +this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd"); +this._current.play.apply(this._current,arguments); +return this; +},pause:function(){ +if(this._current){ +var e=d.connect(this._current,"onPause",this,function(_d){ +this._fire("onPause",arguments); +d.disconnect(e); +}); +this._current.pause(); +} +return this; +},gotoPercent:function(_e,_f){ +this.pause(); +var _10=this.duration*_e; +this._current=null; +d.some(this._animations,function(a){ +if(a.duration<=_10){ +this._current=a; +return true; +} +_10-=a.duration; +return false; +}); +if(this._current){ +this._current.gotoPercent(_10/this._current.duration,_f); +} +return this; +},stop:function(_11){ +if(this._current){ +if(_11){ +for(;this._index+1this._animations.length){ +this._fire("onEnd"); +} +},_call:function(_19,_1a){ +var t=this._pseudoAnimation; +t[_19].apply(t,_1a); +},play:function(_1b,_1c){ +this._finished=0; +this._doAction("play",arguments); +this._call("play",arguments); +return this; +},pause:function(){ +this._doAction("pause",arguments); +this._call("pause",arguments); +return this; +},gotoPercent:function(_1d,_1e){ +var ms=this.duration*_1d; +d.forEach(this._animations,function(a){ +a.gotoPercent(a.duration