]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/imgareaselect/jquery.imgareaselect.min.js
WordPress 4.7
[autoinstalls/wordpress.git] / wp-includes / js / imgareaselect / jquery.imgareaselect.min.js
index 0f949681fefd065aab5ccb003fe7d1a656b6397a..c57fd24505c30034fc45b7201b02079be9284ae0 100644 (file)
@@ -1 +1 @@
-(function(e){var b=Math.abs,a=Math.max,d=Math.min,c=Math.round;function f(){return e("<div/>")}e.imgAreaSelect=function(s,X){var az=e(s),Z,av=f(),ai=f(),K=f().add(f()).add(f()).add(f()),ab=f().add(f()).add(f()).add(f()),O=e([]),V,n,q,aC={left:0,top:0},Q,j,C,P={left:0,top:0},D=0,ag="absolute",T,S,ad,ac,L,E,U,W,am,Y,N,A,aD,z,aB,y={x1:0,y1:0,x2:0,y2:0,width:0,height:0},p=document.documentElement,l,au,ap,aj,af,aq,x;function J(h){return h+aC.left-P.left}function I(h){return h+aC.top-P.top}function H(h){return h-aC.left+P.left}function B(h){return h-aC.top+P.top}function ao(h){return h.pageX-P.left}function al(h){return h.pageY-P.top}function G(h){var o=h||ad,i=h||ac;return{x1:c(y.x1*o),y1:c(y.y1*i),x2:c(y.x2*o),y2:c(y.y2*i),width:c(y.x2*o)-c(y.x1*o),height:c(y.y2*i)-c(y.y1*i)}}function ah(i,w,h,o,aE){var aG=aE||ad,aF=aE||ac;y={x1:c(i/aG||0),y1:c(w/aF||0),x2:c(h/aG||0),y2:c(o/aF||0)};y.width=y.x2-y.x1;y.height=y.y2-y.y1}function ar(){if(!az.width()){return}aC={left:c(az.offset().left),top:c(az.offset().top)};Q=az.innerWidth();j=az.innerHeight();aC.top+=(az.outerHeight()-j)>>1;aC.left+=(az.outerWidth()-Q)>>1;E=c(X.minWidth/ad)||0;U=c(X.minHeight/ac)||0;W=c(d(X.maxWidth/ad||1<<24,Q));am=c(d(X.maxHeight/ac||1<<24,j));if(e().jquery=="1.3.2"&&ag=="fixed"&&!p.getBoundingClientRect){aC.top+=a(document.body.scrollTop,p.scrollTop);aC.left+=a(document.body.scrollLeft,p.scrollLeft)}P=/absolute|relative/.test(C.css("position"))?{left:c(C.offset().left)-C.scrollLeft(),top:c(C.offset().top)-C.scrollTop()}:ag=="fixed"?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0};n=J(0);q=I(0);if(y.x2>Q||y.y2>j){ay()}}function aa(h){if(!N){return}av.css({left:J(y.x1),top:I(y.y1)}).add(ai).width(af=y.width).height(aq=y.height);ai.add(K).add(O).css({left:0,top:0});K.width(a(af-K.outerWidth()+K.innerWidth(),0)).height(a(aq-K.outerHeight()+K.innerHeight(),0));e(ab[0]).css({left:n,top:q,width:y.x1,height:j});e(ab[1]).css({left:n+y.x1,top:q,width:af,height:y.y1});e(ab[2]).css({left:n+y.x2,top:q,width:Q-y.x2,height:j});e(ab[3]).css({left:n+y.x1,top:q+y.y2,width:af,height:j-y.y2});af-=O.outerWidth();aq-=O.outerHeight();switch(O.length){case 8:e(O[4]).css({left:af>>1});e(O[5]).css({left:af,top:aq>>1});e(O[6]).css({left:af>>1,top:aq});e(O[7]).css({top:aq>>1});case 4:O.slice(1,3).css({left:af});O.slice(2,4).css({top:aq})}if(h!==false){if(e.imgAreaSelect.keyPress!=aw){e(document).unbind(e.imgAreaSelect.keyPress,e.imgAreaSelect.onKeyPress)}if(X.keys){e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress=aw)}}if(e.browser.msie&&K.outerWidth()-K.innerWidth()==2){K.css("margin",0);setTimeout(function(){K.css("margin","auto")},0)}}function u(h){ar();aa(h);A=J(y.x1);aD=I(y.y1);z=J(y.x2);aB=I(y.y2)}function ak(h,i){X.fadeSpeed?h.fadeOut(X.fadeSpeed,i):h.hide()}function F(i){var h=H(ao(i))-y.x1,o=B(al(i))-y.y1;if(!x){ar();x=true;av.one("mouseout",function(){x=false})}L="";if(X.resizable){if(o<=X.resizeMargin){L="n"}else{if(o>=y.height-X.resizeMargin){L="s"}}if(h<=X.resizeMargin){L+="w"}else{if(h>=y.width-X.resizeMargin){L+="e"}}}av.css("cursor",L?L+"-resize":X.movable?"move":"");if(V){V.toggle()}}function an(h){e("body").css("cursor","");if(X.autoHide||y.width*y.height==0){ak(av.add(ab),function(){e(this).hide()})}e(document).unbind("mousemove",ae);av.mousemove(F);X.onSelectEnd(s,G())}function t(h){if(h.which!=1){return false}ar();if(L){e("body").css("cursor",L+"-resize");A=J(y[/w/.test(L)?"x2":"x1"]);aD=I(y[/n/.test(L)?"y2":"y1"]);e(document).mousemove(ae).one("mouseup",an);av.unbind("mousemove",F)}else{if(X.movable){T=n+y.x1-ao(h);S=q+y.y1-al(h);av.unbind("mousemove",F);e(document).mousemove(g).one("mouseup",function(){X.onSelectEnd(s,G());e(document).unbind("mousemove",g);av.mousemove(F)})}else{az.mousedown(h)}}return false}function r(h){if(Y){if(h){z=a(n,d(n+Q,A+b(aB-aD)*Y*(z>A||-1)));aB=c(a(q,d(q+j,aD+b(z-A)/Y*(aB>aD||-1))));z=c(z)}else{aB=a(q,d(q+j,aD+b(z-A)/Y*(aB>aD||-1)));z=c(a(n,d(n+Q,A+b(aB-aD)*Y*(z>A||-1))));aB=c(aB)}}}function ay(){A=d(A,n+Q);aD=d(aD,q+j);if(b(z-A)<E){z=A-E*(z<A||-1);if(z<n){A=n+E}else{if(z>n+Q){A=n+Q-E}}}if(b(aB-aD)<U){aB=aD-U*(aB<aD||-1);if(aB<q){aD=q+U}else{if(aB>q+j){aD=q+j-U}}}z=a(n,d(z,n+Q));aB=a(q,d(aB,q+j));r(b(z-A)<b(aB-aD)*Y);if(b(z-A)>W){z=A-W*(z<A||-1);r()}if(b(aB-aD)>am){aB=aD-am*(aB<aD||-1);r(true)}y={x1:H(d(A,z)),x2:H(a(A,z)),y1:B(d(aD,aB)),y2:B(a(aD,aB)),width:b(z-A),height:b(aB-aD)};aa();X.onSelectChange(s,G())}function ae(h){z=/w|e|^$/.test(L)||Y?ao(h):J(y.x2);aB=/n|s|^$/.test(L)||Y?al(h):I(y.y2);ay();return false}function R(h,i){z=(A=h)+y.width;aB=(aD=i)+y.height;e.extend(y,{x1:H(A),y1:B(aD),x2:H(z),y2:B(aB)});aa();X.onSelectChange(s,G())}function g(h){A=a(n,d(T+ao(h),n+Q-y.width));aD=a(q,d(S+al(h),q+j-y.height));R(A,aD);h.preventDefault();return false}function aA(){e(document).unbind("mousemove",aA);ar();z=A;aB=aD;ay();L="";if(!ab.is(":visible")){av.add(ab).hide().fadeIn(X.fadeSpeed||0)}N=true;e(document).unbind("mouseup",at).mousemove(ae).one("mouseup",an);av.unbind("mousemove",F);X.onSelectStart(s,G())}function at(){e(document).unbind("mousemove",aA).unbind("mouseup",at);ak(av.add(ab));ah(H(A),B(aD),H(A),B(aD));if(!(this instanceof e.imgAreaSelect)){X.onSelectChange(s,G());X.onSelectEnd(s,G())}}function m(h){if(h.which!=1||ab.is(":animated")){return false}ar();T=A=ao(h);S=aD=al(h);e(document).mousemove(aA).mouseup(at);return false}function v(){u(false)}function ax(){Z=true;M(X=e.extend({classPrefix:"imgareaselect",movable:true,parent:"body",resizable:true,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},X));av.add(ab).css({visibility:""});if(X.show){N=true;ar();aa();av.add(ab).hide().fadeIn(X.fadeSpeed||0)}setTimeout(function(){X.onInit(s,G())},0)}var aw=function(w){var h=X.keys,aE,o,i=w.keyCode;aE=!isNaN(h.alt)&&(w.altKey||w.originalEvent.altKey)?h.alt:!isNaN(h.ctrl)&&w.ctrlKey?h.ctrl:!isNaN(h.shift)&&w.shiftKey?h.shift:!isNaN(h.arrows)?h.arrows:10;if(h.arrows=="resize"||(h.shift=="resize"&&w.shiftKey)||(h.ctrl=="resize"&&w.ctrlKey)||(h.alt=="resize"&&(w.altKey||w.originalEvent.altKey))){switch(i){case 37:aE=-aE;case 39:o=a(A,z);A=d(A,z);z=a(o+aE,A);r();break;case 38:aE=-aE;case 40:o=a(aD,aB);aD=d(aD,aB);aB=a(o+aE,aD);r(true);break;default:return}ay()}else{A=d(A,z);aD=d(aD,aB);switch(i){case 37:R(a(A-aE,n),aD);break;case 38:R(A,a(aD-aE,q));break;case 39:R(A+d(aE,Q-H(z)),aD);break;case 40:R(A,aD+d(aE,j-B(aB)));break;default:return}}return false};function k(h,o){for(var i in o){if(X[i]!==undefined){h.css(o[i],X[i])}}}function M(h){if(h.parent){(C=e(h.parent)).append(av.add(ab))}e.extend(X,h);ar();if(h.handles!=null){O.remove();O=e([]);ap=h.handles?h.handles=="corners"?4:8:0;while(ap--){O=O.add(f())}O.addClass(X.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:D+1||1});if(!parseInt(O.css("width"))>=0){O.width(5).height(5)}if(aj=X.borderWidth){O.css({borderWidth:aj,borderStyle:"solid"})}k(O,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}ad=X.imageWidth/Q||1;ac=X.imageHeight/j||1;if(h.x1!=null){ah(h.x1,h.y1,h.x2,h.y2);h.show=!h.hide}if(h.keys){X.keys=e.extend({shift:1,ctrl:"resize"},h.keys)}ab.addClass(X.classPrefix+"-outer");ai.addClass(X.classPrefix+"-selection");for(ap=0;ap++<4;){e(K[ap-1]).addClass(X.classPrefix+"-border"+ap)}k(ai,{selectionColor:"background-color",selectionOpacity:"opacity"});k(K,{borderOpacity:"opacity",borderWidth:"border-width"});k(ab,{outerColor:"background-color",outerOpacity:"opacity"});if(aj=X.borderColor1){e(K[0]).css({borderStyle:"solid",borderColor:aj})}if(aj=X.borderColor2){e(K[1]).css({borderStyle:"dashed",borderColor:aj})}av.append(ai.add(K).add(V).add(O));if(e.browser.msie){if(aj=ab.css("filter").match(/opacity=(\d+)/)){ab.css("opacity",aj[1]/100)}if(aj=K.css("filter").match(/opacity=(\d+)/)){K.css("opacity",aj[1]/100)}}if(h.hide){ak(av.add(ab))}else{if(h.show&&Z){N=true;av.add(ab).fadeIn(X.fadeSpeed||0);u()}}Y=(au=(X.aspectRatio||"").split(/:/))[0]/au[1];az.add(ab).unbind("mousedown",m);if(X.disable||X.enable===false){av.unbind("mousemove",F).unbind("mousedown",t);e(window).unbind("resize",v)}else{if(X.enable||X.disable===false){if(X.resizable||X.movable){av.mousemove(F).mousedown(t)}e(window).resize(v)}if(!X.persistent){az.add(ab).mousedown(m)}}X.enable=X.disable=undefined}this.remove=function(){M({disable:true});av.add(ab).remove()};this.getOptions=function(){return X};this.setOptions=M;this.getSelection=G;this.setSelection=ah;this.cancelSelection=at;this.update=u;l=az;while(l.length){D=a(D,!isNaN(l.css("z-index"))?l.css("z-index"):D);if(l.css("position")=="fixed"){ag="fixed"}l=l.parent(":not(body)")}D=X.zIndex||D;if(e.browser.msie){az.attr("unselectable","on")}e.imgAreaSelect.keyPress=e.browser.msie||e.browser.safari?"keydown":"keypress";if(e.browser.opera){V=f().css({width:"100%",height:"100%",position:"absolute",zIndex:D+2||2})}av.add(ab).css({visibility:"hidden",position:ag,overflow:"hidden",zIndex:D||"0"});av.css({zIndex:D+2||2});ai.add(K).css({position:"absolute",fontSize:0});s.complete||s.readyState=="complete"||!az.is("img")?ax():az.one("load",ax);if(!Z&&e.browser.msie&&e.browser.version>=7){s.src=s.src}};e.fn.imgAreaSelect=function(g){g=g||{};this.each(function(){if(e(this).data("imgAreaSelect")){if(g.remove){e(this).data("imgAreaSelect").remove();e(this).removeData("imgAreaSelect")}else{e(this).data("imgAreaSelect").setOptions(g)}}else{if(!g.remove){if(g.enable===undefined&&g.disable===undefined){g.enable=true}e(this).data("imgAreaSelect",new e.imgAreaSelect(this,g))}}});if(g.instance){return e(this).data("imgAreaSelect")}return this}})(jQuery);
\ No newline at end of file
+!function(e){function t(){return e("<div/>")}var o=Math.abs,i=Math.max,s=Math.min,n=Math.round;e.imgAreaSelect=function(r,c){function d(e){return e+gt.left-vt.left}function a(e){return e+gt.top-vt.top}function u(e){return e-gt.left+vt.left}function l(e){return e-gt.top+vt.top}function h(e){return i(e.pageX||0,m(e).x)-vt.left}function f(e){return i(e.pageY||0,m(e).y)-vt.top}function m(e){var t=e.originalEvent||{};return t.touches&&t.touches.length?{x:t.touches[0].pageX,y:t.touches[0].pageY}:{x:0,y:0}}function p(e){var t=e||B,o=e||Q;return{x1:n(wt.x1*t),y1:n(wt.y1*o),x2:n(wt.x2*t),y2:n(wt.y2*o),width:n(wt.x2*t)-n(wt.x1*t),height:n(wt.y2*o)-n(wt.y1*o)}}function y(e,t,o,i,s){var r=s||B,c=s||Q;wt={x1:n(e/r||0),y1:n(t/c||0),x2:n(o/r||0),y2:n(i/c||0)},wt.width=wt.x2-wt.x1,wt.height=wt.y2-wt.y1}function g(){T&&lt.width()&&(gt={left:n(lt.offset().left),top:n(lt.offset().top)},R=lt.innerWidth(),X=lt.innerHeight(),gt.top+=lt.outerHeight()-X>>1,gt.left+=lt.outerWidth()-R>>1,G=n(c.minWidth/B)||0,J=n(c.minHeight/Q)||0,U=n(s(c.maxWidth/B||1<<24,R)),V=n(s(c.maxHeight/Q||1<<24,X)),"1.3.2"!=e().jquery||"fixed"!=xt||St.getBoundingClientRect||(gt.top+=i(document.body.scrollTop,St.scrollTop),gt.left+=i(document.body.scrollLeft,St.scrollLeft)),vt=/absolute|relative/.test(Y.css("position"))?{left:n(Y.offset().left)-Y.scrollLeft(),top:n(Y.offset().top)-Y.scrollTop()}:"fixed"==xt?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0},j=d(0),D=a(0),(wt.x2>R||wt.y2>X)&&C())}function v(t){if(_){switch(ht.css({left:d(wt.x1),top:a(wt.y1)}).add(ft).width(dt=wt.width).height(at=wt.height),ft.add(mt).add(yt).css({left:0,top:0}),mt.width(i(dt-mt.outerWidth()+mt.innerWidth(),0)).height(i(at-mt.outerHeight()+mt.innerHeight(),0)),e(pt[0]).css({left:j,top:D,width:wt.x1,height:X}),e(pt[1]).css({left:j+wt.x1,top:D,width:dt,height:wt.y1}),e(pt[2]).css({left:j+wt.x2,top:D,width:R-wt.x2,height:X}),e(pt[3]).css({left:j+wt.x1,top:D+wt.y2,width:dt,height:X-wt.y2}),dt-=yt.outerWidth(),at-=yt.outerHeight(),yt.length){case 8:e(yt[4]).css({left:dt>>1}),e(yt[5]).css({left:dt,top:at>>1}),e(yt[6]).css({left:dt>>1,top:at}),e(yt[7]).css({top:at>>1});case 4:yt.slice(1,3).css({left:dt}),yt.slice(2,4).css({top:at})}t!==!1&&(e.imgAreaSelect.onKeyPress!=kt&&e(document).unbind(e.imgAreaSelect.keyPress,e.imgAreaSelect.onKeyPress),c.keys&&e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress=kt)),Ct&&mt.outerWidth()-mt.innerWidth()==2&&(mt.css("margin",0),setTimeout(function(){mt.css("margin","auto")},0))}}function b(e){g(),v(e),et=d(wt.x1),tt=a(wt.y1),ot=d(wt.x2),it=a(wt.y2)}function x(e,t){c.fadeSpeed?e.fadeOut(c.fadeSpeed,t):e.hide()}function w(e){var t=u(h(e))-wt.x1,o=l(f(e))-wt.y1;ut||(g(),ut=!0,ht.one("mouseout",function(){ut=!1})),F="",c.resizable&&(o<=c.resizeMargin?F="n":o>=wt.height-c.resizeMargin&&(F="s"),t<=c.resizeMargin?F+="w":t>=wt.width-c.resizeMargin&&(F+="e")),ht.css("cursor",F?F+"-resize":c.movable?"move":""),L&&L.toggle()}function S(){e("body").css("cursor",""),(c.autoHide||wt.width*wt.height==0)&&x(ht.add(pt),function(){e(this).hide()}),e(document).off("mousemove touchmove",A),ht.on("mousemove touchmove",w),c.onSelectEnd(r,p())}function z(t){return"mousedown"==t.type&&1!=t.which?!1:(w(t),g(),F?(e("body").css("cursor",F+"-resize"),et=d(wt[/w/.test(F)?"x2":"x1"]),tt=a(wt[/n/.test(F)?"y2":"y1"]),e(document).on("mousemove touchmove",A).one("mouseup touchend",S),ht.off("mousemove touchmove",w)):c.movable?($=j+wt.x1-h(t),q=D+wt.y1-f(t),ht.off("mousemove touchmove",w),e(document).on("mousemove touchmove",I).one("mouseup touchend",function(){c.onSelectEnd(r,p()),e(document).off("mousemove touchmove",I),ht.on("mousemove touchmove",w)})):lt.mousedown(t),!1)}function k(e){Z&&(e?(ot=i(j,s(j+R,et+o(it-tt)*Z*(ot>et||-1))),it=n(i(D,s(D+X,tt+o(ot-et)/Z*(it>tt||-1)))),ot=n(ot)):(it=i(D,s(D+X,tt+o(ot-et)/Z*(it>tt||-1))),ot=n(i(j,s(j+R,et+o(it-tt)*Z*(ot>et||-1)))),it=n(it)))}function C(){et=s(et,j+R),tt=s(tt,D+X),o(ot-et)<G&&(ot=et-G*(et>ot||-1),j>ot?et=j+G:ot>j+R&&(et=j+R-G)),o(it-tt)<J&&(it=tt-J*(tt>it||-1),D>it?tt=D+J:it>D+X&&(tt=D+X-J)),ot=i(j,s(ot,j+R)),it=i(D,s(it,D+X)),k(o(ot-et)<o(it-tt)*Z),o(ot-et)>U&&(ot=et-U*(et>ot||-1),k()),o(it-tt)>V&&(it=tt-V*(tt>it||-1),k(!0)),wt={x1:u(s(et,ot)),x2:u(i(et,ot)),y1:l(s(tt,it)),y2:l(i(tt,it)),width:o(ot-et),height:o(it-tt)},v(),c.onSelectChange(r,p())}function A(e){return ot=/w|e|^$/.test(F)||Z?h(e):d(wt.x2),it=/n|s|^$/.test(F)||Z?f(e):a(wt.y2),C(),!1}function W(t,o){ot=(et=t)+wt.width,it=(tt=o)+wt.height,e.extend(wt,{x1:u(et),y1:l(tt),x2:u(ot),y2:l(it)}),v(),c.onSelectChange(r,p())}function I(e){return et=i(j,s($+h(e),j+R-wt.width)),tt=i(D,s(q+f(e),D+X-wt.height)),W(et,tt),e.preventDefault(),!1}function K(){e(document).off("mousemove touchmove",K),g(),ot=et,it=tt,C(),F="",pt.is(":visible")||ht.add(pt).hide().fadeIn(c.fadeSpeed||0),_=!0,e(document).off("mouseup touchend",P).on("mousemove touchmove",A).one("mouseup touchend",S),ht.off("mousemove touchmove",w),c.onSelectStart(r,p())}function P(){e(document).off("mousemove touchmove",K).off("mouseup touchend",P),x(ht.add(pt)),y(u(et),l(tt),u(et),l(tt)),this instanceof e.imgAreaSelect||(c.onSelectChange(r,p()),c.onSelectEnd(r,p()))}function N(t){return 1!=t.which||pt.is(":animated")?!1:(g(),$=et=h(t),q=tt=f(t),e(document).on({"mousemove touchmove":K,"mouseup touchend":P}),!1)}function H(){b(!1)}function M(){T=!0,O(c=e.extend({classPrefix:"imgareaselect",movable:!0,parent:"body",resizable:!0,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},c)),ht.add(pt).css({visibility:""}),c.show&&(_=!0,g(),v(),ht.add(pt).hide().fadeIn(c.fadeSpeed||0)),setTimeout(function(){c.onInit(r,p())},0)}function E(e,t){for(var o in t)void 0!==c[o]&&e.css(t[o],c[o])}function O(o){if(o.parent&&(Y=e(o.parent)).append(ht.add(pt)),e.extend(c,o),g(),null!=o.handles){for(yt.remove(),yt=e([]),rt=o.handles?"corners"==o.handles?4:8:0;rt--;)yt=yt.add(t());yt.addClass(c.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:bt+1||1}),!parseInt(yt.css("width"))>=0&&yt.width(5).height(5),(ct=c.borderWidth)&&yt.css({borderWidth:ct,borderStyle:"solid"}),E(yt,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}for(B=c.imageWidth/R||1,Q=c.imageHeight/X||1,null!=o.x1&&(y(o.x1,o.y1,o.x2,o.y2),o.show=!o.hide),o.keys&&(c.keys=e.extend({shift:1,ctrl:"resize"},o.keys)),pt.addClass(c.classPrefix+"-outer"),ft.addClass(c.classPrefix+"-selection"),rt=0;rt++<4;)e(mt[rt-1]).addClass(c.classPrefix+"-border"+rt);E(ft,{selectionColor:"background-color",selectionOpacity:"opacity"}),E(mt,{borderOpacity:"opacity",borderWidth:"border-width"}),E(pt,{outerColor:"background-color",outerOpacity:"opacity"}),(ct=c.borderColor1)&&e(mt[0]).css({borderStyle:"solid",borderColor:ct}),(ct=c.borderColor2)&&e(mt[1]).css({borderStyle:"dashed",borderColor:ct}),ht.append(ft.add(mt).add(L)).append(yt),Ct&&((ct=(pt.css("filter")||"").match(/opacity=(\d+)/))&&pt.css("opacity",ct[1]/100),(ct=(mt.css("filter")||"").match(/opacity=(\d+)/))&&mt.css("opacity",ct[1]/100)),o.hide?x(ht.add(pt)):o.show&&T&&(_=!0,ht.add(pt).fadeIn(c.fadeSpeed||0),b()),Z=(nt=(c.aspectRatio||"").split(/:/))[0]/nt[1],lt.add(pt).unbind("mousedown",N),c.disable||c.enable===!1?(ht.off({"mousemove touchmove":w,"mousedown touchstart":z}),e(window).off("resize",H)):((c.enable||c.disable===!1)&&((c.resizable||c.movable)&&ht.on({"mousemove touchmove":w,"mousedown touchstart":z}),e(window).resize(H)),c.persistent||lt.add(pt).on("mousedown touchstart",N)),c.enable=c.disable=void 0}var T,L,j,D,R,X,Y,$,q,B,Q,F,G,J,U,V,Z,_,et,tt,ot,it,st,nt,rt,ct,dt,at,ut,lt=e(r),ht=t(),ft=t(),mt=t().add(t()).add(t()).add(t()),pt=t().add(t()).add(t()).add(t()),yt=e([]),gt={left:0,top:0},vt={left:0,top:0},bt=0,xt="absolute",wt={x1:0,y1:0,x2:0,y2:0,width:0,height:0},St=document.documentElement,zt=navigator.userAgent,kt=function(e){var t,o,n=c.keys,r=e.keyCode;if(t=isNaN(n.alt)||!e.altKey&&!e.originalEvent.altKey?!isNaN(n.ctrl)&&e.ctrlKey?n.ctrl:!isNaN(n.shift)&&e.shiftKey?n.shift:isNaN(n.arrows)?10:n.arrows:n.alt,"resize"==n.arrows||"resize"==n.shift&&e.shiftKey||"resize"==n.ctrl&&e.ctrlKey||"resize"==n.alt&&(e.altKey||e.originalEvent.altKey)){switch(r){case 37:t=-t;case 39:o=i(et,ot),et=s(et,ot),ot=i(o+t,et),k();break;case 38:t=-t;case 40:o=i(tt,it),tt=s(tt,it),it=i(o+t,tt),k(!0);break;default:return}C()}else switch(et=s(et,ot),tt=s(tt,it),r){case 37:W(i(et-t,j),tt);break;case 38:W(et,i(tt-t,D));break;case 39:W(et+s(t,R-u(ot)),tt);break;case 40:W(et,tt+s(t,X-l(it)));break;default:return}return!1};this.remove=function(){O({disable:!0}),ht.add(pt).remove()},this.getOptions=function(){return c},this.setOptions=O,this.getSelection=p,this.setSelection=y,this.cancelSelection=P,this.update=b;var Ct=(/msie ([\w.]+)/i.exec(zt)||[])[1],At=/opera/i.test(zt),Wt=/webkit/i.test(zt)&&!/chrome/i.test(zt);for(st=lt;st.length;)bt=i(bt,isNaN(st.css("z-index"))?bt:st.css("z-index")),"fixed"==st.css("position")&&(xt="fixed"),st=st.parent(":not(body)");bt=c.zIndex||bt,Ct&&lt.attr("unselectable","on"),e.imgAreaSelect.keyPress=Ct||Wt?"keydown":"keypress",At&&(L=t().css({width:"100%",height:"100%",position:"absolute",zIndex:bt+2||2})),ht.add(pt).css({visibility:"hidden",position:xt,overflow:"hidden",zIndex:bt||"0"}),ht.css({zIndex:bt+2||2}),ft.add(mt).css({position:"absolute",fontSize:0}),r.complete||"complete"==r.readyState||!lt.is("img")?M():lt.one("load",M),!T&&Ct&&Ct>=7&&(r.src=r.src)},e.fn.imgAreaSelect=function(t){return t=t||{},this.each(function(){e(this).data("imgAreaSelect")?t.remove?(e(this).data("imgAreaSelect").remove(),e(this).removeData("imgAreaSelect")):e(this).data("imgAreaSelect").setOptions(t):t.remove||(void 0===t.enable&&void 0===t.disable&&(t.enable=!0),e(this).data("imgAreaSelect",new e.imgAreaSelect(this,t)))}),t.instance?e(this).data("imgAreaSelect"):this}}(jQuery);
\ No newline at end of file