You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wubloader/thrimbletrimmer/scripts/jcrop.js

2 lines
31 KiB
JavaScript

var Jcrop=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e={};for(var t in arguments){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"==typeof t&&(t=document.getElementById(t)),this.el=t}return r(e,[{key:"appendTo",value:function(e){return"string"==typeof e&&(e=document.getElementById(e)),e.appendChild(this.el),this}},{key:"emit",value:function(e){var t=document.createEvent("Event");t.initEvent(e,!0,!0),t.cropTarget=this,this.el.dispatchEvent(t)}},{key:"removeClass",value:function(e){return this.el.className=this.el.className.split(" ").filter(function(t){return e!==t}).join(" "),this}},{key:"hasClass",value:function(e){return this.el.className.split(" ").filter(function(t){return e===t}).length}},{key:"addClass",value:function(e){return this.hasClass(e)||(this.el.className+=" "+e),this}},{key:"listen",value:function(e,t){return this.el.addEventListener(e,function(e){return t(e.cropTarget,e)}),this}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=0,this.y=0,this.w=0,this.h=0}return r(e,[{key:"round",value:function(){return e.create(Math.round(this.x),Math.round(this.y),Math.round(this.w),Math.round(this.h))}},{key:"normalize",value:function(){var t=[Math.min(this.x,this.x2),Math.min(this.y,this.y2),Math.max(this.x,this.x2),Math.max(this.y,this.y2)],n=t[0],r=t[1],i=t[2],o=t[3];return e.create(n,r,i-n,o-r)}},{key:"rebound",value:function(e,t){var n=this.normalize();return n.x<0&&(n.x=0),n.y<0&&(n.y=0),n.x2>e&&(n.x=e-n.w),n.y2>t&&(n.y=t-n.h),n}},{key:"scale",value:function(t,n){return n=n||t,e.create(this.x,this.y,this.w*t,this.h*n)}},{key:"center",value:function(t,n){return e.create((t-this.w)/2,(n-this.h)/2,this.w,this.h)}},{key:"toArray",value:function(){return[this.x,this.y,this.w,this.h]}},{key:"x1",set:function(e){this.w=this.x2-e,this.x=e}},{key:"y1",set:function(e){this.h=this.y2-e,this.y=e}},{key:"x2",get:function(){return this.x+this.w},set:function(e){this.w=e-this.x}},{key:"y2",get:function(){return this.y+this.h},set:function(e){this.h=e-this.y}},{key:"aspect",get:function(){return this.w/this.h}}]),e}();i.fromPoints=function(e,t){var n=[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[0],t[0]),Math.max(e[1],t[1
//# sourceMappingURL=jcrop.js.map