Changeset 1374
- Timestamp:
- 05/18/08 11:54:55 (5 months ago)
- Files:
-
- mochikit/trunk/MochiKit/Visual.js (modified) (4 diffs)
- mochikit/trunk/doc/html/MochiKit/Visual.html (modified) (3 diffs)
- mochikit/trunk/doc/rst/MochiKit/Visual.rst (modified) (2 diffs)
- mochikit/trunk/packed/MochiKit/MochiKit.js (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mochikit/trunk/MochiKit/Visual.js
r1360 r1374 727 727 }; 728 728 729 /** @id MochiKit.Visual.Parallel */729 /** @id MochiKit.Visual.Parallel */ 730 730 MochiKit.Visual.Parallel = function (effects, options) { 731 731 var cls = arguments.callee; … … 761 761 762 762 /** @id MochiKit.Visual.Parallel.prototype.finish */ 763 finish: function () { 764 MochiKit.Base.map(function (effect) { 765 effect.finalize(); 766 }, this.effects); 767 } 768 }); 769 770 /** @id MochiKit.Visual.Sequence */ 771 MochiKit.Visual.Sequence = function (effects, options) { 772 var cls = arguments.callee; 773 if (!(this instanceof cls)) { 774 return new cls(effects, options); 775 } 776 this.__init__(effects, options); 777 }; 778 779 MochiKit.Visual.Sequence.prototype = new MochiKit.Visual.Base(); 780 781 MochiKit.Base.update(MochiKit.Visual.Sequence.prototype, { 782 783 __class__ : MochiKit.Visual.Sequence, 784 785 __init__: function (effects, options) { 786 var defs = { transition: MochiKit.Visual.Transitions.linear, 787 duration: 0 }; 788 this.effects = effects || []; 789 MochiKit.Base.map(function (effect) { 790 defs.duration += effect.options.duration; 791 }, this.effects); 792 MochiKit.Base.setdefault(options, defs); 793 this.start(options); 794 }, 795 796 /** @id MochiKit.Visual.Sequence.prototype.update */ 797 update: function (position) { 798 var time = position * this.options.duration; 799 for (var i = 0; i < this.effects.length; i++) { 800 var effect = this.effects[i]; 801 if (time <= effect.options.duration) { 802 effect.render(time / effect.options.duration); 803 break; 804 } else { 805 time -= effect.options.duration; 806 } 807 } 808 }, 809 810 /** @id MochiKit.Visual.Sequence.prototype.finish */ 763 811 finish: function () { 764 812 MochiKit.Base.map(function (effect) { … … 1410 1458 var elemClip; 1411 1459 options = MochiKit.Base.update({ 1412 duration: 0.3, 1413 scaleFromCenter: true, 1414 scaleX: false, 1415 scaleContent: false, 1460 duration: 0.7, 1416 1461 restoreAfterFinish: true, 1417 1462 beforeSetupInternal: function (effect) { 1418 d.makePositioned(e ffect.element);1419 elemClip = d.makeClipping(e ffect.element);1463 d.makePositioned(element); 1464 elemClip = d.makeClipping(element); 1420 1465 }, 1421 1466 afterFinishInternal: function (effect) { 1422 MochiKit.Style.hideElement(e ffect.element);1423 d.undoClipping(e ffect.element, elemClip);1424 d.undoPositioned(e ffect.element);1425 MochiKit.Style.setStyle(e ffect.element, {'opacity': oldOpacity});1467 MochiKit.Style.hideElement(element); 1468 d.undoClipping(element, elemClip); 1469 d.undoPositioned(element); 1470 MochiKit.Style.setStyle(element, {'opacity': oldOpacity}); 1426 1471 } 1427 1472 }, options); 1428 1473 var v = MochiKit.Visual; 1429 return new v.appear(element, { 1430 duration: 0.4, 1431 from: 0, 1432 transition: v.Transitions.flicker, 1433 afterFinishInternal: function (effect) { 1434 new v.Scale(effect.element, 1, options); 1435 } 1436 }); 1474 return new v.Sequence( 1475 [new v.appear(element, 1476 { sync: true, duration: 0.57 * options.duration, 1477 from: 0, transition: v.Transitions.flicker }), 1478 new v.Scale(element, 1, 1479 { sync: true, duration: 0.43 * options.duration, 1480 scaleFromCenter: true, scaleX: false, 1481 scaleContent: false, restoreAfterFinish: true })], 1482 options); 1437 1483 }; 1438 1484 … … 1922 1968 "toggle", 1923 1969 "Parallel", 1970 "Sequence", 1924 1971 "Opacity", 1925 1972 "Move", mochikit/trunk/doc/html/MochiKit/Visual.html
r1360 r1374 782 782 <table border="1" class="docutils"> 783 783 <colgroup> 784 <col width="1 7%" />785 <col width="8 3%" />784 <col width="13%" /> 785 <col width="88%" /> 786 786 </colgroup> 787 787 <tbody valign="top"> … … 796 796 </tr> 797 797 <tr><td>sync</td> 798 <td><tt class="docutils literal"><span class="pre">false</span></tt> (only set for <a class="mochiref reference" href="#fn-parallel">Parallel</a> effects)</td>798 <td><tt class="docutils literal"><span class="pre">false</span></tt> (only set for <a class="mochiref reference" href="#fn-parallel">Parallel</a> or <a class="mochiref reference" href="#fn-sequence">Sequence</a> effects)</td> 799 799 </tr> 800 800 <tr><td>from</td> … … 867 867 </blockquote> 868 868 <p> 869 <a name="fn-sequence"></a> 870 <a class="mochidef reference" href="#fn-sequence">Sequence(effects [, options])</a>:</p> 871 <blockquote> 872 <p>Launch a list of <tt class="docutils literal"><span class="pre">effects</span></tt> in sequence, one after the other.</p> 873 <dl class="docutils"> 874 <dt>effects:</dt> 875 <dd>An array of instantiated effect objects. Note that they <em>must</em> 876 all have <tt class="docutils literal"><span class="pre">sync</span></tt> set to <tt class="docutils literal"><span class="pre">true</span></tt>.</dd> 877 <dt>options:</dt> 878 <dd><p class="first">See <a class="mochiref reference" href="#fn-defaultoptions">DefaultOptions</a>. Note that the default value 879 for some options is different and that some of the transition 880 and timing options don't make sense to override.</p> 881 <table border="1" class="last docutils"> 882 <colgroup> 883 <col width="20%" /> 884 <col width="80%" /> 885 </colgroup> 886 <tbody valign="top"> 887 <tr><td>transition</td> 888 <td><tt class="docutils literal"><span class="pre">MochiKit.Visual.Transitions.linear</span></tt></td> 889 </tr> 890 <tr><td>duration</td> 891 <td>Sum of the <tt class="docutils literal"><span class="pre">duration</span></tt> for all <tt class="docutils literal"><span class="pre">effects</span></tt>.</td> 892 </tr> 893 <tr><td>from</td> 894 <td>Only <tt class="docutils literal"><span class="pre">0.0</span></tt> makes sense.</td> 895 </tr> 896 <tr><td>to</td> 897 <td>Only <tt class="docutils literal"><span class="pre">1.0</span></tt> makes sense.</td> 898 </tr> 899 </tbody> 900 </table> 901 </dd> 902 <dt><em>Availability</em>:</dt> 903 <dd>Available in MochiKit 1.4+</dd> 904 </dl> 905 </blockquote> 906 <p> 869 907 <a name="fn-opacity"></a> 870 908 <a class="mochidef reference" href="#fn-opacity">Opacity(element [, options])</a>:</p> mochikit/trunk/doc/rst/MochiKit/Visual.rst
r1360 r1374 617 617 duration ``1.0`` (seconds) 618 618 fps ``25.0`` 619 sync ``false`` (only set for :mochiref:`Parallel` effects)619 sync ``false`` (only set for :mochiref:`Parallel` or :mochiref:`Sequence` effects) 620 620 from ``0.0`` 621 621 to ``1.0`` … … 672 672 options: 673 673 See :mochiref:`DefaultOptions`. 674 675 *Availability*: 676 Available in MochiKit 1.4+ 677 678 679 :mochidef:`Sequence(effects [, options])`: 680 681 Launch a list of ``effects`` in sequence, one after the other. 682 683 effects: 684 An array of instantiated effect objects. Note that they *must* 685 all have ``sync`` set to ``true``. 686 687 options: 688 See :mochiref:`DefaultOptions`. Note that the default value 689 for some options is different and that some of the transition 690 and timing options don't make sense to override. 691 692 =========== ======================================== 693 transition ``MochiKit.Visual.Transitions.linear`` 694 duration Sum of the ``duration`` for all ``effects``. 695 from Only ``0.0`` makes sense. 696 to Only ``1.0`` makes sense. 697 =========== ======================================== 674 698 675 699 *Availability*: mochikit/trunk/packed/MochiKit/MochiKit.js
r1373 r1374 6010 6010 },this.effects); 6011 6011 }}); 6012 MochiKit.Visual. Opacity=function(_645,_646){6012 MochiKit.Visual.Sequence=function(_645,_646){ 6013 6013 var cls=arguments.callee; 6014 6014 if(!(this instanceof cls)){ … … 6017 6017 this.__init__(_645,_646); 6018 6018 }; 6019 MochiKit.Visual.Sequence.prototype=new MochiKit.Visual.Base(); 6020 MochiKit.Base.update(MochiKit.Visual.Sequence.prototype,{__class__:MochiKit.Visual.Sequence,__init__:function(_648,_649){ 6021 var defs={transition:MochiKit.Visual.Transitions.linear,duration:0}; 6022 this.effects=_648||[]; 6023 MochiKit.Base.map(function(_64b){ 6024 defs.duration+=_64b.options.duration; 6025 },this.effects); 6026 MochiKit.Base.setdefault(_649,defs); 6027 this.start(_649); 6028 },update:function(_64c){ 6029 var time=_64c*this.options.duration; 6030 for(var i=0;i<this.effects.length;i++){ 6031 var _64f=this.effects[i]; 6032 if(time<=_64f.options.duration){ 6033 _64f.render(time/_64f.options.duration); 6034 break; 6035 }else{ 6036 time-=_64f.options.duration; 6037 } 6038 } 6039 },finish:function(){ 6040 MochiKit.Base.map(function(_650){ 6041 _650.finalize(); 6042 },this.effects); 6043 }}); 6044 MochiKit.Visual.Opacity=function(_651,_652){ 6045 var cls=arguments.callee; 6046 if(!(this instanceof cls)){ 6047 return new cls(_651,_652); 6048 } 6049 this.__init__(_651,_652); 6050 }; 6019 6051 MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base(); 6020 MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_6 48,_649){6052 MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_654,_655){ 6021 6053 var b=MochiKit.Base; 6022 6054 var s=MochiKit.Style; 6023 this.element=MochiKit.DOM.getElement(_6 48);6055 this.element=MochiKit.DOM.getElement(_654); 6024 6056 if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){ 6025 6057 s.setStyle(this.element,{zoom:1}); 6026 6058 } 6027 _6 49=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_649);6028 this.start(_6 49);6029 },update:function(_6 4c){6030 MochiKit.Style.setStyle(this.element,{"opacity":_6 4c});6059 _655=b.update({from:s.getStyle(this.element,"opacity")||0,to:1},_655); 6060 this.start(_655); 6061 },update:function(_658){ 6062 MochiKit.Style.setStyle(this.element,{"opacity":_658}); 6031 6063 }}); 6032 MochiKit.Visual.Move=function(_6 4d,_64e){6064 MochiKit.Visual.Move=function(_659,_65a){ 6033 6065 var cls=arguments.callee; 6034 6066 if(!(this instanceof cls)){ 6035 return new cls(_6 4d,_64e);6036 } 6037 this.__init__(_6 4d,_64e);6067 return new cls(_659,_65a); 6068 } 6069 this.__init__(_659,_65a); 6038 6070 }; 6039 6071 MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base(); 6040 MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_65 0,_651){6041 this.element=MochiKit.DOM.getElement(_65 0);6042 _65 1=MochiKit.Base.update({x:0,y:0,mode:"relative"},_651);6043 this.start(_65 1);6072 MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_65c,_65d){ 6073 this.element=MochiKit.DOM.getElement(_65c); 6074 _65d=MochiKit.Base.update({x:0,y:0,mode:"relative"},_65d); 6075 this.start(_65d); 6044 6076 },setup:function(){ 6045 6077 MochiKit.DOM.makePositioned(this.element); 6046 6078 var s=this.element.style; 6047 var _65 3=s.visibility;6048 var _6 54=s.display;6049 if(_6 54=="none"){6079 var _65f=s.visibility; 6080 var _660=s.display; 6081 if(_660=="none"){ 6050 6082 s.visibility="hidden"; 6051 6083 s.display=""; … … 6057 6089 this.options.y-=this.originalTop; 6058 6090 } 6059 if(_6 54=="none"){6060 s.visibility=_65 3;6061 s.display=_6 54;6062 } 6063 },update:function(_6 55){6064 MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_6 55+this.originalLeft)+"px",top:Math.round(this.options.y*_655+this.originalTop)+"px"});6091 if(_660=="none"){ 6092 s.visibility=_65f; 6093 s.display=_660; 6094 } 6095 },update:function(_661){ 6096 MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_661+this.originalLeft)+"px",top:Math.round(this.options.y*_661+this.originalTop)+"px"}); 6065 6097 }}); 6066 MochiKit.Visual.Scale=function(_6 56,_657,_658){6098 MochiKit.Visual.Scale=function(_662,_663,_664){ 6067 6099 var cls=arguments.callee; 6068 6100 if(!(this instanceof cls)){ 6069 return new cls(_6 56,_657,_658);6070 } 6071 this.__init__(_6 56,_657,_658);6101 return new cls(_662,_663,_664); 6102 } 6103 this.__init__(_662,_663,_664); 6072 6104 }; 6073 6105 MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base(); 6074 MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_6 5a,_65b,_65c){6075 this.element=MochiKit.DOM.getElement(_6 5a);6076 _6 5c=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_65b},_65c);6077 this.start(_6 5c);6106 MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_666,_667,_668){ 6107 this.element=MochiKit.DOM.getElement(_666); 6108 _668=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_667},_668); 6109 this.start(_668); 6078 6110 },setup:function(){ 6079 6111 this.restoreAfterFinish=this.options.restoreAfterFinish||false; … … 6087 6119 this.originalTop=this.element.offsetTop; 6088 6120 this.originalLeft=this.element.offsetLeft; 6089 var _66 0=MochiKit.Style.getStyle(this.element,"font-size")||"100%";6090 ma(b(function(_66 1){6091 if(_66 0.indexOf(_661)>0){6092 this.fontSize=parseFloat(_66 0);6093 this.fontSizeType=_66 1;6121 var _66c=MochiKit.Style.getStyle(this.element,"font-size")||"100%"; 6122 ma(b(function(_66d){ 6123 if(_66c.indexOf(_66d)>0){ 6124 this.fontSize=parseFloat(_66c); 6125 this.fontSizeType=_66d; 6094 6126 } 6095 6127 },this),["em","px","%"]); … … 6104 6136 } 6105 6137 } 6106 },update:function(_66 2){6107 var _66 3=(this.options.scaleFrom/100)+(this.factor*_662);6138 },update:function(_66e){ 6139 var _66f=(this.options.scaleFrom/100)+(this.factor*_66e); 6108 6140 if(this.options.scaleContent&&this.fontSize){ 6109 MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_66 3+this.fontSizeType});6110 } 6111 this.setDimensions(this.dims[0]*_66 3,this.dims[1]*_663);6141 MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_66f+this.fontSizeType}); 6142 } 6143 this.setDimensions(this.dims[0]*_66f,this.dims[1]*_66f); 6112 6144 },finish:function(){ 6113 6145 if(this.restoreAfterFinish){ 6114 6146 MochiKit.Style.setStyle(this.element,this.originalStyle); 6115 6147 } 6116 },setDimensions:function(_6 64,_665){6148 },setDimensions:function(_670,_671){ 6117 6149 var d={}; 6118 6150 var r=Math.round; … … 6121 6153 } 6122 6154 if(this.options.scaleX){ 6123 d.width=r(_6 65)+"px";6155 d.width=r(_671)+"px"; 6124 6156 } 6125 6157 if(this.options.scaleY){ 6126 d.height=r(_6 64)+"px";6158 d.height=r(_670)+"px"; 6127 6159 } 6128 6160 if(this.options.scaleFromCenter){ 6129 var topd=(_6 64-this.dims[0])/2;6130 var _6 69=(_665-this.dims[1])/2;6161 var topd=(_670-this.dims[0])/2; 6162 var _675=(_671-this.dims[1])/2; 6131 6163 if(this.elementPositioning=="absolute"){ 6132 6164 if(this.options.scaleY){ … … 6134 6166 } 6135 6167 if(this.options.scaleX){ 6136 d.left=this.originalLeft-_6 69+"px";6168 d.left=this.originalLeft-_675+"px"; 6137 6169 } 6138 6170 }else{ … … 6141 6173 } 6142 6174 if(this.options.scaleX){ 6143 d.left=-_6 69+"px";6175 d.left=-_675+"px"; 6144 6176 } 6145 6177 } … … 6147 6179 MochiKit.Style.setStyle(this.element,d); 6148 6180 }}); 6149 MochiKit.Visual.Highlight=function(_6 6a,_66b){6181 MochiKit.Visual.Highlight=function(_676,_677){ 6150 6182 var cls=arguments.callee; 6151 6183 if(!(this instanceof cls)){ 6152 return new cls(_6 6a,_66b);6153 } 6154 this.__init__(_6 6a,_66b);6184 return new cls(_676,_677); 6185 } 6186 this.__init__(_676,_677); 6155 6187 }; 6156 6188 MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base(); 6157 MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_6 6d,_66e){6158 this.element=MochiKit.DOM.getElement(_6 6d);6159 _6 6e=MochiKit.Base.update({startcolor:"#ffff99"},_66e);6160 this.start(_6 6e);6189 MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_679,_67a){ 6190 this.element=MochiKit.DOM.getElement(_679); 6191 _67a=MochiKit.Base.update({startcolor:"#ffff99"},_67a); 6192 this.start(_67a); 6161 6193 },setup:function(){ 6162 6194 var b=MochiKit.Base; … … 6180 6212 return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]; 6181 6213 },this),[0,1,2]); 6182 },update:function(_67 3){6214 },update:function(_67f){ 6183 6215 var m="#"; 6184 6216 MochiKit.Base.map(MochiKit.Base.bind(function(i){ 6185 m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_67 3));6217 m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_67f)); 6186 6218 },this),[0,1,2]); 6187 6219 MochiKit.Style.setStyle(this.element,{backgroundColor:m}); … … 6189 6221 MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor})); 6190 6222 }}); 6191 MochiKit.Visual.ScrollTo=function(_6 76,_677){6223 MochiKit.Visual.ScrollTo=function(_682,_683){ 6192 6224 var cls=arguments.callee; 6193 6225 if(!(this instanceof cls)){ 6194 return new cls(_6 76,_677);6195 } 6196 this.__init__(_6 76,_677);6226 return new cls(_682,_683); 6227 } 6228 this.__init__(_682,_683); 6197 6229 }; 6198 6230 MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base(); 6199 MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_6 79,_67a){6200 this.element=MochiKit.DOM.getElement(_6 79);6201 this.start(_6 7a);6231 MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_685,_686){ 6232 this.element=MochiKit.DOM.getElement(_685); 6233 this.start(_686); 6202 6234 },setup:function(){ 6203 6235 var p=MochiKit.Position; 6204 6236 p.prepare(); 6205 var _6 7c=p.cumulativeOffset(this.element);6237 var _688=p.cumulativeOffset(this.element); 6206 6238 if(this.options.offset){ 6207 _6 7c.y+=this.options.offset;6239 _688.y+=this.options.offset; 6208 6240 } 6209 6241 var max; … … 6220 6252 } 6221 6253 this.scrollStart=p.windowOffset.y; 6222 this.delta=(_6 7c.y>max?max:_67c.y)-this.scrollStart;6223 },update:function(_6 7e){6254 this.delta=(_688.y>max?max:_688.y)-this.scrollStart; 6255 },update:function(_68a){ 6224 6256 var p=MochiKit.Position; 6225 6257 p.prepare(); 6226 window.scrollTo(p.windowOffset.x,this.scrollStart+(_6 7e*this.delta));6258 window.scrollTo(p.windowOffset.x,this.scrollStart+(_68a*this.delta)); 6227 6259 }}); 6228 6260 MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; 6229 MochiKit.Visual.Morph=function(_68 0,_681){6261 MochiKit.Visual.Morph=function(_68c,_68d){ 6230 6262 var cls=arguments.callee; 6231 6263 if(!(this instanceof cls)){ 6232 return new cls(_68 0,_681);6233 } 6234 this.__init__(_68 0,_681);6264 return new cls(_68c,_68d); 6265 } 6266 this.__init__(_68c,_68d); 6235 6267 }; 6236 6268 MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base(); 6237 MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_68 3,_684){6238 this.element=MochiKit.DOM.getElement(_68 3);6239 this.start(_6 84);6269 MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_68f,_690){ 6270 this.element=MochiKit.DOM.getElement(_68f); 6271 this.start(_690); 6240 6272 },setup:function(){ 6241 6273 var b=MochiKit.Base; 6242 var _6 86=this.options.style;6274 var _692=this.options.style; 6243 6275 this.styleStart={}; 6244 6276 this.styleEnd={}; 6245 6277 this.units={}; 6246 var _6 87,unit;6247 for(var s in _6 86){6248 _6 87=_686[s];6278 var _693,unit; 6279 for(var s in _692){ 6280 _693=_692[s]; 6249 6281 s=b.camelize(s); 6250 if(MochiKit.Visual.CSS_LENGTH.test(_6 87)){6251 var _6 8a=_687.match(/^([\+\-]?[0-9\.]+)(.*)$/);6252 _6 87=parseFloat(_68a[1]);6253 unit=(_6 8a.length==3)?_68a[2]:null;6254 this.styleEnd[s]=_6 87;6282 if(MochiKit.Visual.CSS_LENGTH.test(_693)){ 6283 var _696=_693.match(/^([\+\-]?[0-9\.]+)(.*)$/); 6284 _693=parseFloat(_696[1]); 6285 unit=(_696.length==3)?_696[2]:null; 6286 this.styleEnd[s]=_693; 6255 6287 this.units[s]=unit; 6256 _6 87=MochiKit.Style.getStyle(this.element,s);6257 _6 8a=_687.match(/^([\+\-]?[0-9\.]+)(.*)$/);6258 _6 87=parseFloat(_68a[1]);6259 this.styleStart[s]=_6 87;6288 _693=MochiKit.Style.getStyle(this.element,s); 6289 _696=_693.match(/^([\+\-]?[0-9\.]+)(.*)$/); 6290 _693=parseFloat(_696[1]); 6291 this.styleStart[s]=_693; 6260 6292 }else{ 6261 6293 var c=MochiKit.Color.Color; 6262 _6 87=c.fromString(_687);6263 if(_6 87){6294 _693=c.fromString(_693); 6295 if(_693){ 6264 6296 this.units[s]="color"; 6265 this.styleEnd[s]=_6 87.toHexString();6266 _6 87=MochiKit.Style.getStyle(this.element,s);6267 this.styleStart[s]=c.fromString(_6 87).toHexString();6297 this.styleEnd[s]=_693.toHexString(); 6298 _693=MochiKit.Style.getStyle(this.element,s); 6299 this.styleStart[s]=c.fromString(_693).toHexString(); 6268 6300 this.styleStart[s]=b.map(b.bind(function(i){ 6269 6301 return parseInt(this.styleStart[s].slice(i*2+1,i*2+3),16); … … 6275 6307 } 6276 6308 } 6277 },update:function(_6 8e){6278 var _6 8f;6309 },update:function(_69a){ 6310 var _69b; 6279 6311 for(var s in this.styleStart){ 6280 6312 if(this.units[s]=="color"){ 6281 6313 var m="#"; 6282 var _69 2=this.styleStart[s];6314 var _69e=this.styleStart[s]; 6283 6315 var end=this.styleEnd[s]; 6284 6316 MochiKit.Base.map(MochiKit.Base.bind(function(i){ 6285 m+=MochiKit.Color.toColorPart(Math.round(_69 2[i]+(end[i]-_692[i])*_68e));6317 m+=MochiKit.Color.toColorPart(Math.round(_69e[i]+(end[i]-_69e[i])*_69a)); 6286 6318 },this),[0,1,2]); 6287 6319 this.element.style[s]=m; 6288 6320 }else{ 6289 _6 8f=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_68e*1000)/1000+this.units[s];6290 this.element.style[s]=_6 8f;6321 _69b=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_69a*1000)/1000+this.units[s]; 6322 this.element.style[s]=_69b; 6291 6323 } 6292 6324 } 6293 6325 }}); 6294 MochiKit.Visual.fade=function(_6 95,_696){6326 MochiKit.Visual.fade=function(_6a1,_6a2){ 6295 6327 var s=MochiKit.Style; 6296 var _6 98=s.getStyle(_695,"opacity");6297 _6 96=MochiKit.Base.update({from:s.getStyle(_695,"opacity")||1,to:0,afterFinishInternal:function(_699){6298 if(_6 99.options.to!==0){6328 var _6a4=s.getStyle(_6a1,"opacity"); 6329 _6a2=MochiKit.Base.update({from:s.getStyle(_6a1,"opacity")||1,to:0,afterFinishInternal:function(_6a5){ 6330 if(_6a5.options.to!==0){ 6299 6331 return; 6300 6332 } 6301 s.hideElement(_6 99.element);6302 s.setStyle(_6 99.element,{"opacity":_698});6303 }},_6 96);6304 return new MochiKit.Visual.Opacity(_6 95,_696);6305 }; 6306 MochiKit.Visual.appear=function(_6 9a,_69b){6333 s.hideElement(_6a5.element); 6334 s.setStyle(_6a5.element,{"opacity":_6a4}); 6335 }},_6a2); 6336 return new MochiKit.Visual.Opacity(_6a1,_6a2); 6337 }; 6338 MochiKit.Visual.appear=function(_6a6,_6a7){ 6307 6339 var s=MochiKit.Style; 6308 6340 var v=MochiKit.Visual; 6309 _6 9b=MochiKit.Base.update({from:(s.getStyle(_69a,"display")=="none"?0:s.getStyle(_69a,"opacity")||0),to:1,afterFinishInternal:function(_69e){6310 v.forceRerendering(_6 9e.element);6311 },beforeSetupInternal:function(_6 9f){6312 s.setStyle(_6 9f.element,{"opacity":_69f.options.from});6313 s.showElement(_6 9f.element);6314 }},_6 9b);6315 return new v.Opacity(_6 9a,_69b);6316 }; 6317 MochiKit.Visual.puff=function(_6a 0,_6a1){6341 _6a7=MochiKit.Base.update({from:(s.getStyle(_6a6,"display")=="none"?0:s.getStyle(_6a6,"opacity")||0),to:1,afterFinishInternal:function(_6aa){ 6342 v.forceRerendering(_6aa.element); 6343 },beforeSetupInternal:function(_6ab){ 6344 s.setStyle(_6ab.element,{"opacity":_6ab.options.from}); 6345 s.showElement(_6ab.element); 6346 }},_6a7); 6347 return new v.Opacity(_6a6,_6a7); 6348 }; 6349 MochiKit.Visual.puff=function(_6ac,_6ad){ 6318 6350 var s=MochiKit.Style; 6319 6351 var v=MochiKit.Visual; 6320 _6a 0=MochiKit.DOM.getElement(_6a0);6321 var _6 a4={position:s.getStyle(_6a0,"position"),top:_6a0.style.top,left:_6a0.style.left,width:_6a0.style.width,height:_6a0.style.height,opacity:s.getStyle(_6a0,"opacity")};6322 _6a 1=MochiKit.Base.update({beforeSetupInternal:function(_6a5){6323 MochiKit.Position.absolutize(_6 a5.effects[0].element);6324 },afterFinishInternal:function(_6 a6){6325 s.hideElement(_6 a6.effects[0].element);6326 s.setStyle(_6 a6.effects[0].element,_6a4);6327 },scaleContent:true,scaleFromCenter:true},_6a 1);6328 return new v.Parallel([new v.Scale(_6a 0,200,{sync:true,scaleFromCenter:_6a1.scaleFromCenter,scaleContent:_6a1.scaleContent,restoreAfterFinish:true}),new v.Opacity(_6a0,{sync:true,to:0})],_6a1);6329 }; 6330 MochiKit.Visual.blindUp=function(_6 a7,_6a8){6352 _6ac=MochiKit.DOM.getElement(_6ac); 6353 var _6b0={position:s.getStyle(_6ac,"position"),top:_6ac.style.top,left:_6ac.style.left,width:_6ac.style.width,height:_6ac.style.height,opacity:s.getStyle(_6ac,"opacity")}; 6354 _6ad=MochiKit.Base.update({beforeSetupInternal:function(_6b1){ 6355 MochiKit.Position.absolutize(_6b1.effects[0].element); 6356 },afterFinishInternal:function(_6b2){ 6357 s.hideElement(_6b2.effects[0].element); 6358 s.setStyle(_6b2.effects[0].element,_6b0); 6359 },scaleContent:true,scaleFromCenter:true},_6ad); 6360 return new v.Parallel([new v.Scale(_6ac,200,{sync:true,scaleFromCenter:_6ad.scaleFromCenter,scaleContent:_6ad.scaleContent,restoreAfterFinish:true}),new v.Opacity(_6ac,{sync:true,to:0})],_6ad); 6361 }; 6362 MochiKit.Visual.blindUp=function(_6b3,_6b4){ 6331 6363 var d=MochiKit.DOM; 6332 _6 a7=d.getElement(_6a7);6333 var _6 aa=d.makeClipping(_6a7);6334 _6 a8=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_6ab){6335 MochiKit.Style.hideElement(_6 ab.element);6336 d.undoClipping(_6 ab.element,_6aa);6337 }},_6 a8);6338 return new MochiKit.Visual.Scale(_6 a7,0,_6a8);6339 }; 6340 MochiKit.Visual.blindDown=function(_6 ac,_6ad){6364 _6b3=d.getElement(_6b3); 6365 var _6b6=d.makeClipping(_6b3); 6366 _6b4=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_6b7){ 6367 MochiKit.Style.hideElement(_6b7.element); 6368 d.undoClipping(_6b7.element,_6b6); 6369 }},_6b4); 6370 return new MochiKit.Visual.Scale(_6b3,0,_6b4); 6371 }; 6372 MochiKit.Visual.blindDown=function(_6b8,_6b9){ 6341 6373 var d=MochiKit.DOM; 6342 6374 var s=MochiKit.Style; 6343 _6 ac=d.getElement(_6ac);6344 var _6b 0=s.getElementDimensions(_6ac);6345 var _6b 1;6346 _6 ad=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6b0.h,originalWidth:_6b0.w},restoreAfterFinish:true,afterSetupInternal:function(_6b2){6347 _6b 1=d.makeClipping(_6b2.element);6348 s.setStyle(_6b 2.element,{height:"0px"});6349 s.showElement(_6b 2.element);6350 },afterFinishInternal:function(_6b 3){6351 d.undoClipping(_6b 3.element,_6b1);6352 }},_6 ad);6353 return new MochiKit.Visual.Scale(_6 ac,100,_6ad);6354 }; 6355 MochiKit.Visual.switchOff=function(_6 b4,_6b5){6375 _6b8=d.getElement(_6b8); 6376 var _6bc=s.getElementDimensions(_6b8); 6377 var _6bd; 6378 _6b9=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6bc.h,originalWidth:_6bc.w},restoreAfterFinish:true,afterSetupInternal:function(_6be){ 6379 _6bd=d.makeClipping(_6be.element); 6380 s.setStyle(_6be.element,{height:"0px"}); 6381 s.showElement(_6be.element); 6382 },afterFinishInternal:function(_6bf){ 6383 d.undoClipping(_6bf.element,_6bd); 6384 }},_6b9); 6385 return new MochiKit.Visual.Scale(_6b8,100,_6b9); 6386 }; 6387 MochiKit.Visual.switchOff=function(_6c0,_6c1){ 6356 6388 var d=MochiKit.DOM; 6357 _6 b4=d.getElement(_6b4);6358 var _6 b7=MochiKit.Style.getStyle(_6b4,"opacity");6359 var _6 b8;6360 _6 b5=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_6b9){6361 d.makePositioned(_6 b9.element);6362 _6 b8=d.makeClipping(_6b9.element);6363 },afterFinishInternal:function(_6 ba){6364 MochiKit.Style.hideElement(_6 ba.element);6365 d.undoClipping(_6 ba.element,_6b8);6366 d.undoPositioned(_6 ba.element);6367 MochiKit.Style.setStyle(_6 ba.element,{"opacity":_6b7});6368 }},_6 b5);6389 _6c0=d.getElement(_6c0); 6390 var _6c3=MochiKit.Style.getStyle(_6c0,"opacity"); 6391 var _6c4; 6392 _6c1=MochiKit.Base.update({duration:0.7,restoreAfterFinish:true,beforeSetupInternal:function(_6c5){ 6393 d.makePositioned(_6c0); 6394 _6c4=d.makeClipping(_6c0); 6395 },afterFinishInternal:function(_6c6){ 6396 MochiKit.Style.hideElement(_6c0); 6397 d.undoClipping(_6c0,_6c4); 6398 d.undoPositioned(_6c0); 6399 MochiKit.Style.setStyle(_6c0,{"opacity":_6c3}); 6400 }},_6c1); 6369 6401 var v=MochiKit.Visual; 6370 return new v.appear(_6b4,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_6bc){ 6371 new v.Scale(_6bc.element,1,_6b5); 6372 }}); 6373 }; 6374 MochiKit.Visual.dropOut=function(_6bd,_6be){ 6402 return new v.Sequence([new v.appear(_6c0,{sync:true,duration:0.57*_6c1.duration,from:0,transition:v.Transitions.flicker}),new v.Scale(_6c0,1,{sync:true,duration:0.43*_6c1.duration,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true})],_6c1); 6403 }; 6404 MochiKit.Visual.dropOut=function(_6c8,_6c9){ 6375 6405 var d=MochiKit.DOM; 6376 6406 var s=MochiKit.Style; 6377 _6 bd=d.getElement(_6bd);6378 var _6c 1={top:s.getStyle(_6bd,"top"),left:s.getStyle(_6bd,"left"),opacity:s.getStyle(_6bd,"opacity")};6379 _6 be=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6c2){6380 d.makePositioned(_6c 2.effects[0].element);6381 },afterFinishInternal:function(_6c 3){6382 s.hideElement(_6c 3.effects[0].element);6383 d.undoPositioned(_6c 3.effects[0].element);6384 s.setStyle(_6c 3.effects[0].element,_6c1);6385 }},_6 be);6407 _6c8=d.getElement(_6c8); 6408 var _6cc={top:s.getStyle(_6c8,"top"),left:s.getStyle(_6c8,"left"),opacity:s.getStyle(_6c8,"opacity")}; 6409 _6c9=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6cd){ 6410 d.makePositioned(_6cd.effects[0].element); 6411 },afterFinishInternal:function(_6ce){ 6412 s.hideElement(_6ce.effects[0].element); 6413 d.undoPositioned(_6ce.effects[0].element); 6414 s.setStyle(_6ce.effects[0].element,_6cc); 6415 }},_6c9); 6386 6416 var v=MochiKit.Visual; 6387 return new v.Parallel([new v.Move(_6 bd,{x:0,y:_6be.distance,sync:true}),new v.Opacity(_6bd,{sync:true,to:0})],_6be);6388 }; 6389 MochiKit.Visual.shake=function(_6 c5,_6c6){6417 return new v.Parallel([new v.Move(_6c8,{x:0,y:_6c9.distance,sync:true}),new v.Opacity(_6c8,{sync:true,to:0})],_6c9); 6418 }; 6419 MochiKit.Visual.shake=function(_6d0,_6d1){ 6390 6420 var d=MochiKit.DOM; 6391 6421 var v=MochiKit.Visual; 6392 6422 var s=MochiKit.Style; 6393 _6 c5=d.getElement(_6c5);6394 var _6 ca={top:s.getStyle(_6c5,"top"),left:s.getStyle(_6c5,"left")};6395 _6 c6=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6cb){6396 d.undoPositioned(_6 cb.element);6397 s.setStyle(_6 cb.element,_6ca);6398 }},_6 c6);6399 return new v.Move(_6 c5,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6cc){6400 new v.Move(_6 cc.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6cd){6401 new v.Move(_6 cd.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6ce){6402 new v.Move(_6 ce.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6cf){6403 new v.Move(_6 cf.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6d0){6404 new v.Move(_6d 0.element,_6c6);6423 _6d0=d.getElement(_6d0); 6424 var _6d5={top:s.getStyle(_6d0,"top"),left:s.getStyle(_6d0,"left")}; 6425 _6d1=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6d6){ 6426 d.undoPositioned(_6d6.element); 6427 s.setStyle(_6d6.element,_6d5); 6428 }},_6d1); 6429 return new v.Move(_6d0,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6d7){ 6430 new v.Move(_6d7.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6d8){ 6431 new v.Move(_6d8.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6d9){ 6432 new v.Move(_6d9.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6da){ 6433 new v.Move(_6da.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6db){ 6434 new v.Move(_6db.element,_6d1); 6405 6435 }}); 6406 6436 }}); … … 6409 6439 }}); 6410 6440 }; 6411 MochiKit.Visual.slideDown=function(_6d1,_6d2){ 6412 var d=MochiKit.DOM; 6413 var b=MochiKit.Base; 6414 var s=MochiKit.Style; 6415 _6d1=d.getElement(_6d1); 6416 if(!_6d1.firstChild){ 6417 throw "MochiKit.Visual.slideDown must be used on a element with a child"; 6418 } 6419 d.removeEmptyTextNodes(_6d1); 6420 var _6d6=s.getStyle(_6d1.firstChild,"bottom")||0; 6421 var _6d7=s.getElementDimensions(_6d1); 6422 var _6d8; 6423 _6d2=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6d7.h,originalWidth:_6d7.w},restoreAfterFinish:true,afterSetupInternal:function(_6d9){ 6424 d.makePositioned(_6d9.element); 6425 d.makePositioned(_6d9.element.firstChild); 6426 if(/Opera/.test(navigator.userAgent)){ 6427 s.setStyle(_6d9.element,{top:""}); 6428 } 6429 _6d8=d.makeClipping(_6d9.element); 6430 s.setStyle(_6d9.element,{height:"0px"}); 6431 s.showElement(_6d9.element); 6432 },afterUpdateInternal:function(_6da){ 6433 s.setStyle(_6da.element.firstChild,{bottom:(_6da.dims[0]-_6da.element.clientHeight)+"px"}); 6434 },afterFinishInternal:function(_6db){ 6435 d.undoClipping(_6db.element,_6d8); 6436 if(/MSIE/.test(navigator.userAgent)){ 6437 d.undoPositioned(_6db.element); 6438 d.undoPositioned(_6db.element.firstChild); 6439 }else{ 6440 d.undoPositioned(_6db.element.firstChild); 6441 d.undoPositioned(_6db.element); 6442 } 6443 s.setStyle(_6db.element.firstChild,{bottom:_6d6}); 6444 }},_6d2); 6445 return new MochiKit.Visual.Scale(_6d1,100,_6d2); 6446 }; 6447 MochiKit.Visual.slideUp=function(_6dc,_6dd){ 6441 MochiKit.Visual.slideDown=function(_6dc,_6dd){ 6448 6442 var d=MochiKit.DOM; 6449 6443 var b=MochiKit.Base; … … 6451 6445 _6dc=d.getElement(_6dc); 6452 6446 if(!_6dc.firstChild){ 6453 throw "MochiKit.Visual.slide Upmust be used on a element with a child";6447 throw "MochiKit.Visual.slideDown must be used on a element with a child"; 6454 6448 } 6455 6449 d.removeEmptyTextNodes(_6dc); 6456 var _6e1=s.getStyle(_6dc.firstChild,"bottom"); 6457 var _6e2; 6458 _6dd=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6e3){ 6459 d.makePositioned(_6e3.element); 6460 d.makePositioned(_6e3.element.firstChild); 6450 var _6e1=s.getStyle(_6dc.firstChild,"bottom")||0; 6451 var _6e2=s.getElementDimensions(_6dc); 6452 var _6e3; 6453 _6dd=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6e2.h,originalWidth:_6e2.w},restoreAfterFinish:true,afterSetupInternal:function(_6e4){ 6454 d.makePositioned(_6e4.element); 6455 d.makePositioned(_6e4.element.firstChild); 6461 6456 if(/Opera/.test(navigator.userAgent)){ 6462 s.setStyle(_6e3.element,{top:""}); 6463 } 6464 _6e2=d.makeClipping(_6e3.element); 6465 s.showElement(_6e3.element); 6466 },afterUpdateInternal:function(_6e4){ 6467 s.setStyle(_6e4.element.firstChild,{bottom:(_6e4.dims[0]-_6e4.element.clientHeight)+"px"}); 6468 },afterFinishInternal:function(_6e5){ 6469 s.hideElement(_6e5.element); 6470 d.undoClipping(_6e5.element,_6e2); 6471 d.undoPositioned(_6e5.element.firstChild); 6472 d.undoPositioned(_6e5.element); 6473 s.setStyle(_6e5.element.firstChild,{bottom:_6e1}); 6457 s.setStyle(_6e4.element,{top:""}); 6458 } 6459 _6e3=d.makeClipping(_6e4.element); 6460 s.setStyle(_6e4.element,{height:"0px"}); 6461 s.showElement(_6e4.element); 6462 },afterUpdateInternal:function(_6e5){ 6463 s.setStyle(_6e5.element.firstChild,{bottom:(_6e5.dims[0]-_6e5.element.clientHeight)+"px"}); 6464 },afterFinishInternal:function(_6e6){ 6465 d.undoClipping(_6e6.element,_6e3); 6466 if(/MSIE/.test(navigator.userAgent)){ 6467 d.undoPositioned(_6e6.element); 6468 d.undoPositioned(_6e6.element.firstChild); 6469 }else{ 6470 d.undoPositioned(_6e6.element.firstChild); 6471 d.undoPositioned(_6e6.element); 6472 } 6473 s.setStyle(_6e6.element.firstChild,{bottom:_6e1}); 6474 6474 }},_6dd); 6475 return new MochiKit.Visual.Scale(_6dc, 0,_6dd);6476 }; 6477 MochiKit.Visual.s quish=function(_6e6,_6e7){6475 return new MochiKit.Visual.Scale(_6dc,100,_6dd); 6476 }; 6477 MochiKit.Visual.slideUp=function(_6e7,_6e8){ 6478 6478 var d=MochiKit.DOM; 6479 6479 var b=MochiKit.Base; 6480 var _6ea; 6481 _6e7=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6eb){ 6482 _6ea=d.makeClipping(_6eb.element); 6483 },afterFinishInternal:function(_6ec){ 6484 MochiKit.Style.hideElement(_6ec.element); 6485 d.undoClipping(_6ec.element,_6ea); 6486 }},_6e7); 6487 return new MochiKit.Visual.Scale(_6e6,/Opera/.test(navigator.userAgent)?1:0,_6e7); 6488 }; 6489 MochiKit.Visual.grow=function(_6ed,_6ee){ 6480 var s=MochiKit.Style; 6481 _6e7=d.getElement(_6e7); 6482 if(!_6e7.firstChild){ 6483 throw "MochiKit.Visual.slideUp must be used on a element with a child"; 6484 } 6485 d.removeEmptyTextNodes(_6e7); 6486 var _6ec=s.getStyle(_6e7.firstChild,"bottom"); 6487 var _6ed; 6488 _6e8=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6ee){ 6489 d.makePositioned(_6ee.element); 6490 d.makePositioned(_6ee.element.firstChild); 6491 if(/Opera/.test(navigator.userAgent)){ 6492 s.setStyle(_6ee.element,{top:""}); 6493 } 6494 _6ed=d.makeClipping(_6ee.element); 6495 s.showElement(_6ee.element); 6496 },afterUpdateInternal:function(_6ef){ 6497 s.setStyle(_6ef.element.firstChild,{bottom:(_6ef.dims[0]-_6ef.element.clientHeight)+"px"}); 6498 },afterFinishInternal:function(_6f0){ 6499 s.hideElement(_6f0.element); 6500 d.undoClipping(_6f0.element,_6ed); 6501 d.undoPositioned(_6f0.element.firstChild); 6502 d.undoPositioned(_6f0.element); 6503 s.setStyle(_6f0.element.firstChild,{bottom:_6ec}); 6504 }},_6e8); 6505 return new MochiKit.Visual.Scale(_6e7,0,_6e8); 6506 }; 6507 MochiKit.Visual.squish=function(_6f1,_6f2){ 6508 var d=MochiKit.DOM; 6509 var b=MochiKit.Base; 6510 var _6f5; 6511 _6f2=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6f6){ 6512 _6f5=d.makeClipping(_6f6.element); 6513 },afterFinishInternal:function(_6f7){ 6514 MochiKit.Style.hideElement(_6f7.element); 6515 d.undoClipping(_6f7.element,_6f5); 6516 }},_6f2); 6517 return new MochiKit.Visual.Scale(_6f1,/Opera/.test(navigator.userAgent)?1:0,_6f2); 6518 }; 6519 MochiKit.Visual.grow=function(_6f8,_6f9){ 6490 6520 var d=MochiKit.DOM; 6491 6521 var v=MochiKit.Visual; 6492 6522 var s=MochiKit.Style; 6493 _6 ed=d.getElement(_6ed);6494 _6 ee=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6ee);6495 var _6f 2={top:_6ed.style.top,left:_6ed.style.left,height:_6ed.style.height,width:_6ed.style.width,opacity:s.getStyle(_6ed,"opacity")};6496 var dims=s.getElementDimensions(_6 ed);6497 var _6f 4,_6f5;6498 var _ 6f6,_6f7;6499 switch(_6 ee.direction){6523 _6f8=d.getElement(_6f8); 6524 _6f9=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6f9); 6525 var _6fd={top:_6f8.style.top,left:_6f8.style.left,height:_6f8.style.height,width:_6f8.style.width,opacity:s.getStyle(_6f8,"opacity")}; 6526 var dims=s.getElementDimensions(_6f8); 6527 var _6ff,_700; 6528 var _701,_702; 6529 switch(_6f9.direction){ 6500 6530 case "top-left": 6501 _6f 4=_6f5=_6f6=_6f7=0;6531 _6ff=_700=_701=_702=0; 6502 6532 break; 6503 6533 case "top-right": 6504 _6f 4=dims.w;6505 _ 6f5=_6f7=0;6506 _ 6f6=-dims.w;6534 _6ff=dims.w; 6535 _700=_702=0; 6536 _701=-dims.w; 6507 6537 break; 6508 6538 case "bottom-left": 6509 _6f 4=_6f6=0;6510 _ 6f5=dims.h;6511 _ 6f7=-dims.h;6539 _6ff=_701=0; 6540 _700=dims.h; 6541 _702=-dims.h; 6512 6542 break; 6513 6543 case "bottom-right": 6514 _6f 4=dims.w;6515 _ 6f5=dims.h;6516 _ 6f6=-dims.w;6517 _ 6f7=-dims.h;6544 _6ff=dims.w; 6545 _700=dims.h; 6546 _701=-dims.w; 6547 _702=-dims.h; 6518 6548 break; 6519 6549 case "center": 6520 _6f 4=dims.w/2;6521 _ 6f5=dims.h/2;6522 _ 6f6=-dims.w/2;6523 _ 6f7=-dims.h/2;6550 _6ff=dims.w/2; 6551 _700=dims.h/2; 6552 _701=-dims.w/2; 6553 _702=-dims.h/2; 6524 6554 break; 6525 6555 } 6526 var _ 6f8=MochiKit.Base.update({beforeSetupInternal:function(_6f9){6527 s.setStyle(_ 6f9.effects[0].element,{height:"0px"});6528 s.showElement(_ 6f9.effects[0].element);6529 },afterFinishInternal:function(_ 6fa){6530 d.undoClipping(_ 6fa.effects[0].element);6531 d.undoPositioned(_ 6fa.effects[0].element);6532 s.setStyle(_ 6fa.effects[0].element,_6f2);6533 }},_6 ee);6534 return new v.Move(_6 ed,{x:_6f4,y:_6f5,duration:0.01,beforeSetupInternal:function(_6fb){6535 s.hideElement(_ 6fb.element);6536 d.makeClipping(_ 6fb.element);6537 d.makePositioned(_ 6fb.element);6538 },afterFinishInternal:function(_ 6fc){6539 new v.Parallel([new v.Opacity(_ 6fc.element,{sync:true,to:1,from:0,transition:_6ee.opacityTransition}),new v.Move(_6fc.element,{x:_6f6,y:_6f7,sync:true,transition:_6ee.moveTransition}),new v.Scale(_6fc.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6ee.scaleTransition,scaleContent:_6ee.scaleContent,scaleFromCenter:_6ee.scaleFromCenter,restoreAfterFinish:true})],_6f8);6556 var _703=MochiKit.Base.update({beforeSetupInternal:function(_704){ 6557 s.setStyle(_704.effects[0].element,{height:"0px"}); 6558 s.showElement(_704.effects[0].element); 6559 },afterFinishInternal:function(_705){ 6560 d.undoClipping(_705.effects[0].element); 6561 d.undoPositioned(_705.effects[0].element); 6562 s.setStyle(_705.effects[0].element,_6fd); 6563 }},_6f9); 6564 return new v.Move(_6f8,{x:_6ff,y:_700,duration:0.01,beforeSetupInternal:function(_706){ 6565 s.hideElement(_706.element); 6566 d.makeClipping(_706.element); 6567 d.makePositioned(_706.element); 6568 },afterFinishInternal:function(_707){ 6569 new v.Parallel([new v.Opacity(_707.element,{sync:true,to:1,from:0,transition:_6f9.opacityTransition}),new v.Move(_707.element,{x:_701,y:_702,sync:true,transition:_6f9.moveTransition}),new v.Scale(_707.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6f9.scaleTransition,scaleContent:_6f9.scaleContent,scaleFromCenter:_6f9.scaleFromCenter,restoreAfterFinish:true})],_703); 6540 6570 }}); 6541 6571 }; 6542 MochiKit.Visual.shrink=function(_ 6fd,_6fe){6572 MochiKit.Visual.shrink=function(_708,_709){ 6543 6573 var d=MochiKit.DOM; 6544 6574 var v=MochiKit.Visual; 6545 6575 var s=MochiKit.Style; 6546 _ 6fd=d.getElement(_6fd);6547 _ 6fe=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_6fe);6548 var _70 2={top:_6fd.style.top,left:_6fd.style.left,height:_6fd.style.height,width:_6fd.style.width,opacity:s.getStyle(_6fd,"opacity")};6549 var dims=s.getElementDimensions(_ 6fd);6550 var _70 4,_705;6551 switch(_ 6fe.direction){6576 _708=d.getElement(_708); 6577 _709=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_709); 6578 var _70d={top:_708.style.top,left:_708.style.left,height:_708.style.height,width:_708.style.width,opacity:s.getStyle(_708,"opacity")}; 6579 var dims=s.getElementDimensions(_708);
