src/myams/resources/js/ext/jquery-imgareaselect-0.9.11-rc1.min.js
changeset 5 c9c69b13d884
parent 0 f05d7aea098a
--- a/src/myams/resources/js/ext/jquery-imgareaselect-0.9.11-rc1.min.js	Wed Jul 15 15:04:38 2020 +0200
+++ b/src/myams/resources/js/ext/jquery-imgareaselect-0.9.11-rc1.min.js	Wed Jul 15 15:39:56 2020 +0200
@@ -1,1 +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(R,af){var N=e(R),u,B=f(),F=f(),at=f().add(f()).add(f()).add(f()),v=f().add(f()).add(f()).add(f()),aB=e([]),am,U,ar,aC={left:0,top:0},T,aD,p,X={left:0,top:0},g=0,an="absolute",aq,ap,ad,ac,t,q,ao,k,x,aH,ak,E,n,D,l,aF={x1:0,y1:0,x2:0,y2:0,width:0,height:0},G=document.documentElement,V=navigator.userAgent,ab,S,P,O,L,Q,J;function aa(h){return h+aC.left-X.left}function Z(h){return h+aC.top-X.top}function ay(h){return h-aC.left+X.left}function ax(h){return h-aC.top+X.top}function A(h){return h.pageX-X.left}function z(h){return h.pageY-X.top}function aw(h){var o=h||ad,i=h||ac;return{x1:c(aF.x1*o),y1:c(aF.y1*i),x2:c(aF.x2*o),y2:c(aF.y2*i),width:c(aF.x2*o)-c(aF.x1*o),height:c(aF.y2*i)-c(aF.y1*i)}}function au(i,w,h,o,aI){var aK=aI||ad,aJ=aI||ac;aF={x1:c(i/aK||0),y1:c(w/aJ||0),x2:c(h/aK||0),y2:c(o/aJ||0)};aF.width=aF.x2-aF.x1;aF.height=aF.y2-aF.y1}function m(){if(!u||!N.width()){return}aC={left:c(N.offset().left),top:c(N.offset().top)};T=N.innerWidth();aD=N.innerHeight();aC.top+=(N.outerHeight()-aD)>>1;aC.left+=(N.outerWidth()-T)>>1;q=c(af.minWidth/ad)||0;ao=c(af.minHeight/ac)||0;k=c(d(af.maxWidth/ad||1<<24,T));x=c(d(af.maxHeight/ac||1<<24,aD));if(e().jquery=="1.3.2"&&an=="fixed"&&!G.getBoundingClientRect){aC.top+=a(document.body.scrollTop,G.scrollTop);aC.left+=a(document.body.scrollLeft,G.scrollLeft)}X=/absolute|relative/.test(p.css("position"))?{left:c(p.offset().left)-p.scrollLeft(),top:c(p.offset().top)-p.scrollTop()}:an=="fixed"?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0};U=aa(0);ar=Z(0);if(aF.x2>T||aF.y2>aD){aE()}}function K(h){if(!ak){return}B.css({left:aa(aF.x1),top:Z(aF.y1)}).add(F).width(L=aF.width).height(Q=aF.height);F.add(at).add(aB).css({left:0,top:0});at.width(a(L-at.outerWidth()+at.innerWidth(),0)).height(a(Q-at.outerHeight()+at.innerHeight(),0));e(v[0]).css({left:U,top:ar,width:aF.x1,height:aD});e(v[1]).css({left:U+aF.x1,top:ar,width:L,height:aF.y1});e(v[2]).css({left:U+aF.x2,top:ar,width:T-aF.x2,height:aD});e(v[3]).css({left:U+aF.x1,top:ar+aF.y2,width:L,height:aD-aF.y2});L-=aB.outerWidth();Q-=aB.outerHeight();switch(aB.length){case 8:e(aB[4]).css({left:L>>1});e(aB[5]).css({left:L,top:Q>>1});e(aB[6]).css({left:L>>1,top:Q});e(aB[7]).css({top:Q>>1});case 4:aB.slice(1,3).css({left:L});aB.slice(2,4).css({top:Q})}if(h!==false){if(e.imgAreaSelect.onKeyPress!=az){e(document).unbind(e.imgAreaSelect.keyPress,e.imgAreaSelect.onKeyPress)}if(af.keys){e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress=az)}}if(aj&&at.outerWidth()-at.innerWidth()==2){at.css("margin",0);setTimeout(function(){at.css("margin","auto")},0)}}function y(h){m();K(h);E=aa(aF.x1);n=Z(aF.y1);D=aa(aF.x2);l=Z(aF.y2)}function ai(h,i){af.fadeSpeed?h.fadeOut(af.fadeSpeed,i):h.hide()}function I(i){var h=ay(A(i))-aF.x1,o=ax(z(i))-aF.y1;if(!J){m();J=true;B.one("mouseout",function(){J=false})}t="";if(af.resizable){if(o<=af.resizeMargin){t="n"}else{if(o>=aF.height-af.resizeMargin){t="s"}}if(h<=af.resizeMargin){t+="w"}else{if(h>=aF.width-af.resizeMargin){t+="e"}}}B.css("cursor",t?t+"-resize":af.movable?"move":"");if(am){am.toggle()}}function j(h){e("body").css("cursor","");if(af.autoHide||aF.width*aF.height==0){ai(B.add(v),function(){e(this).hide()})}e(document).unbind("mousemove",ag);B.mousemove(I);af.onSelectEnd(R,aw())}function aA(h){if(h.which!=1){return false}m();if(t){e("body").css("cursor",t+"-resize");E=aa(aF[/w/.test(t)?"x2":"x1"]);n=Z(aF[/n/.test(t)?"y2":"y1"]);e(document).mousemove(ag).one("mouseup",j);B.unbind("mousemove",I)}else{if(af.movable){aq=U+aF.x1-A(h);ap=ar+aF.y1-z(h);B.unbind("mousemove",I);e(document).mousemove(ae).one("mouseup",function(){af.onSelectEnd(R,aw());e(document).unbind("mousemove",ae);B.mousemove(I)})}else{N.mousedown(h)}}return false}function M(h){if(aH){if(h){D=a(U,d(U+T,E+b(l-n)*aH*(D>E||-1)));l=c(a(ar,d(ar+aD,n+b(D-E)/aH*(l>n||-1))));D=c(D)}else{l=a(ar,d(ar+aD,n+b(D-E)/aH*(l>n||-1)));D=c(a(U,d(U+T,E+b(l-n)*aH*(D>E||-1))));l=c(l)}}}function aE(){E=d(E,U+T);n=d(n,ar+aD);if(b(D-E)<q){D=E-q*(D<E||-1);if(D<U){E=U+q}else{if(D>U+T){E=U+T-q}}}if(b(l-n)<ao){l=n-ao*(l<n||-1);if(l<ar){n=ar+ao}else{if(l>ar+aD){n=ar+aD-ao}}}D=a(U,d(D,U+T));l=a(ar,d(l,ar+aD));M(b(D-E)<b(l-n)*aH);if(b(D-E)>k){D=E-k*(D<E||-1);M()}if(b(l-n)>x){l=n-x*(l<n||-1);M(true)}aF={x1:ay(d(E,D)),x2:ay(a(E,D)),y1:ax(d(n,l)),y2:ax(a(n,l)),width:b(D-E),height:b(l-n)};K();af.onSelectChange(R,aw())}function ag(h){D=/w|e|^$/.test(t)||aH?A(h):aa(aF.x2);l=/n|s|^$/.test(t)||aH?z(h):Z(aF.y2);aE();return false}function W(h,i){D=(E=h)+aF.width;l=(n=i)+aF.height;e.extend(aF,{x1:ay(E),y1:ax(n),x2:ay(D),y2:ax(l)});K();af.onSelectChange(R,aw())}function ae(h){E=a(U,d(aq+A(h),U+T-aF.width));n=a(ar,d(ap+z(h),ar+aD-aF.height));W(E,n);h.preventDefault();return false}function r(){e(document).unbind("mousemove",r);m();D=E;l=n;aE();t="";if(!v.is(":visible")){B.add(v).hide().fadeIn(af.fadeSpeed||0)}ak=true;e(document).unbind("mouseup",Y).mousemove(ag).one("mouseup",j);B.unbind("mousemove",I);af.onSelectStart(R,aw())}function Y(){e(document).unbind("mousemove",r).unbind("mouseup",Y);ai(B.add(v));au(ay(E),ax(n),ay(E),ax(n));if(!(this instanceof e.imgAreaSelect)){af.onSelectChange(R,aw());af.onSelectEnd(R,aw())}}function aG(h){if(h.which!=1||v.is(":animated")){return false}m();aq=E=A(h);ap=n=z(h);e(document).mousemove(r).mouseup(Y);return false}function al(){y(false)}function s(){u=true;ah(af=e.extend({classPrefix:"imgareaselect",movable:true,parent:"body",resizable:true,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},af));B.add(v).css({visibility:""});if(af.show){ak=true;m();K();B.add(v).hide().fadeIn(af.fadeSpeed||0)}setTimeout(function(){af.onInit(R,aw())},0)}var az=function(w){var h=af.keys,aI,o,i=w.keyCode;aI=!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:aI=-aI;case 39:o=a(E,D);E=d(E,D);D=a(o+aI,E);M();break;case 38:aI=-aI;case 40:o=a(n,l);n=d(n,l);l=a(o+aI,n);M(true);break;default:return}aE()}else{E=d(E,D);n=d(n,l);switch(i){case 37:W(a(E-aI,U),n);break;case 38:W(E,a(n-aI,ar));break;case 39:W(E+d(aI,T-ay(D)),n);break;case 40:W(E,n+d(aI,aD-ax(l)));break;default:return}}return false};function H(h,o){for(var i in o){if(af[i]!==undefined){h.css(o[i],af[i])}}}function ah(h){if(h.parent){(p=e(h.parent)).append(B).append(v)}e.extend(af,h);m();if(h.handles!=null){aB.remove();aB=e([]);P=h.handles?h.handles=="corners"?4:8:0;while(P--){aB=aB.add(f())}aB.addClass(af.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:g+1||1});if(!parseInt(aB.css("width"))>=0){aB.width(5).height(5)}if(O=af.borderWidth){aB.css({borderWidth:O,borderStyle:"solid"})}H(aB,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}ad=af.imageWidth/T||1;ac=af.imageHeight/aD||1;if(h.x1!=null){au(h.x1,h.y1,h.x2,h.y2);h.show=!h.hide}if(h.keys){af.keys=e.extend({shift:1,ctrl:"resize"},h.keys)}v.addClass(af.classPrefix+"-outer");F.addClass(af.classPrefix+"-selection");for(P=0;P++<4;){e(at[P-1]).addClass(af.classPrefix+"-border"+P)}H(F,{selectionColor:"background-color",selectionOpacity:"opacity"});H(at,{borderOpacity:"opacity",borderWidth:"border-width"});H(v,{outerColor:"background-color",outerOpacity:"opacity"});if(O=af.borderColor1){e(at[0]).css({borderStyle:"solid",borderColor:O})}if(O=af.borderColor2){e(at[1]).css({borderStyle:"dashed",borderColor:O})}B.append(F.add(at).add(am)).append(aB);if(aj){if(O=(v.css("filter")||"").match(/opacity=(\d+)/)){v.css("opacity",O[1]/100)}if(O=(at.css("filter")||"").match(/opacity=(\d+)/)){at.css("opacity",O[1]/100)}}if(h.hide){ai(B.add(v))}else{if(h.show&&u){ak=true;B.add(v).fadeIn(af.fadeSpeed||0);y()}}aH=(S=(af.aspectRatio||"").split(/:/))[0]/S[1];N.add(v).unbind("mousedown",aG);if(af.disable||af.enable===false){B.unbind("mousemove",I).unbind("mousedown",aA);e(window).unbind("resize",al)}else{if(af.enable||af.disable===false){if(af.resizable||af.movable){B.mousemove(I).mousedown(aA)}e(window).resize(al)}if(!af.persistent){N.add(v).mousedown(aG)}}af.enable=af.disable=undefined}this.remove=function(){ah({disable:true});B.add(v).remove()};this.getOptions=function(){return af};this.setOptions=ah;this.getSelection=aw;this.setSelection=au;this.cancelSelection=Y;this.update=y;var aj=(/msie ([\w.]+)/i.exec(V)||[])[1],av=/opera/i.test(V),C=/webkit/i.test(V)&&!/chrome/i.test(V);ab=N;while(ab.length){g=a(g,!isNaN(ab.css("z-index"))?ab.css("z-index"):g);ab=ab.parent(":not(body)")}g=af.zIndex||g;if(aj){N.attr("unselectable","on")}e.imgAreaSelect.keyPress=aj||C?"keydown":"keypress";if(av){am=f().css({width:"100%",height:"100%",position:"absolute",zIndex:g+2||2})}B.add(v).css({visibility:"hidden",position:an,overflow:"hidden",zIndex:g||"0"});B.css({zIndex:g+2||2});F.add(at).css({position:"absolute",fontSize:0});R.complete||R.readyState=="complete"||!N.is("img")?s():N.one("load",s);if(!u&&aj&&aj>=7){R.src=R.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){var t=Math.abs,o=Math.max,i=Math.min,n=Math.round;function s(){return e("<div/>")}e.imgAreaSelect=function(d,r){var a,c,l,u,h,f,m,p,y,b,g,x,v,w,S,z,k,C,A,W,I,K,P,N,H,M,O,E,T,L=e(d),j=s(),D=s(),R=s().add(s()).add(s()).add(s()),$=s().add(s()).add(s()).add(s()),q=e([]),B={left:0,top:0},Q={left:0,top:0},X=0,Y="absolute",F={x1:0,y1:0,x2:0,y2:0,width:0,height:0},G=document.documentElement,J=navigator.userAgent;function U(e){return e+B.left-Q.left}function V(e){return e+B.top-Q.top}function Z(e){return e-B.left+Q.left}function _(e){return e-B.top+Q.top}function ee(e){return e.pageX-Q.left}function te(e){return e.pageY-Q.top}function oe(e){var t=e||b,o=e||g;return{x1:n(F.x1*t),y1:n(F.y1*o),x2:n(F.x2*t),y2:n(F.y2*o),width:n(F.x2*t)-n(F.x1*t),height:n(F.y2*o)-n(F.y1*o)}}function ie(e,t,o,i,s){var d=s||b,r=s||g;(F={x1:n(e/d||0),y1:n(t/r||0),x2:n(o/d||0),y2:n(i/r||0)}).width=F.x2-F.x1,F.height=F.y2-F.y1}function ne(){a&&L.width()&&(B={left:n(L.offset().left),top:n(L.offset().top)},h=L.innerWidth(),f=L.innerHeight(),B.top+=L.outerHeight()-f>>1,B.left+=L.outerWidth()-h>>1,v=n(r.minWidth/b)||0,w=n(r.minHeight/g)||0,S=n(i(r.maxWidth/b||1<<24,h)),z=n(i(r.maxHeight/g||1<<24,f)),"1.3.2"!=e().jquery||"fixed"!=Y||G.getBoundingClientRect||(B.top+=o(document.body.scrollTop,G.scrollTop),B.left+=o(document.body.scrollLeft,G.scrollLeft)),Q=/absolute|relative/.test(m.css("position"))?{left:n(m.offset().left)-m.scrollLeft(),top:n(m.offset().top)-m.scrollTop()}:"fixed"==Y?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0},l=U(0),u=V(0),(F.x2>h||F.y2>f)&&he())}function se(t){if(C){switch(j.css({left:U(F.x1),top:V(F.y1)}).add(D).width(O=F.width).height(E=F.height),D.add(R).add(q).css({left:0,top:0}),R.width(o(O-R.outerWidth()+R.innerWidth(),0)).height(o(E-R.outerHeight()+R.innerHeight(),0)),e($[0]).css({left:l,top:u,width:F.x1,height:f}),e($[1]).css({left:l+F.x1,top:u,width:O,height:F.y1}),e($[2]).css({left:l+F.x2,top:u,width:h-F.x2,height:f}),e($[3]).css({left:l+F.x1,top:u+F.y2,width:O,height:f-F.y2}),O-=q.outerWidth(),E-=q.outerHeight(),q.length){case 8:e(q[4]).css({left:O>>1}),e(q[5]).css({left:O,top:E>>1}),e(q[6]).css({left:O>>1,top:E}),e(q[7]).css({top:E>>1});case 4:q.slice(1,3).css({left:O}),q.slice(2,4).css({top:E})}!1!==t&&(e.imgAreaSelect.onKeyPress!=we&&e(document).unbind(e.imgAreaSelect.keyPress,e.imgAreaSelect.onKeyPress),r.keys&&e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress=we)),ke&&R.outerWidth()-R.innerWidth()==2&&(R.css("margin",0),setTimeout((function(){R.css("margin","auto")}),0))}}function de(e){ne(),se(e),A=U(F.x1),W=V(F.y1),I=U(F.x2),K=V(F.y2)}function re(e,t){r.fadeSpeed?e.fadeOut(r.fadeSpeed,t):e.hide()}function ae(e){var t=Z(ee(e))-F.x1,o=_(te(e))-F.y1;T||(ne(),T=!0,j.one("mouseout",(function(){T=!1}))),x="",r.resizable&&(o<=r.resizeMargin?x="n":o>=F.height-r.resizeMargin&&(x="s"),t<=r.resizeMargin?x+="w":t>=F.width-r.resizeMargin&&(x+="e")),j.css("cursor",x?x+"-resize":r.movable?"move":""),c&&c.toggle()}function ce(t){e("body").css("cursor",""),(r.autoHide||F.width*F.height==0)&&re(j.add($),(function(){e(this).hide()})),e(document).unbind("mousemove",fe),j.mousemove(ae),r.onSelectEnd(d,oe())}function le(t){return 1==t.which&&(ne(),x?(e("body").css("cursor",x+"-resize"),A=U(F[/w/.test(x)?"x2":"x1"]),W=V(F[/n/.test(x)?"y2":"y1"]),e(document).mousemove(fe).one("mouseup",ce),j.unbind("mousemove",ae)):r.movable?(p=l+F.x1-ee(t),y=u+F.y1-te(t),j.unbind("mousemove",ae),e(document).mousemove(pe).one("mouseup",(function(){r.onSelectEnd(d,oe()),e(document).unbind("mousemove",pe),j.mousemove(ae)}))):L.mousedown(t),!1)}function ue(e){k&&(e?(I=o(l,i(l+h,A+t(K-W)*k*(I>A||-1))),K=n(o(u,i(u+f,W+t(I-A)/k*(K>W||-1)))),I=n(I)):(K=o(u,i(u+f,W+t(I-A)/k*(K>W||-1))),I=n(o(l,i(l+h,A+t(K-W)*k*(I>A||-1)))),K=n(K)))}function he(){A=i(A,l+h),W=i(W,u+f),t(I-A)<v&&((I=A-v*(I<A||-1))<l?A=l+v:I>l+h&&(A=l+h-v)),t(K-W)<w&&((K=W-w*(K<W||-1))<u?W=u+w:K>u+f&&(W=u+f-w)),I=o(l,i(I,l+h)),K=o(u,i(K,u+f)),ue(t(I-A)<t(K-W)*k),t(I-A)>S&&(I=A-S*(I<A||-1),ue()),t(K-W)>z&&(K=W-z*(K<W||-1),ue(!0)),F={x1:Z(i(A,I)),x2:Z(o(A,I)),y1:_(i(W,K)),y2:_(o(W,K)),width:t(I-A),height:t(K-W)},se(),r.onSelectChange(d,oe())}function fe(e){return I=/w|e|^$/.test(x)||k?ee(e):U(F.x2),K=/n|s|^$/.test(x)||k?te(e):V(F.y2),he(),!1}function me(t,o){I=(A=t)+F.width,K=(W=o)+F.height,e.extend(F,{x1:Z(A),y1:_(W),x2:Z(I),y2:_(K)}),se(),r.onSelectChange(d,oe())}function pe(e){return A=o(l,i(p+ee(e),l+h-F.width)),W=o(u,i(y+te(e),u+f-F.height)),me(A,W),e.preventDefault(),!1}function ye(){e(document).unbind("mousemove",ye),ne(),I=A,K=W,he(),x="",$.is(":visible")||j.add($).hide().fadeIn(r.fadeSpeed||0),C=!0,e(document).unbind("mouseup",be).mousemove(fe).one("mouseup",ce),j.unbind("mousemove",ae),r.onSelectStart(d,oe())}function be(){e(document).unbind("mousemove",ye).unbind("mouseup",be),re(j.add($)),ie(Z(A),_(W),Z(A),_(W)),this instanceof e.imgAreaSelect||(r.onSelectChange(d,oe()),r.onSelectEnd(d,oe()))}function ge(t){return 1==t.which&&!$.is(":animated")&&(ne(),p=A=ee(t),y=W=te(t),e(document).mousemove(ye).mouseup(be),!1)}function xe(){de(!1)}function ve(){a=!0,ze(r=e.extend({classPrefix:"imgareaselect",movable:!0,parent:"body",resizable:!0,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},r)),j.add($).css({visibility:""}),r.show&&(C=!0,ne(),se(),j.add($).hide().fadeIn(r.fadeSpeed||0)),setTimeout((function(){r.onInit(d,oe())}),0)}var we=function(e){var t,n,s=r.keys,d=e.keyCode;if(t=isNaN(s.alt)||!e.altKey&&!e.originalEvent.altKey?!isNaN(s.ctrl)&&e.ctrlKey?s.ctrl:!isNaN(s.shift)&&e.shiftKey?s.shift:isNaN(s.arrows)?10:s.arrows:s.alt,"resize"==s.arrows||"resize"==s.shift&&e.shiftKey||"resize"==s.ctrl&&e.ctrlKey||"resize"==s.alt&&(e.altKey||e.originalEvent.altKey)){switch(d){case 37:t=-t;case 39:n=o(A,I),A=i(A,I),I=o(n+t,A),ue();break;case 38:t=-t;case 40:n=o(W,K),W=i(W,K),K=o(n+t,W),ue(!0);break;default:return}he()}else switch(A=i(A,I),W=i(W,K),d){case 37:me(o(A-t,l),W);break;case 38:me(A,o(W-t,u));break;case 39:me(A+i(t,h-Z(I)),W);break;case 40:me(A,W+i(t,f-_(K)));break;default:return}return!1};function Se(e,t){for(var o in t)void 0!==r[o]&&e.css(t[o],r[o])}function ze(t){if(t.parent&&(m=e(t.parent)).append(j).append($),e.extend(r,t),ne(),null!=t.handles){for(q.remove(),q=e([]),H=t.handles?"corners"==t.handles?4:8:0;H--;)q=q.add(s());q.addClass(r.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:X+1||1}),!parseInt(q.css("width"))>=0&&q.width(5).height(5),(M=r.borderWidth)&&q.css({borderWidth:M,borderStyle:"solid"}),Se(q,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}for(b=r.imageWidth/h||1,g=r.imageHeight/f||1,null!=t.x1&&(ie(t.x1,t.y1,t.x2,t.y2),t.show=!t.hide),t.keys&&(r.keys=e.extend({shift:1,ctrl:"resize"},t.keys)),$.addClass(r.classPrefix+"-outer"),D.addClass(r.classPrefix+"-selection"),H=0;H++<4;)e(R[H-1]).addClass(r.classPrefix+"-border"+H);Se(D,{selectionColor:"background-color",selectionOpacity:"opacity"}),Se(R,{borderOpacity:"opacity",borderWidth:"border-width"}),Se($,{outerColor:"background-color",outerOpacity:"opacity"}),(M=r.borderColor1)&&e(R[0]).css({borderStyle:"solid",borderColor:M}),(M=r.borderColor2)&&e(R[1]).css({borderStyle:"dashed",borderColor:M}),j.append(D.add(R).add(c)).append(q),ke&&((M=($.css("filter")||"").match(/opacity=(\d+)/))&&$.css("opacity",M[1]/100),(M=(R.css("filter")||"").match(/opacity=(\d+)/))&&R.css("opacity",M[1]/100)),t.hide?re(j.add($)):t.show&&a&&(C=!0,j.add($).fadeIn(r.fadeSpeed||0),de()),k=(N=(r.aspectRatio||"").split(/:/))[0]/N[1],L.add($).unbind("mousedown",ge),r.disable||!1===r.enable?(j.unbind("mousemove",ae).unbind("mousedown",le),e(window).unbind("resize",xe)):((r.enable||!1===r.disable)&&((r.resizable||r.movable)&&j.mousemove(ae).mousedown(le),e(window).resize(xe)),r.persistent||L.add($).mousedown(ge)),r.enable=r.disable=void 0}this.remove=function(){ze({disable:!0}),j.add($).remove()},this.getOptions=function(){return r},this.setOptions=ze,this.getSelection=oe,this.setSelection=ie,this.cancelSelection=be,this.update=de;var ke=(/msie ([\w.]+)/i.exec(J)||[])[1],Ce=/opera/i.test(J),Ae=/webkit/i.test(J)&&!/chrome/i.test(J);for(P=L;P.length;)X=o(X,isNaN(P.css("z-index"))?X:P.css("z-index")),P=P.parent(":not(body)");X=r.zIndex||X,ke&&L.attr("unselectable","on"),e.imgAreaSelect.keyPress=ke||Ae?"keydown":"keypress",Ce&&(c=s().css({width:"100%",height:"100%",position:"absolute",zIndex:X+2||2})),j.add($).css({visibility:"hidden",position:Y,overflow:"hidden",zIndex:X||"0"}),j.css({zIndex:X+2||2}),D.add(R).css({position:"absolute",fontSize:0}),d.complete||"complete"==d.readyState||!L.is("img")?ve():L.one("load",ve),!a&&ke&&ke>=7&&(d.src=d.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);