WordPress/wp-includes/js/jquery/ui/effect.min.js

1 line
12 KiB
JavaScript
Raw Normal View History

!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(s){var u,l,c,d,t,p,h,g,i,e,b,a,o,f,m,y,n,r,v,x,C="ui-effects-",w=s;function _(t,e,n){var r=g[e.type]||{};return null==t?n||!e.def?null:e.def:(t=r.floor?~~t:parseFloat(t),isNaN(t)?e.def:r.mod?(t+r.mod)%r.mod:t<0?0:r.max<t?r.max:t)}function k(i){var s=p(),f=s._rgba=[];return i=i.toLowerCase(),b(t,function(t,e){var n,r=e.re.exec(i),o=r&&e.parse(r),a=e.space||"rgba";if(o)return n=s[a](o),s[h[a].cache]=n[h[a].cache],f=s._rgba=n._rgba,!1}),f.length?("0,0,0,0"===f.join()&&u.extend(f,c.transparent),s):c[i]}function M(t,e,n){return 6*(n=(n+1)%1)<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function S(t){var e,n,r=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,o={};if(r&&r.length&&r[0]&&r[r[0]])for(n=r.length;n--;)"string"==typeof r[e=r[n]]&&(o[s.camelCase(e)]=r[e]);else for(e in r)"string"==typeof r[e]&&(o[e]=r[e]);return o}function j(t,e,n,r){return s.isPlainObject(t)&&(t=(e=t).effect),t={effect:t},null==e&&(e={}),s.isFunction(e)&&(r=e,n=null,e={}),"number"!=typeof e&&!s.fx.speeds[e]||(r=n,n=e,e={}),s.isFunction(n)&&(r=n,n=null),e&&s.extend(t,e),n=n||e.duration,t.duration=s.fx.off?0:"number"==typeof n?n:n in s.fx.speeds?s.fx.speeds[n]:s.fx.speeds._default,t.complete=r||e.complete,t}function I(t){return!(t&&"number"!=typeof t&&!s.fx.speeds[t])||("string"==typeof t&&!s.effects.effect[t]||(!!s.isFunction(t)||"object"==typeof t&&!t.effect))}return s.effects={effect:{}},d=/^([\-+])=\s*(\d+\.?\d*)/,t=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],p=(u=w).Color=function(t,e,n,r){return new u.Color.fn.parse(t,e,n,r)},h={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},g={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},i=p.support={},e=u("<p>")[0],b=u.each,e.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=-1<e.style.backgroundColor.indexOf("rgba"),b(h,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),p.fn=u.extend(p.prototype,{parse:function(o,t,e,n){if(o===l)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=u(o).css(t),t=l);var a=this,r=u.type(o),i=this._rgba=[];return t!==l&&(o=[o,t,e,n],r="array"),"string"===r?this.parse(k(o)||c._default):"array"===r?(b(h.rgba.props,function(t,e){i[e.idx]=_(o[e.idx],e)}),this):"object"===r?(b(h,o instanceof p?function(t,e){o[e.cache]&&(a[e.cache]=o[e.cache].slice())}:function(t,n){var r=n.cache;b(n.props,function(t,e){if(!a[r]&&n.to){if("alpha"===t||null==o[t])return;a[r]=n.to(a._rgba)}a[r][e.idx]=_(o[t],e,!0)}),a[r]&&u.inArray(null,a[r].slice(0,3))<0&&(a[r][3]=1,n.from&&(a._rgba=n.from(a[r])))}),this):void 0},is:function(t){var o=p(t),a=!0,i=this;return b(h,function(t,e){var n,r=o[e.cache];return r&&(n=i[e.cache]||e.to&&e.to(i._rgba)||[],b(e.props,function(t,e){if(null!=r[e.idx])return a=r[e.idx]===n[e.idx]})),a}),a},_space:function(){var n=[],r=this;return b(h,function(t,e){r[e.cache]&&n.push(t)}),n.pop()},transition:function(t,i){var s=p(t),e=s._space(),n=h[e],r=0===this.alpha()?p("transparent"):this,f=r[n.cache]||n.to(r._rgba),c=f.slice();return s=s[n.cache],b(n.props,function(t,e){var n=e.idx,r=f[n],o=s[n],a=g[e.type]||{};null!==o&&(n