Changeset 1359
- Timestamp:
- 04/19/08 03:43:28 (3 months ago)
- Files:
-
- mochikit/trunk/MochiKit/Visual.js (modified) (2 diffs)
- mochikit/trunk/packed/MochiKit/MochiKit.js (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mochikit/trunk/MochiKit/Visual.js
r1340 r1359 448 448 /** @id MochiKit.Visual.Transitions.sinoidal */ 449 449 MochiKit.Visual.Transitions.sinoidal = function (pos) { 450 return (-Math.cos(pos*Math.PI)/2) + 0.5;450 return 0.5 - Math.cos(pos*Math.PI)/2; 451 451 }; 452 452 … … 458 458 /** @id MochiKit.Visual.Transitions.flicker */ 459 459 MochiKit.Visual.Transitions.flicker = function (pos) { 460 return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;460 return 0.25 - Math.cos(pos*Math.PI)/4 + Math.random()/2; 461 461 }; 462 462 463 463 /** @id MochiKit.Visual.Transitions.wobble */ 464 464 MochiKit.Visual.Transitions.wobble = function (pos) { 465 return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;465 return 0.5 - Math.cos(9*pos*Math.PI)/2; 466 466 }; 467 467 468 468 /** @id MochiKit.Visual.Transitions.pulse */ 469 469 MochiKit.Visual.Transitions.pulse = function (pos, pulses) { 470 if ( !pulses) {471 return (Math.floor(pos*10) % 2 === 0 ?472 (pos*10 - Math.floor(pos*10)) : 1 - (pos*10 - Math.floor(pos*10)));473 }474 return (Math.round((pos % (1/pulses)) * pulses) == 0 ?475 ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) :476 1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)));470 if (pulses) { 471 pos *= 2 * pulses; 472 } else { 473 pos *= 10; 474 } 475 var decimals = pos - Math.floor(pos); 476 return (Math.floor(pos) % 2 == 0) ? decimals : 1 - decimals; 477 477 }; 478 478 mochikit/trunk/packed/MochiKit/MochiKit.js
r1355 r1359 5778 5778 }; 5779 5779 MochiKit.Visual.Transitions.sinoidal=function(pos){ 5780 return (-Math.cos(pos*Math.PI)/2)+0.5;5780 return 0.5-Math.cos(pos*Math.PI)/2; 5781 5781 }; 5782 5782 MochiKit.Visual.Transitions.reverse=function(pos){ … … 5784 5784 }; 5785 5785 MochiKit.Visual.Transitions.flicker=function(pos){ 5786 return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;5786 return 0.25-Math.cos(pos*Math.PI)/4+Math.random()/2; 5787 5787 }; 5788 5788 MochiKit.Visual.Transitions.wobble=function(pos){ 5789 return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;5789 return 0.5-Math.cos(9*pos*Math.PI)/2; 5790 5790 }; 5791 5791 MochiKit.Visual.Transitions.pulse=function(pos,_61d){ 5792 if(!_61d){ 5793 return (Math.floor(pos*10)%2===0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10))); 5794 } 5795 return (Math.round((pos%(1/_61d))*_61d)==0?((pos*_61d*2)-Math.floor(pos*_61d*2)):1-((pos*_61d*2)-Math.floor(pos*_61d*2))); 5792 if(_61d){ 5793 pos*=2*_61d; 5794 }else{ 5795 pos*=10; 5796 } 5797 var _61e=pos-Math.floor(pos); 5798 return (Math.floor(pos)%2==0)?_61e:1-_61e; 5796 5799 }; 5797 5800 MochiKit.Visual.Transitions.none=function(pos){ … … 5811 5814 this.effects=[]; 5812 5815 this.interval=null; 5813 },add:function(_62 1){5814 var _62 2=new Date().getTime();5815 var _62 3=(typeof (_621.options.queue)=="string")?_621.options.queue:_621.options.queue.position;5816 },add:function(_622){ 5817 var _623=new Date().getTime(); 5818 var _624=(typeof (_622.options.queue)=="string")?_622.options.queue:_622.options.queue.position; 5816 5819 var ma=MochiKit.Base.map; 5817 switch(_62 3){5820 switch(_624){ 5818 5821 case "front": 5819 5822 ma(function(e){ 5820 5823 if(e.state=="idle"){ 5821 e.startOn+=_62 1.finishOn;5822 e.finishOn+=_62 1.finishOn;5824 e.startOn+=_622.finishOn; 5825 e.finishOn+=_622.finishOn; 5823 5826 } 5824 5827 },this.effects); 5825 5828 break; 5826 5829 case "end": 5827 var _62 6;5830 var _627; 5828 5831 ma(function(e){ 5829 5832 var i=e.finishOn; 5830 if(i>=(_62 6||i)){5831 _62 6=i;5833 if(i>=(_627||i)){ 5834 _627=i; 5832 5835 } 5833 5836 },this.effects); 5834 _62 2=_626||_622;5837 _623=_627||_623; 5835 5838 break; 5836 5839 case "break": … … 5840 5843 break; 5841 5844 } 5842 _62 1.startOn+=_622;5843 _62 1.finishOn+=_622;5844 if(!_62 1.options.queue.limit||this.effects.length<_621.options.queue.limit){5845 this.effects.push(_62 1);5845 _622.startOn+=_623; 5846 _622.finishOn+=_623; 5847 if(!_622.options.queue.limit||this.effects.length<_622.options.queue.limit){ 5848 this.effects.push(_622); 5846 5849 } 5847 5850 if(!this.interval){ 5848 5851 this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40); 5849 5852 } 5850 },startLoop:function(func,_62 b){5851 return setInterval(func,_62 b);5852 },remove:function(_62 c){5853 },startLoop:function(func,_62c){ 5854 return setInterval(func,_62c); 5855 },remove:function(_62d){ 5853 5856 this.effects=MochiKit.Base.filter(function(e){ 5854 return e!=_62 c;5857 return e!=_62d; 5855 5858 },this.effects); 5856 5859 if(!this.effects.length){ … … 5858 5861 this.interval=null; 5859 5862 } 5860 },stopLoop:function(_62 e){5861 clearInterval(_62 e);5863 },stopLoop:function(_62f){ 5864 clearInterval(_62f); 5862 5865 },loop:function(){ 5863 var _6 2f=new Date().getTime();5864 MochiKit.Base.map(function(_63 0){5865 _63 0.loop(_62f);5866 var _630=new Date().getTime(); 5867 MochiKit.Base.map(function(_631){ 5868 _631.loop(_630); 5866 5869 },this.effects); 5867 5870 }}); 5868 MochiKit.Visual.Queues={instances:{},get:function(_63 1){5869 if(typeof (_63 1)!="string"){5870 return _63 1;5871 } 5872 if(!this.instances[_63 1]){5873 this.instances[_63 1]=new MochiKit.Visual.ScopedQueue();5874 } 5875 return this.instances[_63 1];5871 MochiKit.Visual.Queues={instances:{},get:function(_632){ 5872 if(typeof (_632)!="string"){ 5873 return _632; 5874 } 5875 if(!this.instances[_632]){ 5876 this.instances[_632]=new MochiKit.Visual.ScopedQueue(); 5877 } 5878 return this.instances[_632]; 5876 5879 }}; 5877 5880 MochiKit.Visual.Queue=MochiKit.Visual.Queues.get("global"); … … 5879 5882 MochiKit.Visual.Base=function(){ 5880 5883 }; 5881 MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_63 2){5884 MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_633){ 5882 5885 var v=MochiKit.Visual; 5883 this.options=MochiKit.Base.setdefault(_63 2,v.DefaultOptions);5886 this.options=MochiKit.Base.setdefault(_633,v.DefaultOptions); 5884 5887 this.currentFrame=0; 5885 5888 this.state="idle"; … … 5890 5893 v.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).add(this); 5891 5894 } 5892 },loop:function(_63 4){5893 if(_63 4>=this.startOn){5894 if(_63 4>=this.finishOn){5895 },loop:function(_635){ 5896 if(_635>=this.startOn){ 5897 if(_635>=this.finishOn){ 5895 5898 return this.finalize(); 5896 5899 } 5897 var pos=(_63 4-this.startOn)/(this.finishOn-this.startOn);5898 var _63 6=Math.round(pos*this.options.fps*this.options.duration);5899 if(_63 6>this.currentFrame){5900 var pos=(_635-this.startOn)/(this.finishOn-this.startOn); 5901 var _637=Math.round(pos*this.options.fps*this.options.duration); 5902 if(_637>this.currentFrame){ 5900 5903 this.render(pos); 5901 this.currentFrame=_63 6;5904 this.currentFrame=_637; 5902 5905 } 5903 5906 } … … 5932 5935 },setup:function(){ 5933 5936 },finish:function(){ 5934 },update:function(_63 8){5935 },event:function(_63 9){5936 if(this.options[_63 9+"Internal"]){5937 this.options[_63 9+"Internal"](this);5938 } 5939 if(this.options[_63 9]){5940 this.options[_63 9](this);5937 },update:function(_639){ 5938 },event:function(_63a){ 5939 if(this.options[_63a+"Internal"]){ 5940 this.options[_63a+"Internal"](this); 5941 } 5942 if(this.options[_63a]){ 5943 this.options[_63a](this); 5941 5944 } 5942 5945 },repr:function(){ 5943 5946 return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]"; 5944 5947 }}; 5945 MochiKit.Visual.Parallel=function(_63 a,_63b){5948 MochiKit.Visual.Parallel=function(_63b,_63c){ 5946 5949 var cls=arguments.callee; 5947 5950 if(!(this instanceof cls)){ 5948 return new cls(_63 a,_63b);5949 } 5950 this.__init__(_63 a,_63b);5951 return new cls(_63b,_63c); 5952 } 5953 this.__init__(_63b,_63c); 5951 5954 }; 5952 5955 MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base(); 5953 MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_63 d,_63e){5954 this.effects=_63 d||[];5955 this.start(_63 e);5956 },update:function(_6 3f){5957 MochiKit.Base.map(function(_64 0){5958 _64 0.render(_63f);5956 MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_63e,_63f){ 5957 this.effects=_63e||[]; 5958 this.start(_63f); 5959 },update:function(_640){ 5960 MochiKit.Base.map(function(_641){ 5961 _641.render(_640); 5959 5962 },this.effects); 5960 5963 },finish:function(){ 5961 MochiKit.Base.map(function(_64 1){5962 _64 1.finalize();5964 MochiKit.Base.map(function(_642){ 5965 _642.finalize(); 5963 5966 },this.effects); 5964 5967 }}); 5965 MochiKit.Visual.Opacity=function(_64 2,_643){5968 MochiKit.Visual.Opacity=function(_643,_644){ 5966 5969 var cls=arguments.callee; 5967 5970 if(!(this instanceof cls)){ 5968 return new cls(_64 2,_643);5969 } 5970 this.__init__(_64 2,_643);5971 return new cls(_643,_644); 5972 } 5973 this.__init__(_643,_644); 5971 5974 }; 5972 5975 MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base(); 5973 MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_64 5,_646){5976 MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_646,_647){ 5974 5977 var b=MochiKit.Base; 5975 5978 var s=MochiKit.Style; 5976 this.element=MochiKit.DOM.getElement(_64 5);5979 this.element=MochiKit.DOM.getElement(_646); 5977 5980 if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){ 5978 5981 s.setStyle(this.element,{zoom:1}); 5979 5982 } 5980 _64 6=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_646);5981 this.start(_64 6);5982 },update:function(_64 9){5983 MochiKit.Style.setStyle(this.element,{"opacity":_64 9});5983 _647=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_647); 5984 this.start(_647); 5985 },update:function(_64a){ 5986 MochiKit.Style.setStyle(this.element,{"opacity":_64a}); 5984 5987 }}); 5985 MochiKit.Visual.Move=function(_64 a,_64b){5988 MochiKit.Visual.Move=function(_64b,_64c){ 5986 5989 var cls=arguments.callee; 5987 5990 if(!(this instanceof cls)){ 5988 return new cls(_64 a,_64b);5989 } 5990 this.__init__(_64 a,_64b);5991 return new cls(_64b,_64c); 5992 } 5993 this.__init__(_64b,_64c); 5991 5994 }; 5992 5995 MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base(); 5993 MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_64 d,_64e){5994 this.element=MochiKit.DOM.getElement(_64 d);5995 _64 e=MochiKit.Base.update({x:0,y:0,mode:"relative"},_64e);5996 this.start(_64 e);5996 MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_64e,_64f){ 5997 this.element=MochiKit.DOM.getElement(_64e); 5998 _64f=MochiKit.Base.update({x:0,y:0,mode:"relative"},_64f); 5999 this.start(_64f); 5997 6000 },setup:function(){ 5998 6001 MochiKit.DOM.makePositioned(this.element); 5999 6002 var s=this.element.style; 6000 var _65 0=s.visibility;6001 var _65 1=s.display;6002 if(_65 1=="none"){6003 var _651=s.visibility; 6004 var _652=s.display; 6005 if(_652=="none"){ 6003 6006 s.visibility="hidden"; 6004 6007 s.display=""; … … 6010 6013 this.options.y-=this.originalTop; 6011 6014 } 6012 if(_65 1=="none"){6013 s.visibility=_65 0;6014 s.display=_65 1;6015 } 6016 },update:function(_65 2){6017 MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_65 2+this.originalLeft)+"px",top:Math.round(this.options.y*_652+this.originalTop)+"px"});6015 if(_652=="none"){ 6016 s.visibility=_651; 6017 s.display=_652; 6018 } 6019 },update:function(_653){ 6020 MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_653+this.originalLeft)+"px",top:Math.round(this.options.y*_653+this.originalTop)+"px"}); 6018 6021 }}); 6019 MochiKit.Visual.Scale=function(_65 3,_654,_655){6022 MochiKit.Visual.Scale=function(_654,_655,_656){ 6020 6023 var cls=arguments.callee; 6021 6024 if(!(this instanceof cls)){ 6022 return new cls(_65 3,_654,_655);6023 } 6024 this.__init__(_65 3,_654,_655);6025 return new cls(_654,_655,_656); 6026 } 6027 this.__init__(_654,_655,_656); 6025 6028 }; 6026 6029 MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base(); 6027 MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_65 7,_658,_659){6028 this.element=MochiKit.DOM.getElement(_65 7);6029 _65 9=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_658},_659);6030 this.start(_65 9);6030 MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_658,_659,_65a){ 6031 this.element=MochiKit.DOM.getElement(_658); 6032 _65a=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_659},_65a); 6033 this.start(_65a); 6031 6034 },setup:function(){ 6032 6035 this.restoreAfterFinish=this.options.restoreAfterFinish||false; … … 6040 6043 this.originalTop=this.element.offsetTop; 6041 6044 this.originalLeft=this.element.offsetLeft; 6042 var _65 d=MochiKit.Style.getStyle(this.element,"font-size")||"100%";6043 ma(b(function(_65 e){6044 if(_65 d.indexOf(_65e)>0){6045 this.fontSize=parseFloat(_65 d);6046 this.fontSizeType=_65 e;6045 var _65e=MochiKit.Style.getStyle(this.element,"font-size")||"100%"; 6046 ma(b(function(_65f){ 6047 if(_65e.indexOf(_65f)>0){ 6048 this.fontSize=parseFloat(_65e); 6049 this.fontSizeType=_65f; 6047 6050 } 6048 6051 },this),["em","px","%"]); … … 6057 6060 } 6058 6061 } 6059 },update:function(_6 5f){6060 var _66 0=(this.options.scaleFrom/100)+(this.factor*_65f);6062 },update:function(_660){ 6063 var _661=(this.options.scaleFrom/100)+(this.factor*_660); 6061 6064 if(this.options.scaleContent&&this.fontSize){ 6062 MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_66 0+this.fontSizeType});6063 } 6064 this.setDimensions(this.dims[0]*_66 0,this.dims[1]*_660);6065 MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_661+this.fontSizeType}); 6066 } 6067 this.setDimensions(this.dims[0]*_661,this.dims[1]*_661); 6065 6068 },finish:function(){ 6066 6069 if(this.restoreAfterFinish){ 6067 6070 MochiKit.Style.setStyle(this.element,this.originalStyle); 6068 6071 } 6069 },setDimensions:function(_66 1,_662){6072 },setDimensions:function(_662,_663){ 6070 6073 var d={}; 6071 6074 var r=Math.round; … … 6074 6077 } 6075 6078 if(this.options.scaleX){ 6076 d.width=r(_66 2)+"px";6079 d.width=r(_663)+"px"; 6077 6080 } 6078 6081 if(this.options.scaleY){ 6079 d.height=r(_66 1)+"px";6082 d.height=r(_662)+"px"; 6080 6083 } 6081 6084 if(this.options.scaleFromCenter){ 6082 var topd=(_66 1-this.dims[0])/2;6083 var _66 6=(_662-this.dims[1])/2;6085 var topd=(_662-this.dims[0])/2; 6086 var _667=(_663-this.dims[1])/2; 6084 6087 if(this.elementPositioning=="absolute"){ 6085 6088 if(this.options.scaleY){ … … 6087 6090 } 6088 6091 if(this.options.scaleX){ 6089 d.left=this.originalLeft-_66 6+"px";6092 d.left=this.originalLeft-_667+"px"; 6090 6093 } 6091 6094 }else{ … … 6094 6097 } 6095 6098 if(this.options.scaleX){ 6096 d.left=-_66 6+"px";6099 d.left=-_667+"px"; 6097 6100 } 6098 6101 } … … 6100 6103 MochiKit.Style.setStyle(this.element,d); 6101 6104 }}); 6102 MochiKit.Visual.Highlight=function(_66 7,_668){6105 MochiKit.Visual.Highlight=function(_668,_669){ 6103 6106 var cls=arguments.callee; 6104 6107 if(!(this instanceof cls)){ 6105 return new cls(_66 7,_668);6106 } 6107 this.__init__(_66 7,_668);6108 return new cls(_668,_669); 6109 } 6110 this.__init__(_668,_669); 6108 6111 }; 6109 6112 MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base(); 6110 MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_66 a,_66b){6111 this.element=MochiKit.DOM.getElement(_66 a);6112 _66 b=MochiKit.Base.update({startcolor:"#ffff99"},_66b);6113 this.start(_66 b);6113 MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_66b,_66c){ 6114 this.element=MochiKit.DOM.getElement(_66b); 6115 _66c=MochiKit.Base.update({startcolor:"#ffff99"},_66c); 6116 this.start(_66c); 6114 6117 },setup:function(){ 6115 6118 var b=MochiKit.Base; … … 6133 6136 return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]; 6134 6137 },this),[0,1,2]); 6135 },update:function(_67 0){6138 },update:function(_671){ 6136 6139 var m="#"; 6137 6140 MochiKit.Base.map(MochiKit.Base.bind(function(i){ 6138 m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_67 0));6141 m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_671)); 6139 6142 },this),[0,1,2]); 6140 6143 MochiKit.Style.setStyle(this.element,{backgroundColor:m}); … … 6142 6145 MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor})); 6143 6146 }}); 6144 MochiKit.Visual.ScrollTo=function(_67 3,_674){6147 MochiKit.Visual.ScrollTo=function(_674,_675){ 6145 6148 var cls=arguments.callee; 6146 6149 if(!(this instanceof cls)){ 6147 return new cls(_67 3,_674);6148 } 6149 this.__init__(_67 3,_674);6150 return new cls(_674,_675); 6151 } 6152 this.__init__(_674,_675); 6150 6153 }; 6151 6154 MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base(); 6152 MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_67 6,_677){6153 this.element=MochiKit.DOM.getElement(_67 6);6154 this.start(_67 7);6155 MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_677,_678){ 6156 this.element=MochiKit.DOM.getElement(_677); 6157 this.start(_678); 6155 6158 },setup:function(){ 6156 6159 var p=MochiKit.Position; 6157 6160 p.prepare(); 6158 var _67 9=p.cumulativeOffset(this.element);6161 var _67a=p.cumulativeOffset(this.element); 6159 6162 if(this.options.offset){ 6160 _67 9.y+=this.options.offset;6163 _67a.y+=this.options.offset; 6161 6164 } 6162 6165 var max; … … 6173 6176 } 6174 6177 this.scrollStart=p.windowOffset.y; 6175 this.delta=(_67 9.y>max?max:_679.y)-this.scrollStart;6176 },update:function(_67 b){6178 this.delta=(_67a.y>max?max:_67a.y)-this.scrollStart; 6179 },update:function(_67c){ 6177 6180 var p=MochiKit.Position; 6178 6181 p.prepare(); 6179 window.scrollTo(p.windowOffset.x,this.scrollStart+(_67 b*this.delta));6182 window.scrollTo(p.windowOffset.x,this.scrollStart+(_67c*this.delta)); 6180 6183 }}); 6181 6184 MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; 6182 MochiKit.Visual.Morph=function(_67 d,_67e){6185 MochiKit.Visual.Morph=function(_67e,_67f){ 6183 6186 var cls=arguments.callee; 6184 6187 if(!(this instanceof cls)){ 6185 return new cls(_67 d,_67e);6186 } 6187 this.__init__(_67 d,_67e);6188 return new cls(_67e,_67f); 6189 } 6190 this.__init__(_67e,_67f); 6188 6191 }; 6189 6192 MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base(); 6190 MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_68 0,_681){6191 this.element=MochiKit.DOM.getElement(_68 0);6192 this.start(_68 1);6193 MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_681,_682){ 6194 this.element=MochiKit.DOM.getElement(_681); 6195 this.start(_682); 6193 6196 },setup:function(){ 6194 6197 var b=MochiKit.Base; 6195 var _68 3=this.options.style;6198 var _684=this.options.style; 6196 6199 this.styleStart={}; 6197 6200 this.styleEnd={}; 6198 6201 this.units={}; 6199 var _68 4,unit;6200 for(var s in _68 3){6201 _68 4=_683[s];6202 var _685,unit; 6203 for(var s in _684){ 6204 _685=_684[s]; 6202 6205 s=b.camelize(s); 6203 if(MochiKit.Visual.CSS_LENGTH.test(_68 4)){6204 var _68 7=_684.match(/^([\+\-]?[0-9\.]+)(.*)$/);6205 _68 4=parseFloat(_687[1]);6206 unit=(_68 7.length==3)?_687[2]:null;6207 this.styleEnd[s]=_68 4;6206 if(MochiKit.Visual.CSS_LENGTH.test(_685)){ 6207 var _688=_685.match(/^([\+\-]?[0-9\.]+)(.*)$/); 6208 _685=parseFloat(_688[1]); 6209 unit=(_688.length==3)?_688[2]:null; 6210 this.styleEnd[s]=_685; 6208 6211 this.units[s]=unit; 6209 _68 4=MochiKit.Style.getStyle(this.element,s);6210 _68 7=_684.match(/^([\+\-]?[0-9\.]+)(.*)$/);6211 _68 4=parseFloat(_687[1]);6212 this.styleStart[s]=_68 4;6212 _685=MochiKit.Style.getStyle(this.element,s); 6213 _688=_685.match(/^([\+\-]?[0-9\.]+)(.*)$/); 6214 _685=parseFloat(_688[1]); 6215 this.styleStart[s]=_685; 6213 6216 }else{ 6214 6217 var c=MochiKit.Color.Color; 6215 _68 4=c.fromString(_684);6216 if(_68 4){6218 _685=c.fromString(_685); 6219 if(_685){ 6217 6220 this.units[s]="color"; 6218 this.styleEnd[s]=_68 4.toHexString();6219 _68 4=MochiKit.Style.getStyle(this.element,s);6220 this.styleStart[s]=c.fromString(_68 4).toHexString();6221 this.styleEnd[s]=_685.toHexString(); 6222 _685=MochiKit.Style.getStyle(this.element,s); 6223 this.styleStart[s]=c.fromString(_685).toHexString(); 6221 6224 this.styleStart[s]=b.map(b.bind(function(i){ 6222 6225 return parseInt(this.styleStart[s].slice(i*2+1,i*2+3),16); … … 6228 6231 } 6229 6232 } 6230 },update:function(_68 b){6231 var _68 c;6233 },update:function(_68c){ 6234 var _68d; 6232 6235 for(var s in this.styleStart){ 6233 6236 if(this.units[s]=="color"){ 6234 6237 var m="#"; 6235 var _6 8f=this.styleStart[s];6238 var _690=this.styleStart[s]; 6236 6239 var end=this.styleEnd[s]; 6237 6240 MochiKit.Base.map(MochiKit.Base.bind(function(i){ 6238 m+=MochiKit.Color.toColorPart(Math.round(_6 8f[i]+(end[i]-_68f[i])*_68b));6241 m+=MochiKit.Color.toColorPart(Math.round(_690[i]+(end[i]-_690[i])*_68c)); 6239 6242 },this),[0,1,2]); 6240 6243 this.element.style[s]=m; 6241 6244 }else{ 6242 _68 c=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_68b*1000)/1000+this.units[s];6243 this.element.style[s]=_68 c;6245 _68d=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_68c*1000)/1000+this.units[s]; 6246 this.element.style[s]=_68d; 6244 6247 } 6245 6248 } 6246 6249 }}); 6247 MochiKit.Visual.fade=function(_69 2,_693){6250 MochiKit.Visual.fade=function(_693,_694){ 6248 6251 var s=MochiKit.Style; 6249 var _69 5=s.getStyle(_692,"opacity");6250 _69 3=MochiKit.Base.update({from:s.getStyle(_692,"opacity")||1,to:0,afterFinishInternal:function(_696){6251 if(_69 6.options.to!==0){6252 var _696=s.getStyle(_693,"opacity"); 6253 _694=MochiKit.Base.update({from:s.getStyle(_693,"opacity")||1,to:0,afterFinishInternal:function(_697){ 6254 if(_697.options.to!==0){ 6252 6255 return; 6253 6256 } 6254 s.hideElement(_69 6.element);6255 s.setStyle(_69 6.element,{"opacity":_695});6256 }},_69 3);6257 return new MochiKit.Visual.Opacity(_69 2,_693);6258 }; 6259 MochiKit.Visual.appear=function(_69 7,_698){6257 s.hideElement(_697.element); 6258 s.setStyle(_697.element,{"opacity":_696}); 6259 }},_694); 6260 return new MochiKit.Visual.Opacity(_693,_694); 6261 }; 6262 MochiKit.Visual.appear=function(_698,_699){ 6260 6263 var s=MochiKit.Style; 6261 6264 var v=MochiKit.Visual; 6262 _69 8=MochiKit.Base.update({from:(s.getStyle(_697,"display")=="none"?0:s.getStyle(_697,"opacity")||0),to:1,afterFinishInternal:function(_69b){6263 v.forceRerendering(_69 b.element);6264 },beforeSetupInternal:function(_69 c){6265 s.setStyle(_69 c.element,{"opacity":_69c.options.from});6266 s.showElement(_69 c.element);6267 }},_69 8);6268 return new v.Opacity(_69 7,_698);6269 }; 6270 MochiKit.Visual.puff=function(_69 d,_69e){6265 _699=MochiKit.Base.update({from:(s.getStyle(_698,"display")=="none"?0:s.getStyle(_698,"opacity")||0),to:1,afterFinishInternal:function(_69c){ 6266 v.forceRerendering(_69c.element); 6267 },beforeSetupInternal:function(_69d){ 6268 s.setStyle(_69d.element,{"opacity":_69d.options.from}); 6269 s.showElement(_69d.element); 6270 }},_699); 6271 return new v.Opacity(_698,_699); 6272 }; 6273 MochiKit.Visual.puff=function(_69e,_69f){ 6271 6274 var s=MochiKit.Style; 6272 6275 var v=MochiKit.Visual; 6273 _69 d=MochiKit.DOM.getElement(_69d);6274 var _6a 1={position:s.getStyle(_69d,"position"),top:_69d.style.top,left:_69d.style.left,width:_69d.style.width,height:_69d.style.height,opacity:s.getStyle(_69d,"opacity")};6275 _69 e=MochiKit.Base.update({beforeSetupInternal:function(_6a2){6276 MochiKit.Position.absolutize(_6a 2.effects[0].element);6277 },afterFinishInternal:function(_6a 3){6278 s.hideElement(_6a 3.effects[0].element);6279 s.setStyle(_6a 3.effects[0].element,_6a1);6280 },scaleContent:true,scaleFromCenter:true},_69 e);6281 return new v.Parallel([new v.Scale(_69 d,200,{sync:true,scaleFromCenter:_69e.scaleFromCenter,scaleContent:_69e.scaleContent,restoreAfterFinish:true}),new v.Opacity(_69d,{sync:true,to:0})],_69e);6282 }; 6283 MochiKit.Visual.blindUp=function(_6a 4,_6a5){6276 _69e=MochiKit.DOM.getElement(_69e); 6277 var _6a2={position:s.getStyle(_69e,"position"),top:_69e.style.top,left:_69e.style.left,width:_69e.style.width,height:_69e.style.height,opacity:s.getStyle(_69e,"opacity")}; 6278 _69f=MochiKit.Base.update({beforeSetupInternal:function(_6a3){ 6279 MochiKit.Position.absolutize(_6a3.effects[0].element); 6280 },afterFinishInternal:function(_6a4){ 6281 s.hideElement(_6a4.effects[0].element); 6282 s.setStyle(_6a4.effects[0].element,_6a2); 6283 },scaleContent:true,scaleFromCenter:true},_69f); 6284 return new v.Parallel([new v.Scale(_69e,200,{sync:true,scaleFromCenter:_69f.scaleFromCenter,scaleContent:_69f.scaleContent,restoreAfterFinish:true}),new v.Opacity(_69e,{sync:true,to:0})],_69f); 6285 }; 6286 MochiKit.Visual.blindUp=function(_6a5,_6a6){ 6284 6287 var d=MochiKit.DOM; 6285 _6a 4=d.getElement(_6a4);6286 var _6a 7=d.makeClipping(_6a4);6287 _6a 5=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_6a8){6288 MochiKit.Style.hideElement(_6a 8.element);6289 d.undoClipping(_6a 8.element,_6a7);6290 }},_6a 5);6291 return new MochiKit.Visual.Scale(_6a 4,0,_6a5);6292 }; 6293 MochiKit.Visual.blindDown=function(_6a 9,_6aa){6288 _6a5=d.getElement(_6a5); 6289 var _6a8=d.makeClipping(_6a5); 6290 _6a6=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_6a9){ 6291 MochiKit.Style.hideElement(_6a9.element); 6292 d.undoClipping(_6a9.element,_6a8); 6293 }},_6a6); 6294 return new MochiKit.Visual.Scale(_6a5,0,_6a6); 6295 }; 6296 MochiKit.Visual.blindDown=function(_6aa,_6ab){ 6294 6297 var d=MochiKit.DOM; 6295 6298 var s=MochiKit.Style; 6296 _6a 9=d.getElement(_6a9);6297 var _6a d=s.getElementDimensions(_6a9);6298 var _6a e;6299 _6a a=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6ad.h,originalWidth:_6ad.w},restoreAfterFinish:true,afterSetupInternal:function(_6af){6300 _6a e=d.makeClipping(_6af.element);6301 s.setStyle(_6 af.element,{height:"0px"});6302 s.showElement(_6 af.element);6303 },afterFinishInternal:function(_6b 0){6304 d.undoClipping(_6b 0.element,_6ae);6305 }},_6a a);6306 return new MochiKit.Visual.Scale(_6a 9,100,_6aa);6307 }; 6308 MochiKit.Visual.switchOff=function(_6b 1,_6b2){6299 _6aa=d.getElement(_6aa); 6300 var _6ae=s.getElementDimensions(_6aa); 6301 var _6af; 6302 _6ab=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6ae.h,originalWidth:_6ae.w},restoreAfterFinish:true,afterSetupInternal:function(_6b0){ 6303 _6af=d.makeClipping(_6b0.element); 6304 s.setStyle(_6b0.element,{height:"0px"}); 6305 s.showElement(_6b0.element); 6306 },afterFinishInternal:function(_6b1){ 6307 d.undoClipping(_6b1.element,_6af); 6308 }},_6ab); 6309 return new MochiKit.Visual.Scale(_6aa,100,_6ab); 6310 }; 6311 MochiKit.Visual.switchOff=function(_6b2,_6b3){ 6309 6312 var d=MochiKit.DOM; 6310 _6b 1=d.getElement(_6b1);6311 var _6b 4=MochiKit.Style.getStyle(_6b1,"opacity");6312 var _6b 5;6313 _6b 2=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_6b6){6314 d.makePositioned(_6b 6.element);6315 _6b 5=d.makeClipping(_6b6.element);6316 },afterFinishInternal:function(_6b 7){6317 MochiKit.Style.hideElement(_6b 7.element);6318 d.undoClipping(_6b 7.element,_6b5);6319 d.undoPositioned(_6b 7.element);6320 MochiKit.Style.setStyle(_6b 7.element,{"opacity":_6b4});6321 }},_6b 2);6313 _6b2=d.getElement(_6b2); 6314 var _6b5=MochiKit.Style.getStyle(_6b2,"opacity"); 6315 var _6b6; 6316 _6b3=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_6b7){ 6317 d.makePositioned(_6b7.element); 6318 _6b6=d.makeClipping(_6b7.element); 6319 },afterFinishInternal:function(_6b8){ 6320 MochiKit.Style.hideElement(_6b8.element); 6321 d.undoClipping(_6b8.element,_6b6); 6322 d.undoPositioned(_6b8.element); 6323 MochiKit.Style.setStyle(_6b8.element,{"opacity":_6b5}); 6324 }},_6b3); 6322 6325 var v=MochiKit.Visual; 6323 return new v.appear(_6b 1,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_6b9){6324 new v.Scale(_6b 9.element,1,_6b2);6326 return new v.appear(_6b2,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_6ba){ 6327 new v.Scale(_6ba.element,1,_6b3); 6325 6328 }}); 6326 6329 }; 6327 MochiKit.Visual.dropOut=function(_6b a,_6bb){6330 MochiKit.Visual.dropOut=function(_6bb,_6bc){ 6328 6331 var d=MochiKit.DOM; 6329 6332 var s=MochiKit.Style; 6330 _6b a=d.getElement(_6ba);6331 var _6b e={top:s.getStyle(_6ba,"top"),left:s.getStyle(_6ba,"left"),opacity:s.getStyle(_6ba,"opacity")};6332 _6b b=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6bf){6333 d.makePositioned(_6 bf.effects[0].element);6334 },afterFinishInternal:function(_6c 0){6335 s.hideElement(_6c 0.effects[0].element);6336 d.undoPositioned(_6c 0.effects[0].element);6337 s.setStyle(_6c 0.effects[0].element,_6be);6338 }},_6b b);6333 _6bb=d.getElement(_6bb); 6334 var _6bf={top:s.getStyle(_6bb,"top"),left:s.getStyle(_6bb,"left"),opacity:s.getStyle(_6bb,"opacity")}; 6335 _6bc=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6c0){ 6336 d.makePositioned(_6c0.effects[0].element); 6337 },afterFinishInternal:function(_6c1){ 6338 s.hideElement(_6c1.effects[0].element); 6339 d.undoPositioned(_6c1.effects[0].element); 6340 s.setStyle(_6c1.effects[0].element,_6bf); 6341 }},_6bc); 6339 6342 var v=MochiKit.Visual; 6340 return new v.Parallel([new v.Move(_6b a,{x:0,y:_6bb.distance,sync:true}),new v.Opacity(_6ba,{sync:true,to:0})],_6bb);6341 }; 6342 MochiKit.Visual.shake=function(_6c 2,_6c3){6343 return new v.Parallel([new v.Move(_6bb,{x:0,y:_6bc.distance,sync:true}),new v.Opacity(_6bb,{sync:true,to:0})],_6bc); 6344 }; 6345 MochiKit.Visual.shake=function(_6c3,_6c4){ 6343 6346 var d=MochiKit.DOM; 6344 6347 var v=MochiKit.Visual; 6345 6348 var s=MochiKit.Style; 6346 _6c 2=d.getElement(_6c2);6347 var _6c 7={top:s.getStyle(_6c2,"top"),left:s.getStyle(_6c2,"left")};6348 _6c 3=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6c8){6349 d.undoPositioned(_6c 8.element);6350 s.setStyle(_6c 8.element,_6c7);6351 }},_6c 3);6352 return new v.Move(_6c 2,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6c9){6353 new v.Move(_6c 9.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6ca){6354 new v.Move(_6c a.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6cb){6355 new v.Move(_6c b.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6cc){6356 new v.Move(_6c c.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6cd){6357 new v.Move(_6c d.element,_6c3);6349 _6c3=d.getElement(_6c3); 6350 var _6c8={top:s.getStyle(_6c3,"top"),left:s.getStyle(_6c3,"left")}; 6351 _6c4=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6c9){ 6352 d.undoPositioned(_6c9.element); 6353 s.setStyle(_6c9.element,_6c8); 6354 }},_6c4); 6355 return new v.Move(_6c3,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6ca){ 6356 new v.Move(_6ca.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6cb){ 6357 new v.Move(_6cb.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6cc){ 6358 new v.Move(_6cc.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6cd){ 6359 new v.Move(_6cd.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6ce){ 6360 new v.Move(_6ce.element,_6c4); 6358 6361 }}); 6359 6362 }}); … … 6362 6365 }}); 6363 6366 }; 6364 MochiKit.Visual.slideDown=function(_6c e,_6cf){6367 MochiKit.Visual.slideDown=function(_6cf,_6d0){ 6365 6368 var d=MochiKit.DOM; 6366 6369 var b=MochiKit.Base; 6367 6370 var s=MochiKit.Style; 6368 _6c e=d.getElement(_6ce);6369 if(!_6c e.firstChild){6371 _6cf=d.getElement(_6cf); 6372 if(!_6cf.firstChild){ 6370 6373 throw "MochiKit.Visual.slideDown must be used on a element with a child"; 6371 6374 } 6372 d.removeEmptyTextNodes(_6c e);6373 var _6d 3=s.getStyle(_6ce.firstChild,"bottom")||0;6374 var _6d 4=s.getElementDimensions(_6ce);6375 var _6d 5;6376 _6 cf=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6d4.h,originalWidth:_6d4.w},restoreAfterFinish:true,afterSetupInternal:function(_6d6){6377 d.makePositioned(_6d 6.element);6378 d.makePositioned(_6d 6.element.firstChild);6375 d.removeEmptyTextNodes(_6cf); 6376 var _6d4=s.getStyle(_6cf.firstChild,"bottom")||0; 6377 var _6d5=s.getElementDimensions(_6cf); 6378 var _6d6; 6379 _6d0=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6d5.h,originalWidth:_6d5.w},restoreAfterFinish:true,afterSetupInternal:function(_6d7){ 6380 d.makePositioned(_6d7.element); 6381 d.makePositioned(_6d7.element.firstChild); 6379 6382 if(/Opera/.test(navigator.userAgent)){ 6380 s.setStyle(_6d 6.element,{top:""});6381 } 6382 _6d 5=d.makeClipping(_6d6.element);6383 s.setStyle(_6d 6.element,{height:"0px"});6384 s.showElement(_6d 6.element);6385 },afterUpdateInternal:function(_6d 7){6386 s.setStyle(_6d 7.element.firstChild,{bottom:(_6d7.dims[0]-_6d7.element.clientHeight)+"px"});6387 },afterFinishInternal:function(_6d 8){6388 d.undoClipping(_6d 8.element,_6d5);6383 s.setStyle(_6d7.element,{top:""}); 6384 } 6385 _6d6=d.makeClipping(_6d7.element); 6386 s.setStyle(_6d7.element,{height:"0px"}); 6387 s.showElement(_6d7.element); 6388 },afterUpdateInternal:function(_6d8){ 6389 s.setStyle(_6d8.element.firstChild,{bottom:(_6d8.dims[0]-_6d8.element.clientHeight)+"px"}); 6390 },afterFinishInternal:function(_6d9){ 6391 d.undoClipping(_6d9.element,_6d6); 6389 6392 if(/MSIE/.test(navigator.userAgent)){ 6390 d.undoPositioned(_6d 8.element);6391 d.undoPositioned(_6d 8.element.firstChild);6392 }else{ 6393 d.undoPositioned(_6d 8.element.firstChild);6394 d.undoPositioned(_6d 8.element);6395 } 6396 s.setStyle(_6d 8.element.firstChild,{bottom:_6d3});6397 }},_6 cf);6398 return new MochiKit.Visual.Scale(_6c e,100,_6cf);6399 }; 6400 MochiKit.Visual.slideUp=function(_6d 9,_6da){6393 d.undoPositioned(_6d9.element); 6394 d.undoPositioned(_6d9.element.firstChild); 6395 }else{ 6396 d.undoPositioned(_6d9.element.firstChild); 6397 d.undoPositioned(_6d9.element); 6398 } 6399 s.setStyle(_6d9.element.firstChild,{bottom:_6d4}); 6400 }},_6d0); 6401 return new MochiKit.Visual.Scale(_6cf,100,_6d0); 6402 }; 6403 MochiKit.Visual.slideUp=function(_6da,_6db){ 6401 6404 var d=MochiKit.DOM; 6402 6405 var b=MochiKit.Base; 6403 6406 var s=MochiKit.Style; 6404 _6d 9=d.getElement(_6d9);6405 if(!_6d 9.firstChild){6407 _6da=d.getElement(_6da); 6408 if(!_6da.firstChild){ 6406 6409 throw "MochiKit.Visual.slideUp must be used on a element with a child"; 6407 6410 } 6408 d.removeEmptyTextNodes(_6d 9);6409 var _6d e=s.getStyle(_6d9.firstChild,"bottom");6410 var _6 df;6411 _6d a=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6e0){6412 d.makePositioned(_6e 0.element);6413 d.makePositioned(_6e 0.element.firstChild);6411 d.removeEmptyTextNodes(_6da); 6412 var _6df=s.getStyle(_6da.firstChild,"bottom"); 6413 var _6e0; 6414 _6db=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6e1){ 6415 d.makePositioned(_6e1.element); 6416 d.makePositioned(_6e1.element.firstChild); 6414 6417 if(/Opera/.test(navigator.userAgent)){ 6415 s.setStyle(_6e 0.element,{top:""});6416 } 6417 _6 df=d.makeClipping(_6e0.element);6418 s.showElement(_6e 0.element);6419 },afterUpdateInternal:function(_6e 1){6420 s.setStyle(_6e 1.element.firstChild,{bottom:(_6e1.dims[0]-_6e1.element.clientHeight)+"px"});6421 },afterFinishInternal:function(_6e 2){6422 s.hideElement(_6e 2.element);6423 d.undoClipping(_6e 2.element,_6df);6424 d.undoPositioned(_6e 2.element.firstChild);6425 d.undoPositioned(_6e 2.element);6426 s.setStyle(_6e 2.element.firstChild,{bottom:_6de});6427 }},_6d a);6428 return new MochiKit.Visual.Scale(_6d 9,0,_6da);6429 }; 6430 MochiKit.Visual.squish=function(_6e 3,_6e4){6418 s.setStyle(_6e1.element,{top:""}); 6419 } 6420 _6e0=d.makeClipping(_6e1.element); 6421 s.showElement(_6e1.element); 6422 },afterUpdateInternal:function(_6e2){ 6423 s.setStyle(_6e2.element.firstChild,{bottom:(_6e2.dims[0]-_6e2.element.clientHeight)+"px"}); 6424 },afterFinishInternal:function(_6e3){ 6425 s.hideElement(_6e3.element); 6426 d.undoClipping(_6e3.element,_6e0); 6427 d.undoPositioned(_6e3.element.firstChild); 6428 d.undoPositioned(_6e3.element); 6429 s.setStyle(_6e3.element.firstChild,{bottom:_6df}); 6430 }},_6db); 6431 return new MochiKit.Visual.Scale(_6da,0,_6db); 6432 }; 6433 MochiKit.Visual.squish=function(_6e4,_6e5){ 6431 6434 var d=MochiKit.DOM; 6432 6435 var b=MochiKit.Base; 6433 var _6e 7;6434 _6e 4=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6e8){6435 _6e 7=d.makeClipping(_6e8.element);6436 },afterFinishInternal:function(_6e 9){6437 MochiKit.Style.hideElement(_6e 9.element);6438 d.undoClipping(_6e 9.element,_6e7);6439 }},_6e 4);6440 return new MochiKit.Visual.Scale(_6e 3,/Opera/.test(navigator.userAgent)?1:0,_6e4);6441 }; 6442 MochiKit.Visual.grow=function(_6e a,_6eb){6436 var _6e8; 6437 _6e5=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6e9){ 6438 _6e8=d.makeClipping(_6e9.element); 6439 },afterFinishInternal:function(_6ea){ 6440 MochiKit.Style.hideElement(_6ea.element); 6441 d.undoClipping(_6ea.element,_6e8); 6442 }},_6e5); 6443 return new MochiKit.Visual.Scale(_6e4,/Opera/.test(navigator.userAgent)?1:0,_6e5); 6444 }; 6445 MochiKit.Visual.grow=function(_6eb,_6ec){ 6443 6446 var d=MochiKit.DOM; 6444 6447 var v=MochiKit.Visual; 6445 6448 var s=MochiKit.Style; 6446 _6e a=d.getElement(_6ea);6447 _6e b=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6eb);6448 var _6 ef={top:_6ea.style.top,left:_6ea.style.left,height:_6ea.style.height,width:_6ea.style.width,opacity:s.getStyle(_6ea,"opacity")};6449 var dims=s.getElementDimensions(_6e a);6450 var _6f 1,_6f2;6451 var _6f 3,_6f4;6452 switch(_6e b.direction){6449 _6eb=d.getElement(_6eb); 6450 _6ec=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6ec); 6451 var _6f0={top:_6eb.style.top,left:_6eb.style.left,height:_6eb.style.height,width:_6eb.style.width,opacity:s.getStyle(_6eb,"opacity")}; 6452 var dims=s.getElementDimensions(_6eb); 6453 var _6f2,_6f3; 6454 var _6f4,_6f5; 6455 switch(_6ec.direction){ 6453 6456 case "top-left": 6454 _6f 1=_6f2=_6f3=_6f4=0;6457 _6f2=_6f3=_6f4=_6f5=0; 6455 6458 break; 6456 6459 case "top-right": 6457 _6f 1=dims.w;6458 _6f 2=_6f4=0;6459 _6f 3=-dims.w;6460 _6f2=dims.w; 6461 _6f3=_6f5=0; 6462 _6f4=-dims.w; 6460 6463 break; 6461 6464 case "bottom-left": 6462 _6f 1=_6f3=0;6463 _6f 2=dims.h;6464 _6f 4=-dims.h;6465 _6f2=_6f4=0; 6466 _6f3=dims.h; 6467 _6f5=-dims.h; 6465 6468 break; 6466 6469 case "bottom-right": 6467 _6f 1=dims.w;6468 _6f 2=dims.h;6469 _6f 3=-dims.w;6470 _6f 4=-dims.h;6470 _6f2=dims.w; 6471 _6f3=dims.h; 6472 _6f4=-dims.w; 6473 _6f5=-dims.h; 6471 6474 break; 6472 6475 case "center": 6473 _6f 1=dims.w/2;6474 _6f 2=dims.h/2;6475 _6f 3=-dims.w/2;6476 _6f 4=-dims.h/2;6476 _6f2=dims.w/2; 6477 _6f3=dims.h/2; 6478 _6f4=-dims.w/2; 6479 _6f5=-dims.h/2; 6477 6480 break; 6478 6481 } 6479 var _6f 5=MochiKit.Base.update({beforeSetupInternal:function(_6f6){6480 s.setStyle(_6f 6.effects[0].element,{height:"0px"});6481 s.showElement(_6f 6.effects[0].element);6482 },afterFinishInternal:function(_6f 7){6483 d.undoClipping(_6f 7.effects[0].element);6484 d.undoPositioned(_6f 7.effects[0].element);6485 s.setStyle(_6f 7.effects[0].element,_6ef);6486 }},_6e b);6487 return new v.Move(_6e a,{x:_6f1,y:_6f2,duration:0.01,beforeSetupInternal:function(_6f8){6488 s.hideElement(_6f 8.element);6489 d.makeClipping(_6f 8.element);6490 d.makePositioned(_6f 8.element);6491 },afterFinishInternal:function(_6f 9){6492 new v.Parallel([new v.Opacity(_6f 9.element,{sync:true,to:1,from:0,transition:_6eb.opacityTransition}),new v.Move(_6f9.element,{x:_6f3,y:_6f4,sync:true,transition:_6eb.moveTransition}),new v.Scale(_6f9.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6eb.scaleTransition,scaleContent:_6eb.scaleContent,scaleFromCenter:_6eb.scaleFromCenter,restoreAfterFinish:true})],_6f5);6482 var _6f6=MochiKit.Base.update({beforeSetupInternal:function(_6f7){ 6483 s.setStyle(_6f7.effects[0].element,{height:"0px"}); 6484 s.showElement(_6f7.effects[0].element); 6485 },afterFinishInternal:function(_6f8){ 6486 d.undoClipping(_6f8.effects[0].element); 6487 d.undoPositioned(_6f8.effects[0].element); 6488 s.setStyle(_6f8.effects[0].element,_6f0); 6489 }},_6ec); 6490 return new v.Move(_6eb,{x:_6f2,y:_6f3,duration:0.01,beforeSetupInternal:function(_6f9){ 6491 s.hideElement(_6f9.element); 6492 d.makeClipping(_6f9.element); 6493 d.makePositioned(_6f9.element); 6494 },afterFinishInternal:function(_6fa){ 6495 new v.Parallel([new v.Opacity(_6fa.element,{sync:true,to:1,from:0,transition:_6ec.opacityTransition}),new v.Move(_6fa.element,{x:_6f4,y:_6f5,sync:true,transition:_6ec.moveTransition}),new v.Scale(_6fa.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6ec.scaleTransition,scaleContent:_6ec.scaleContent,scaleFromCenter:_6ec.scaleFromCenter,restoreAfterFinish:true})],_6f6); 6493 6496 }}); 6494 6497 }; 6495 MochiKit.Visual.shrink=function(_6f a,_6fb){6498 MochiKit.Visual.shrink=function(_6fb,_6fc){ 6496 6499 var d=MochiKit.DOM; 6497 6500 var v=MochiKit.Visual; 6498 6501 var s=MochiKit.Style; 6499 _6f a=d.getElement(_6fa);6500 _6f b=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_6fb);6501 var _ 6ff={top:_6fa.style.top,left:_6fa.style.left,height:_6fa.style.height,width:_6fa.style.width,opacity:s.getStyle(_6fa,"opacity")};6502 var dims=s.getElementDimensions(_6f a);6503 var _70 1,_702;6504 switch(_6f b.direction){6502 _6fb=d.getElement(_6fb); 6503 _6fc=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_6fc); 6504 var _700={top:_6fb.style.top,left:_6fb.style.left,height:_6fb.style.height,width:_6fb.style.width,opacity:s.getStyle(_6fb,"opacity")}; 6505 var dims=s.getElementDimensions(_6fb); 6506 var _702,_703; 6507 switch(_6fc.direction){ 6505 6508 case "top-left": 6506 _70 1=_702=0;6509 _702=_703=0; 6507 6510 break; 6508 6511 case "top-right": 6509 _70 1=dims.w;6510 _70 2=0;6512 _702=dims.w; 6513 _703=0; 6511 6514 break; 6512 6515 case "bottom-left": 6513 _70 1=0;6514 _70 2=dims.h;6516 _702=0; 6517 _703=dims.h; 6515 6518 break; 6516 6519 case "bottom-right": 6517 _70 1=dims.w;6518 _70 2=dims.h;6520 _702=dims.w; 6521 _703=dims.h; 6519 6522 break; 6520 6523 case "center": 6521
