diff options
Diffstat (limited to 'js/yui3/transition')
-rw-r--r-- | js/yui3/transition/transition-min.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/yui3/transition/transition-min.js b/js/yui3/transition/transition-min.js new file mode 100644 index 000000000..09c067be7 --- /dev/null +++ b/js/yui3/transition/transition-min.js @@ -0,0 +1,7 @@ +/* +YUI 3.7.3 (build 5687) +Copyright 2012 Yahoo! Inc. All rights reserved. +Licensed under the BSD License. +http://yuilibrary.com/license/ +*/ +YUI.add("transition",function(e,t){var n="",r="",i=e.config.doc,s="documentElement",o="transition",u="transition",a="transitionProperty",f="transform",l,c,h,p,d,v,m={},g=["Webkit","Moz"],y={Webkit:"webkitTransitionEnd"},b=function(){this.init.apply(this,arguments)};b._toCamel=function(e){return e=e.replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()}),e},b._toHyphen=function(e){return e=e.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(e,t,n,r){var i=(t?"-"+t.toLowerCase():"")+n;return r&&(i+="-"+r.toLowerCase()),i}),e},b.SHOW_TRANSITION="fadeIn",b.HIDE_TRANSITION="fadeOut",b.useNative=!1,"transition"in i[s].style?(b.useNative=!0,b.supported=!0):e.Array.each(g,function(e){var t=e+"Transition";t in i[s].style&&(n=e,r=b._toHyphen(e)+"-",b.useNative=!0,b.supported=!0,b._VENDOR_PREFIX=e)}),n&&(u=n+"Transition",a=n+"TransitionProperty",f=n+"Transform"),l=r+"transition-property",c=r+"transition-duration",h=r+"transition-timing-function",p=r+"transition-delay",d="transitionend",v="on"+n.toLowerCase()+"transitionend",d=y[n]||d,b.fx={},b.toggles={},b._hasEnd={},b._reKeywords=/^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i,e.Node.DOM_EVENTS[d]=1,b.NAME="transition",b.DEFAULT_EASING="ease",b.DEFAULT_DURATION=.5,b.DEFAULT_DELAY=0,b._nodeAttrs={},b.prototype={constructor:b,init:function(e,t){var n=this;return n._node=e,!n._running&&t&&(n._config=t,e._transition=n,n._duration="duration"in t?t.duration:n.constructor.DEFAULT_DURATION,n._delay="delay"in t?t.delay:n.constructor.DEFAULT_DELAY,n._easing=t.easing||n.constructor.DEFAULT_EASING,n._count=0,n._running=!1),n},addProperty:function(t,n){var r=this,i=this._node,s=e.stamp(i),o=e.one(i),u=b._nodeAttrs[s],a,f,l,c,h;u||(u=b._nodeAttrs[s]={}),c=u[t],n&&n.value!==undefined?h=n.value:n!==undefined&&(h=n,n=m),typeof h=="function"&&(h=h.call(o,o)),c&&c.transition&&c.transition!==r&&c.transition._count--,r._count++,l=(typeof n.duration!="undefined"?n.duration:r._duration)||1e-4,u[t]={value:h,duration:l,delay:typeof n.delay!="undefined"?n.delay:r._delay,easing:n.easing||r._easing,transition:r},a=e.DOM.getComputedStyle(i,t),f=typeof h=="string"?a:parseFloat(a),b.useNative&&f===h&&setTimeout(function(){r._onNativeEnd.call(i,{propertyName:t,elapsedTime:l})},l*1e3)},removeProperty:function(t){var n=this,r=b._nodeAttrs[e.stamp(n._node)];r&&r[t]&&(delete r[t],n._count--)},initAttrs:function(t){var n,r=this._node;t.transform&&!t[f]&&(t[f]=t.transform,delete t.transform);for(n in t)t.hasOwnProperty(n)&&!b._reKeywords.test(n)&&(this.addProperty(n,t[n]),r.style[n]===""&&e.DOM.setStyle(r,n,e.DOM.getComputedStyle(r,n)))},run:function(t){var n=this,r=n._node,i=n._config,s={type:"transition:start",config:i};return n._running||(n._running=!0,i.on&&i.on.start&&i.on.start.call(e.one(r),s),n.initAttrs(n._config),n._callback=t,n._start()),n},_start:function(){this._runNative()},_prepDur:function(e){return e=parseFloat(e)*1e3,e+"ms"},_runNative:function(t){var n=this,r=n._node,i=e.stamp(r),s=r.style,o=r.ownerDocument.defaultView.getComputedStyle(r),u=b._nodeAttrs[i],a="",f=o[b._toCamel(l)],v=l+": ",m=c+": ",g=h+": ",y=p+": ",w,E,S;f!=="all"&&(v+=f+",",m+=o[b._toCamel(c)]+",",g+=o[b._toCamel(h)]+",",y+=o[b._toCamel(p)]+",");for(S in u)w=b._toHyphen(S),E=u[S],(E=u[S])&&E.transition===n&&(S in r.style?(m+=n._prepDur(E.duration)+",",y+=n._prepDur(E.delay)+",",g+=E.easing+",",v+=w+",",a+=w+": "+E.value+"; "):this.removeProperty(S));v=v.replace(/,$/,";"),m=m.replace(/,$/,";"),g=g.replace(/,$/,";"),y=y.replace(/,$/,";"),b._hasEnd[i]||(r.addEventListener(d,n._onNativeEnd,""),b._hasEnd[i]=!0),s.cssText+=v+m+g+y+a},_end:function(t){var n=this,r=n._node,i=n._callback,s=n._config,o={type:"transition:end",config:s,elapsedTime:t},u=e.one(r);n._running=!1,n._callback=null,r&&(s.on&&s.on.end?setTimeout(function(){s.on.end.call(u,o),i&&i.call(u,o)},1):i&&setTimeout(function(){i.call(u,o)},1))},_endNative:function(e){var t=this._node,n=t.ownerDocument.defaultView.getComputedStyle(t,"")[b._toCamel(l)];e=b._toHyphen(e),typeof n=="string"&&(n=n.replace(new RegExp("(?:^|,\\s)"+e+",?"),","),n=n.replace(/^,|,$/,""),t.style[u]=n)},_onNativeEnd:function(t){var n=this,r=e.stamp(n),i=t,s=b._toCamel(i.propertyName),o=i.elapsedTime,u=b._nodeAttrs[r],f=u[s],l=f?f.transition:null,c,h;l&&(l.removeProperty(s),l._endNative(s),h=l._config[s],c={type:"propertyEnd",propertyName:s,elapsedTime:o,config:h},h&&h.on&&h.on.end&&h.on.end.call(e.one(n),c),l._count<=0&&(l._end(o),n.style[a]=""))},destroy:function(){var e=this,t=e._node;t&&(t.removeEventListener(d,e._onNativeEnd,!1),e._node=null)}},e.Transition=b,e.TransitionNative=b,e.Node.prototype.transition=function(t,n,r){var i=b._nodeAttrs[e.stamp(this._node)],s=i?i.transition||null:null,o,u;if(typeof t=="string"){typeof n=="function"&&(r=n,n=null),o=b.fx[t];if(n&&typeof n!="boolean"){n=e.clone(n);for(u in o)o.hasOwnProperty(u)&&(u in n||(n[u]=o[u]))}else n=o}else r=n,n=t;return s&&!s._running?s.init(this,n):s=new b(this._node,n),s.run(r),this},e.Node.prototype.show=function(t,n,r){return this._show(),t&&e.Transition&&(typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.SHOW_TRANSITION),this.transition(t,n,r)),this};var w=function(e,t,n){return function(){t&&t.call(e),n&&n.apply(e._node,arguments)}};e.Node.prototype.hide=function(t,n,r){return t&&e.Transition?(typeof n=="function"&&(r=n,n=null),r=w(this,this._hide,r),typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.HIDE_TRANSITION),this.transition(t,n,r)):this._hide(),this},e.NodeList.prototype.transition=function(t,n){var r=this._nodes,i=0,s;while(s=r[i++])e.one(s).transition(t,n);return this},e.Node.prototype.toggleView=function(t,n,r){return this._toggles=this._toggles||[],r=arguments[arguments.length-1],typeof t=="boolean"&&(n=t,t=null),t=t||e.Transition.DEFAULT_TOGGLE,typeof n=="undefined"&&t in this._toggles&&(n=!this._toggles[t]),n=n?1:0,n?this._show():r=w(this,this._hide,r),this._toggles[t]=n,this.transition(e.Transition.toggles[t][n],r),this},e.NodeList.prototype.toggleView=function(t,n,r){var i=this._nodes,s=0,o;while(o=i[s++])e.one(o).toggleView(t,n,r);return this},e.mix(b.fx,{fadeOut:{opacity:0,duration:.5,easing:"ease-out"},fadeIn:{opacity:1,duration:.5,easing:"ease-in"},sizeOut:{height:0,width:0,duration:.75,easing:"ease-out"},sizeIn:{height:function(e){return e.get("scrollHeight")+"px"},width:function(e){return e.get("scrollWidth")+"px"},duration:.5,easing:"ease-in",on:{start:function(){var e=this.getStyle("overflow");e!=="hidden"&&(this.setStyle("overflow","hidden"),this._transitionOverflow=e)},end:function(){this._transitionOverflow&&(this.setStyle("overflow",this._transitionOverflow),delete this._transitionOverflow)}}}}),e.mix(b.toggles,{size:["sizeOut","sizeIn"],fade:["fadeOut","fadeIn"]}),b.DEFAULT_TOGGLE="fade"},"3.7.3",{requires:["node-style"]}); |