%PDF- %PDF-
Direktori : /home/eirtvhdf/makkitrust.org/wp-content/themes/alhambra/js/colorpicker/ |
Current File : /home/eirtvhdf/makkitrust.org/wp-content/themes/alhambra/js/colorpicker/jqColorPicker.min.js |
(function(a,b){if(typeof exports==="object"){module.exports=b(a,require("jquery"),require("colors"))}else{if(typeof define==="function"&&define.amd){define(["jquery","colors"],function(c,d){return b(a,c,d)})}else{b(a,a.jQuery,a.Colors)}}}(this,function(x,r,e,f){var k=r(document),g=r(),c,p,B,A,i,I,G,E,H,s,l,b="touchmove.tcp mousemove.tcp pointermove.tcp",C="touchstart.tcp mousedown.tcp pointerdown.tcp",j="touchend.tcp mouseup.tcp pointerup.tcp",w=false,h=x.requestAnimationFrame||x.webkitRequestAnimationFrame||function(K){K()},o='<div class="cp-color-picker"><div class="cp-z-slider"><div class="cp-z-cursor"></div></div><div class="cp-xy-slider"><div class="cp-white"></div><div class="cp-xy-cursor"></div></div><div class="cp-alpha"><div class="cp-alpha-cursor"></div></div></div>',y=".cp-color-picker{position:absolute;overflow:hidden;padding:6px 6px 0;background-color:#444;color:#bbb;font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:400;cursor:default;border-radius:5px}.cp-color-picker>div{position:relative;overflow:hidden}.cp-xy-slider{float:left;height:128px;width:128px;margin-bottom:6px;background:linear-gradient(to right,#FFF,rgba(255,255,255,0))}.cp-white{height:100%;width:100%;background:linear-gradient(rgba(0,0,0,0),#000)}.cp-xy-cursor{position:absolute;top:0;width:10px;height:10px;margin:-5px;border:1px solid #fff;border-radius:100%;box-sizing:border-box}.cp-z-slider{float:right;margin-left:6px;height:128px;width:20px;background:linear-gradient(red 0,#f0f 17%,#00f 33%,#0ff 50%,#0f0 67%,#ff0 83%,red 100%)}.cp-z-cursor{position:absolute;margin-top:-4px;width:100%;border:4px solid #fff;border-color:transparent #fff;box-sizing:border-box}.cp-alpha{clear:both;width:100%;height:16px;margin:6px 0;background:linear-gradient(to right,#444,rgba(0,0,0,0))}.cp-alpha-cursor{position:absolute;margin-left:-4px;height:100%;border:4px solid #fff;border-color:#fff transparent;box-sizing:border-box}",F=function(K){p=this.color=new e(K);B=p.options;c=this};F.prototype={render:J,toggle:n};function t(K){return K.value||K.getAttribute("value")||r(K).css("background-color")||"#FFF"}function m(K){K=K.originalEvent&&K.originalEvent.touches?K.originalEvent.touches[0]:K;return K.originalEvent?K.originalEvent:K}function d(K){return r(K.find(B.doRender)[0]||K[0])}function n(L){var M=r(this),K=M.offset(),N=r(x),O=B.gap;if(L){A=d(M);A._colorMode=A.data("colorMode");c.$trigger=M;(i||v()).css(B.positionCallback.call(c,M)||{left:(i._left=K.left)-((i._left+=i._width-(N.scrollLeft()+N.width()))+O>0?i._left+O:0),top:(i._top=K.top+M.outerHeight())-((i._top+=i._height-(N.scrollTop()+N.height()))+O>0?i._top+O:0)}).show(B.animationSpeed,function(){if(L===true){return}s.toggle(!!B.opacity)._width=s.width();G._width=G.width();G._height=G.height();I._height=I.height();p.setColor(t(A[0]));J(true)}).off(".tcp").on(C,".cp-xy-slider,.cp-z-slider,.cp-alpha",u)}else{if(c.$trigger){r(i).hide(B.animationSpeed,function(){J(false);c.$trigger=null}).off(".tcp")}}}function v(){r("head")[B.cssPrepend?"prepend":"append"]('<style type="text/css" id="tinyColorPickerStyles">'+(B.css||y)+(B.cssAddon||"")+"</style>");return r(o).css({margin:B.margin}).appendTo("body").show(0,function(){c.$UI=i=r(this);w=B.GPU&&i.css("perspective")!==f;I=r(".cp-z-slider",this);G=r(".cp-xy-slider",this);E=r(".cp-xy-cursor",this);H=r(".cp-z-cursor",this);s=r(".cp-alpha",this);l=r(".cp-alpha-cursor",this);B.buildCallback.call(c,i);i.prepend("<div>").children().eq(0).css("width",i.children().eq(0).width());i._width=this.offsetWidth;i._height=this.offsetHeight}).hide()}function u(L){var K=this.className.replace(/cp-(.*?)(?:\s*|$)/,"$1").replace("-","_");if((L.button||L.which)>1){return}L.preventDefault&&L.preventDefault();L.returnValue=false;A._offset=r(this).offset();(K=K==="xy_slider"?a:K==="z_slider"?D:z)(L);J();k.on(j,function(M){k.off(".tcp")}).on(b,function(M){K(M);J()})}function a(L){var M=m(L),K=M.pageX-A._offset.left,N=M.pageY-A._offset.top;p.setColor({s:K/G._width*100,v:100-(N/G._height*100)},"hsv")}function D(K){var L=m(K).pageY-A._offset.top;p.setColor({h:360-(L/I._height*360)},"hsv")}function z(L){var K=m(L).pageX-A._offset.left,M=K/s._width;p.setColor({},"rgb",M)}function J(N){var L=p.colors,U=L.hueRGB,O=L.RND.rgb,S=L.RND.hsl,V=B.dark,P=B.light,X=p.toString(A._colorMode,B.forceAlpha),K=L.HUELuminance>0.22?V:P,M=L.rgbaMixBlack.luminance>0.22?V:P,R=(1-L.hsv.h)*I._height,aa=L.hsv.s*G._width,Y=(1-L.hsv.v)*G._height,W=L.alpha*s._width,Q=w?"translate3d":"",T=A[0].value,Z=A[0].hasAttribute("value")&&T===""&&N!==f;G._css={backgroundColor:"rgb("+U.r+","+U.g+","+U.b+")"};E._css={transform:Q+"("+aa+"px, "+Y+"px, 0)",left:!w?aa:"",top:!w?Y:"",borderColor:L.RGBLuminance>0.22?V:P};H._css={transform:Q+"(0, "+R+"px, 0)",top:!w?R:"",borderColor:"transparent "+K};s._css={backgroundColor:"#"+L.HEX};l._css={transform:Q+"("+W+"px, 0, 0)",left:!w?W:"",borderColor:M+" transparent"};A._css={backgroundColor:Z?"":X,color:Z?"":L.rgbaMixBGMixCustom.luminance>0.22?V:P};A.text=Z?"":T!==X?X:"";N!==f?q(N):h(q)}function q(K){G.css(G._css);E.css(E._css);H.css(H._css);s.css(s._css);l.css(l._css);B.doRender&&A.css(A._css);A.text&&A.val(A.text);B.renderCallback.call(c,A,typeof K==="boolean"?K:f)}r.fn.colorPicker=function(K){var M=this,L=function(){};K=r.extend({animationSpeed:150,GPU:true,doRender:true,customBG:"#FFF",opacity:true,renderCallback:L,buildCallback:L,positionCallback:L,body:document.body,scrollResize:true,gap:4,dark:"#222",light:"#DDD"},K);!c&&K.scrollResize&&r(x).on("resize.tcp scroll.tcp",function(){if(c.$trigger){c.toggle.call(c.$trigger[0],true)}});g=g.add(this);this.colorPicker=c||new F(K);this.options=K;r(K.body).off(".tcp").on(C,function(N){g.add(i).add(r(i).find(N.target)).index(N.target)===-1&&n()});return this.on("focusin.tcp click.tcp",function(N){c.color.options=r.extend(c.color.options,B=M.options);n.call(this,N)}).on("change.tcp",function(){p.setColor(this.value||"#FFF");M.colorPicker.render(true)}).each(function(){var O=t(this),P=O.split("("),N=d(r(this));N.data("colorMode",P[1]?P[0].substr(0,3):"HEX").attr("readonly",B.preventFocus);K.doRender&&N.css({"background-color":O,color:function(){return p.setColor(O).rgbaMixBGMixCustom.luminance>0.22?K.dark:K.light}})})};r.fn.colorPicker.destroy=function(){r("*").off(".tcp");c.toggle(false);g=r()}}));