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

20 lines
17 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(d){d.ui=d.ui||{},d.ui.version="1.12.1";var u,l,f,p,t,h,g,m,s,e,b,o,i,a,c,v,n,r,y,x,C,w="ui-effects-",k="ui-effects-style",_="ui-effects-animated",S=d;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(s){var a=h(),c=a._rgba=[];return s=s.toLowerCase(),b(t,function(t,e){var n,r=e.re.exec(s),i=r&&e.parse(r),o=e.space||"rgba";if(i)return n=a[o](i),a[g[o].cache]=n[g[o].cache],c=a._rgba=n._rgba,!1}),c.length?("0,0,0,0"===c.join()&&u.extend(c,f.transparent),a):f[s]}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[d.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 d.isPlainObject(t)&&(t=(e=t).effect),t={effect:t},null==e&&(e={}),d.isFunction(e)&&(r=e,n=null,e={}),"number"!=typeof e&&!d.fx.speeds[e]||(r=n,n=e,e={}),d.isFunction(n)&&(r=n,n=null),e&&d.extend(t,e),n=n||e.duration,t.duration=d.fx.off?0:"number"==typeof n?n:n in d.fx.speeds?d.fx.speeds[n]:d.fx.speeds._default,t.complete=r||e.complete,t}function F(t){return!(t&&"number"!=typeof t&&!d.fx.speeds[t])||("string"==typeof t&&!d.effects.effect[t]||(!!d.isFunction(t)||"object"==typeof t&&!t.effect))}function W(t,e){var n=e.outerWidth(),r=e.outerHeight(),i=/^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,r,0];return{top:parseFloat(i[1])||0,right:"auto"===i[2]?n:parseFloat(i[2]),bottom:"auto"===i[3]?r:parseFloat(i[3]),left:parseFloat(i[4])||0}}return d.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=(u=S).Color=function(t,e,n,r){return new u.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=u("<p>")[0],b=u.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=u.extend(h.prototype,{parse:function(i,t,e,n){if(i===l)return this._rgba=[null,null,null,null],this;(i.jquery||i.nodeType)&&(i=u(i).css(t),t=l);var o=this,r=u.type(i),s=this._rgba=[];return t!==l&&(i=[i,t,e,n],r="array"),"string"===r?this.parse(B(i)||f._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]&&u.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 a=h(t),e=a._space(),n=g[e],r=0===this.alpha()?h("transparent"):this,c=r[n.cache]||n.to(r._rgba),f=c.slice();return a=a[n.cache],b(n.props,function(t,e){var n=e.idx,r=c[n],i=a[n],o=m[e.type]||{};null!==i&&(null===r?f[n]=i:(o.mod&&(i-r>o.mod/2?r+=o.mod:r-i>o.mod/2&&(r-=o.mod)),f[n]=M((i-r)*s+r,e)))}),this[e](f)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),n=e.pop(),r=h(t)._rgba;return h(u.map(e,function(t,e){return(1-n)*r[e]+n*t}))},toRgbaString:function(){var t="rgba(",e=u.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=u.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),e&&e<3&&(t=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)),"#"+u.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,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,s=t[3],a=Math.max(r,i,o),c=Math.min(r,i,o),f=a-c,u=a+c,l=.5*u;return e=c===a?0:r===a?60*(i-o)/f+360:i===a?60*(o-r)/f+120:60*(r-i)/f+240,n=0==f?0:l<=.5?f/u:f/(2-u),[Math.round(e)%360,n,l,null==s?1:s]},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],i=t[3],o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;return[Math.round(255*H(s,o,e+1/3)),Math.round(255*H(s,o,e)),Math.round(255*H(s,o,e-1/3)),i]},b(g,function(c,t){var n=t.props,s=t.cache,a=t.to,f=t.from;h.f