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

20 lines
16 KiB
JavaScript
Raw Normal View History

/*!
* jQuery UI Effects 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(u){u.ui=u.ui||{},u.ui.version="1.12.1";var l,d,a,p,t,h,g,m,s,e,b,o,i,c,f,v,n,r,y,x,C,w="ui-effects-",k="ui-effects-style",_="ui-effects-animated",S=u;function M(t,e,n){var r=m[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 B(r){var i=h(),o=i._rgba=[];return r=r.toLowerCase(),b(t,function(t,e){var n=e.re.exec(r),n=n&&e.parse(n),e=e.space||"rgba";if(n)return n=i[e](n),i[g[e].cache]=n[g[e].cache],o=i._rgba=n._rgba,!1}),o.length?("0,0,0,0"===o.join()&&l.extend(o,a.transparent),i):a[r]}function H(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 I(t){var e,n,r=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,i={};if(r&&r.length&&r[0]&&r[r[0]])for(n=r.length;n--;)"string"==typeof r[e=r[n]]&&(i[u.camelCase(e)]=r[e]);else for(e in r)"string"==typeof r[e]&&(i[e]=r[e]);return i}function T(t,e,n,r){return t={effect:t=u.isPlainObject(t)?(e=t).effect:t},u.isFunction(e=null==e?{}:e)&&(r=e,n=null,e={}),"number"!=typeof e&&!u.fx.speeds[e]||(r=n,n=e,e={}),u.isFunction(n)&&(r=n,n=null),e&&u.extend(t,e),n=n||e.duration,t.duration=u.fx.off?0:"number"==typeof n?n:n in u.fx.speeds?u.fx.speeds[n]:u.fx.speeds._default,t.complete=r||e.complete,t}function F(t){return!t||"number"==typeof t||u.fx.speeds[t]||("string"==typeof t&&!u.effects.effect[t]||(u.isFunction(t)||"object"==typeof t&&!t.effect))}function W(t,e){var n=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,n,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?n:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}return u.effects={effect:{}},
/*!
* jQuery Color Animations v2.1.2
* https://github.com/jquery/jquery-color
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* Date: Wed Jan 16 08:47:09 2013 -0600
*/
p=/^([\-+])=\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]]}}],h=(l=S).Color=function(t,e,n,r){return new l.Color.fn.parse(t,e,n,r)},g={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"}}}},m={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},s=h.support={},e=l("<p>")[0],b=l.each,e.style.cssText="background-color:rgba(1,1,1,.5)",s.rgba=-1<e.style.backgroundColor.indexOf("rgba"),b(g,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=l.extend(h.prototype,{parse:function(i,t,e,n){if(i===d)return this._rgba=[null,null,null,null],this;(i.jquery||i.nodeType)&&(i=l(i).css(t),t=d);var o=this,r=l.type(i),s=this._rgba=[];return t!==d&&(i=[i,t,e,n],r="array"),"string"===r?this.parse(B(i)||a._default):"array"===r?(b(g.rgba.props,function(t,e){s[e.idx]=M(i[e.idx],e)}),this):"object"===r?(b(g,i instanceof h?function(t,e){i[e.cache]&&(o[e.cache]=i[e.cache].slice())}:function(t,n){var r=n.cache;b(n.props,function(t,e){if(!o[r]&&n.to){if("alpha"===t||null==i[t])return;o[r]=n.to(o._rgba)}o[r][e.idx]=M(i[t],e,!0)}),o[r]&&l.inArray(null,o[r].slice(0,3))<0&&(o[r][3]=1,n.from&&(o._rgba=n.from(o[r])))}),this):void 0},is:function(t){var i=h(t),o=!0,s=this;return b(g,function(t,e){var n,r=i[e.cache];return r&&(n=s[e.cache]||e.to&&e.to(s._rgba)||[],b(e.props,function(t,e){if(null!=r[e.idx])return o=r[e.idx]===n[e.idx]})),o}),o},_space:function(){var n=[],r=this;return b(g,function(t,e){r[e.cache]&&n.push(t)}),n.pop()},transition:function(t,s){var e=(f=h(t))._space(),n=g[e],t=0===this.alpha()?h("transparent"):this,a=t[n.cache]||n.to(t._rgba),c=a.slice(),f=f[n.cache];return b(n.props,function(t,e){var n=e.idx,r=a[n],i=f[n],o=m[e.type]||{};null!==i&&(null===r?c[n]=i:(o.mod&&(i-r>o.mod/2?r+=o.mod:r-i>o.mod/2&&(r-=o.mod)),c[n]=M((i-r)*s+r,e)))}),this[e](c)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),n=e.pop(),r=h(t)._rgba;return h(l.map(e,function(t,e){return(1-n)*r[e]+n*t}))},toRgbaString:function(){var t="rgba(",e=l.map(this._rgba,function(t,e){return null==t?2<e?1:0:t});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=l.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),n=e.pop();return t&&e.push(~~(255*n)),"#"+l.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,g.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=t[3],o=Math.max(e,n,r),s=Math.min(e,n,r),a=o-s,c=o+s,t=.5*c,n=s===o?0:e===o?60*(n-r)/a+360:n===o?60*(r-e)/a+120:60*(e-n)/a+240,c=0==a?0:t<=.5?a/c:a/(2-c);return[Math.round(n)%360,c,t,null==i?1:i]},g.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,n=t[1],r=t[2],t=t[3],n=r<=.5?r*(1+n):r+n-r*n,r=2*r-n;return[Math.round(255*H(r,n,e+1/3)),Math.round(255*H(r,n,e)),Math.round(255*H(r,n,e-1/3)),t]},b(g,function(c,t){var o=t.props,s=t.cache,a=t.to,f=t.from;h.fn[c]=fun