From 8bade5c68a1a699da56c3d2914e09efa49cdb1ad Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 6 Jan 2021 20:41:57 +0100 Subject: [PATCH] fix(srcissors): add build files --- examples/srcissors.js | 2 +- examples/srcissors.js.map | 2 +- srcissors.js | 2 +- srcissors.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/srcissors.js b/examples/srcissors.js index eb7280a..eb6bdad 100644 --- a/examples/srcissors.js +++ b/examples/srcissors.js @@ -1,2 +1,2 @@ -!function(i,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?exports.srcissors=t(require("jquery")):i.srcissors=t(i.jQuery)}(window,function(i){return function(i){var t={};function e(s){if(t[s])return t[s].exports;var h=t[s]={i:s,l:!1,exports:{}};return i[s].call(h.exports,h,h.exports,e),h.l=!0,h.exports}return e.m=i,e.c=t,e.d=function(i,t,s){e.o(i,t)||Object.defineProperty(i,t,{enumerable:!0,get:s})},e.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},e.t=function(i,t){if(1&t&&(i=e(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.__esModule)return i;var s=Object.create(null);if(e.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var h in i)e.d(s,h,function(t){return i[t]}.bind(null,h));return s},e.n=function(i){var t=i&&i.__esModule?function(){return i.default}:function(){return i};return e.d(t,"a",t),t},e.o=function(i,t){return Object.prototype.hasOwnProperty.call(i,t)},e.p="",e(e.s=1)}([function(t,e){t.exports=i},function(i,t,e){var s=e(0),h=e(2);i.exports={new:function(i){var t=i.arena,e=i.url,n=i.fixedWidth,a=i.fixedHeight,o=i.minWidth,r=i.minHeight,u=i.minRatio,c=i.maxRatio,l=i.maxArea,g=i.zoomStep,d=i.crop,v=i.actions,m=i.minResolution,w=i.surroundingImageOpacity,p=i.showSurroundingImage,f=(t=s(t)).find(".crop-view"),y=f.find(".crop-preview"),x=s("");y.append(x);var k=f.find(".crop-outline");k.length||(k=void 0);var R={pan:!0,zoomOnDoubleClick:!0,resize:!0,resizeHorizontal:!n,resizeVertical:!a};return s.extend(R,v),null==g&&(g=1.25),null==o&&(o=50),null==r&&(r=50),new h({url:e,crop:d,arena:t,view:f,img:x,outline:k,showSurroundingImage:p,surroundingImageOpacity:w,fixedWidth:n,fixedHeight:a,minViewWidth:o,minViewHeight:r,minViewRatio:u,maxViewRatio:c,maxArea:l,zoomStep:g,actions:R,minResolution:m})}}},function(i,t,e){function s(i,t){for(var e=0;eh&&delete this.minResolution,this.minResolution){var n=this.minResolution/(this.imageHeight*this.imageHeight);(!this.minViewRatio||this.minViewRatioo)&&(this.maxViewRatio=o)}this.calcMaxMinDimensions(),this.fixedWidth&&(t="width"),this.fixedHeight&&(t="height"),this.setViewDimensions({width:this.imageWidth,height:this.imageHeight,keepDimension:t}),this.isReady=!0,this.view.removeClass(this.loadingCssClass),this.isInitialized||null==this.initialCrop?(this.zoomAllOut(),this.center()):this.setCrop(this.initialCrop),this.isInitialized=!0,this.readyEvent.fire(),this.loadEvent.fire()}},{key:"setCrop",value:function(i){var t=this,e=i.x,s=i.y,h=i.width,n=i.height;if(this.isReady){this.resize({width:h,height:n});var a=this.viewWidth/h,o=this.imageWidth*a;this.zoom({width:o}),this.pan({x:e*a,y:s*a})}else this.on("ready",function(){return t.setCrop({x:e,y:s,width:h,height:n})})}},{key:"getCrop",value:function(){var i=this.preview.width/this.imageWidth,t={x:this.preview.x/i,y:this.preview.y/i,width:this.viewWidth/i,height:this.viewHeight/i};return this.roundCrop(t),this.validateCrop(t),t}},{key:"roundCrop",value:function(i){for(var t in i){var e=i[t];i[t]=Math.round(e)}}},{key:"validateCrop",value:function(i){var t=i.x,e=i.y,s=i.width,h=i.height;return t+s>this.imageWidth?i.width=this.imageWidth-t:e+h>this.imageHeight&&(i.height=this.imageHeight-e),i}},{key:"setRatio",value:function(i,t){var e,s,h=this;if(this.isReady)return i=this.enforceValidRatio(i),"height"===t?s=(e=this.viewHeight)*i:e=(s=this.viewWidth)/i,this.resizeFocusPoint=this.getFocusPoint(),this.resize({width:s,height:e});this.on("ready",function(){return h.setRatio(i,t)})}},{key:"onPan",value:function(i){this.isPanning||(this.isPanning=!0,this.arena.addClass(this.panningCssClass),this.outline.addClass(this.outlineCssClass));var t=i.startX-i.dx,e=i.startY-i.dy;this.pan({x:t,y:e})}},{key:"onPanEnd",value:function(){return this.isPanning=!1,this.arena.removeClass(this.panningCssClass),this.outline.removeClass(this.outlineCssClass)}},{key:"onDoubleClick",value:function(i){var t=i.pageX,e=i.pageY,s=this.view[0].getBoundingClientRect(),h=t-s.left,n=e-s.top;this.zoomIn({viewX:h,viewY:n})}},{key:"onResize",value:function(i){var t=i.position,e=i.dx,s=i.dy;this.isResizing||(this.isResizing=!0,this.resizeFocusPoint=this.getFocusPoint()),["top","bottom"].includes(t)?(s*=2,this.resize({width:this.viewWidth,height:this.viewHeight+s,keepDimension:"height"})):["left","right"].includes(t)&&(e*=2,this.resize({width:this.viewWidth+e,height:this.viewHeight,keepDimension:"width"}))}},{key:"onResizeEnd",value:function(){this.isResizing=!1,this.resizeFocusPoint=void 0}},{key:"resize",value:function(i){var t=i.width,e=i.height,s=i.keepDimension;this.setViewDimensions({width:t,height:e,keepDimension:s}),this.resizeFocusPoint&&(this.resizeFocusPoint.viewX=this.viewWidth/2,this.resizeFocusPoint.viewY=this.viewHeight/2),this.zoom({width:this.preview.width,height:this.preview.height,focusPoint:this.resizeFocusPoint})}},{key:"setViewDimensions",value:function(i){var t=i.width,e=i.height,s=i.keepDimension;if(this.maxArea){var h=this.enforceMaxArea({width:t,height:e,keepDimension:s});t=h.width,e=h.height}var n=this.enforceViewDimensions({width:t,height:e,keepDimension:s});if(t=n.width,e=n.height,this.view.css({width:t,height:e}),this.viewWidth=t,this.viewHeight=e,this.viewRatio=t/e,this.minResolution){var a=Math.sqrt(this.minResolution*this.viewRatio),o=Math.sqrt(this.minResolution/this.viewRatio);this.maxImageWidth=this.viewWidth/a*this.imageWidth,this.maxImageHeight=this.viewHeight/o*this.imageHeight}this.fireChange()}},{key:"zoomAllOut",value:function(){this.isWidthRestricting()?this.zoom({width:this.viewWidth}):this.zoom({height:this.viewHeight})}},{key:"zoomIn",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomInStep:i.height=this.preview.height*this.zoomInStep,this.zoom(i)}},{key:"zoomOut",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomOutStep:i.height=this.preview.height*this.zoomOutStep,this.zoom(i)}},{key:"zoom",value:function(i){var t=i.width,e=i.height,s=i.viewX,h=i.viewY,n=i.focusPoint;null==n&&(n=this.getFocusPoint({viewX:s,viewY:h}));var a=this.enforceZoom({width:t,height:e});t=a.width,e=a.height,null!=t?(this.preview.setWidth(t),this.fireChange()):null!=e&&(this.preview.setHeight(e),this.fireChange()),this.focus(n)}},{key:"getFocusPoint",value:function(i){null==i&&(i={});var t=i,e=t.viewX,s=t.viewY;null==e&&(e=this.viewWidth/2),null==s&&(s=this.viewHeight/2);var h=this.preview.x+e,n=this.preview.y+s;return{percentX:h/this.preview.width,percentY:n/this.preview.height,viewX:e,viewY:s}}},{key:"focus",value:function(i){var t=i.percentX,e=i.percentY,s=i.viewX,h=i.viewY,n=this.preview.width*t,a=this.preview.height*e;n-=s,a-=h,this.pan({x:n,y:a})}},{key:"center",value:function(){var i=(this.preview.width-this.viewWidth)/2,t=(this.preview.height-this.viewHeight)/2;this.pan({x:i,y:t})}},{key:"pan",value:function(i){i=this.enforceXy(i),this.preview.pan(i.x,i.y),this.fireChange()}},{key:"enforceXy",value:function(i){var t=i.x,e=i.y;return t<0?t=0:t>this.preview.width-this.viewWidth&&(t=this.preview.width-this.viewWidth),e<0?e=0:e>this.preview.height-this.viewHeight&&(e=this.preview.height-this.viewHeight),{x:t,y:e}}},{key:"enforceZoom",value:function(i){var t=i.width,e=i.height;return null!=t&&this.maxImageWidth&&t>this.maxImageWidth?{width:this.maxImageWidth}:null!=t&&tthis.maxImageHeight?{height:this.maxImageHeight}:null!=e&&ethis.maxWidth||ethis.maxHeight||sthis.maxViewRatio)}},{key:"isValidRatio",value:function(i){return!(ithis.maxViewRatio)}},{key:"enforceValidRatio",value:function(i){return ithis.maxViewRatio?this.maxViewRatio:i}},{key:"enforceViewDimensions",value:function(i){var t,e,s,h=i.width,n=i.height,a=i.keepDimension;if(hthis.maxWidth&&(e=this.maxWidth),nthis.maxHeight&&(t=this.maxHeight),a){if(e&&(h=e),t&&(n=t),s=h/n,!this.isValidRatio(s)){s=this.enforceValidRatio(s);var o=this.getRatioBox({ratio:s,width:h,height:n,keepDimension:a});if(h=o.width,n=o.height,h>this.arenaWidth||n>this.arenaHeight){var r=this.centerAlign(this.maxWidth,this.maxHeight,s);h=r.width,n=r.height}}}else if(e||t){s=this.enforceValidRatio(h/n);var u=this.centerAlign(this.maxWidth,this.maxHeight,s);h=u.width,n=u.height}return{width:h,height:n}}},{key:"enforceMaxArea",value:function(i){var t=i.width,e=i.height,s=i.keepDimension,h=t/e;return"width"===s?h=t/(e=this.maxArea/t):"height"===s?h=(t=this.maxArea/e)/e:e=(t=Math.sqrt(this.maxArea*h))/h,this.isValidRatio(h)||(h=this.enforceValidRatio(h),e=(t=Math.sqrt(this.maxArea*h))/h),{width:t,height:e}}},{key:"isWidthRestricting",value:function(){return this.viewRatio>=this.imageRatio}},{key:"getRatioBox",value:function(i){var t=i.ratio,e=i.width,s=i.height,h=i.keepDimension;return"width"===h||null==s?s=e/t:"height"===h||null==e?e=s*t:s=e/t,{width:e,height:s}}},{key:"centerAlign",value:function(i,t,e){var s,h,n,a;return i/t>e?n=(i-(h=t*e))/2:a=(t-(s=i/e))/2,{x:n||0,y:a||0,width:h||i,height:s||t}}},{key:"min",value:function(i){var t=i[0],e=!0,s=!1,h=void 0;try{for(var n,a=i[Symbol.iterator]();!(e=(n=a.next()).done);e=!0){var o=n.value;o0){var e=h("").css({opacity:this.opacity}).attr("src",t);this.outline.append(e)}}},{key:"reset",value:function(){this.url=void 0,this.x=this.y=0,this.width=this.height=0,this.img.attr("src",""),this.img.css({width:"",height:"",transform:""}),this.outline&&this.outline.css({transform:""}).html("")}},{key:"setWidth",value:function(i){this.img.css({width:"".concat(i,"px"),height:"auto"});var t=i/this.ratio;this.updateImageDimensions({width:i,height:t})}},{key:"setHeight",value:function(i){this.img.css({width:"auto",height:"".concat(i,"px")});var t=i*this.ratio;this.updateImageDimensions({width:t,height:i})}},{key:"updateImageDimensions",value:function(i){var t=i.width,e=i.height;this.width=t,this.height=e,this.outline&&this.outline.css({width:"".concat(this.width,"px"),height:"".concat(this.height,"px")})}},{key:"pan",value:function(i,t){this.x=i,this.y=t;var e=Math.round(this.x),s=Math.round(this.y);this.img.css({transform:"translate(-".concat(e,"px, -").concat(s,"px)")}),this.outline&&this.outline.css({transform:"translate(-".concat(e,"px, -").concat(s,"px)")})}}]),i}()},function(i,t,e){function s(i,t){for(var e=0;es-t.doubleClickThreshold&&t.parent.onDoubleClick({pageX:e.pageX,pageY:e.pageY}),i=s})}},{key:"preventBrowserDragDrop",value:function(){this.view.on("dragstart.srcissors",function(){return!1})}},{key:"resizeView",value:function(i){var t=this,e=i.horizontal,s=i.vertical,n=h("
");n.addClass("resize-handler");var a=[];e&&(a=a.concat(["right","left"])),s&&(a=a.concat(["top","bottom"])),a.forEach(function(i){var e=n.clone();e.addClass("resize-handler-".concat(i)),e.on("mousedown.srcissors",t.getResizeMouseDown(i)),t.view.append(e)})}},{key:"getResizeMouseDown",value:function(i){var t=this,e=h(document);return function(s){var h=s.pageX,n=s.pageY;s.stopPropagation(),e.on("mousemove.srcissors-resize",function(e){var s,a;switch(i){case"top":case"bottom":a=e.pageY-n,"top"===i&&(a=-a),n=e.pageY;break;case"left":case"right":s=e.pageX-h,"left"===i&&(s=-s),h=e.pageX}t.parent.onResize({position:i,dx:s,dy:a})}).on("mouseup.srcissors-resize",function(){e.off("mouseup.srcissors-resize"),e.off("mousemove.srcissors-resize"),t.parent.onResizeEnd({position:i})})}}},{key:"responsiveArena",value:function(){}}]),i}()}])}); +!function(i,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?exports.srcissors=t(require("jquery")):i.srcissors=t(i.jQuery)}(window,(function(i){return function(i){var t={};function e(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return i[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=i,e.c=t,e.d=function(i,t,s){e.o(i,t)||Object.defineProperty(i,t,{enumerable:!0,get:s})},e.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},e.t=function(i,t){if(1&t&&(i=e(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.__esModule)return i;var s=Object.create(null);if(e.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var n in i)e.d(s,n,function(t){return i[t]}.bind(null,n));return s},e.n=function(i){var t=i&&i.__esModule?function(){return i.default}:function(){return i};return e.d(t,"a",t),t},e.o=function(i,t){return Object.prototype.hasOwnProperty.call(i,t)},e.p="",e(e.s=1)}([function(t,e){t.exports=i},function(i,t,e){var s=e(0),n=e(2);i.exports={new:function(i){var t=i.arena,e=i.url,h=i.fixedWidth,o=i.fixedHeight,a=i.minWidth,r=i.minHeight,u=i.minRatio,c=i.maxRatio,l=i.maxArea,g=i.zoomStep,d=i.crop,v=i.actions,m=i.minResolution,w=i.surroundingImageOpacity,p=i.showSurroundingImage,f=(t=s(t)).find(".crop-view"),y=f.find(".crop-preview"),x=s("");y.append(x);var k=f.find(".crop-outline");k.length||(k=void 0);var R={pan:!0,zoomOnDoubleClick:!0,resize:!0,resizeHorizontal:!h,resizeVertical:!o};return s.extend(R,v),null==g&&(g=1.25),null==a&&(a=50),null==r&&(r=50),new n({url:e,crop:d,arena:t,view:f,img:x,outline:k,showSurroundingImage:p,surroundingImageOpacity:w,fixedWidth:h,fixedHeight:o,minViewWidth:a,minViewHeight:r,minViewRatio:u,maxViewRatio:c,maxArea:l,zoomStep:g,actions:R,minResolution:m})}}},function(i,t,e){function s(i,t){var e;if("undefined"==typeof Symbol||null==i[Symbol.iterator]){if(Array.isArray(i)||(e=function(i,t){if(!i)return;if("string"==typeof i)return n(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);"Object"===e&&i.constructor&&(e=i.constructor.name);if("Map"===e||"Set"===e)return Array.from(i);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return n(i,t)}(i))||t&&i&&"number"==typeof i.length){e&&(i=e);var s=0,h=function(){};return{s:h,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(i){throw i},f:h}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,r=!1;return{s:function(){e=i[Symbol.iterator]()},n:function(){var i=e.next();return a=i.done,i},e:function(i){r=!0,o=i},f:function(){try{a||null==e.return||e.return()}finally{if(r)throw o}}}}function n(i,t){(null==t||t>i.length)&&(t=i.length);for(var e=0,s=new Array(t);en&&delete this.minResolution,this.minResolution){var h=this.minResolution/(this.imageHeight*this.imageHeight);(!this.minViewRatio||this.minViewRatioo)&&(this.maxViewRatio=o)}this.calcMaxMinDimensions(),this.fixedWidth&&(t="width"),this.fixedHeight&&(t="height"),this.setViewDimensions({width:this.imageWidth,height:this.imageHeight,keepDimension:t}),this.isReady=!0,this.view.removeClass(this.loadingCssClass),this.isInitialized||null==this.initialCrop?(this.zoomAllOut(),this.center()):this.setCrop(this.initialCrop),this.isInitialized=!0,this.readyEvent.fire(),this.loadEvent.fire()}},{key:"setCrop",value:function(i){var t=this,e=i.x,s=i.y,n=i.width,h=i.height;if(this.isReady){this.resize({width:n,height:h});var o=this.viewWidth/n,a=this.imageWidth*o;this.zoom({width:a}),this.pan({x:e*o,y:s*o})}else this.on("ready",(function(){return t.setCrop({x:e,y:s,width:n,height:h})}))}},{key:"getCrop",value:function(){var i=this.preview.width/this.imageWidth,t={x:this.preview.x/i,y:this.preview.y/i,width:this.viewWidth/i,height:this.viewHeight/i};return this.roundCrop(t),this.validateCrop(t),t}},{key:"roundCrop",value:function(i){for(var t in i){var e=i[t];i[t]=Math.round(e)}}},{key:"validateCrop",value:function(i){var t=i.x,e=i.y,s=i.width,n=i.height;return t+s>this.imageWidth?i.width=this.imageWidth-t:e+n>this.imageHeight&&(i.height=this.imageHeight-e),i}},{key:"setRatio",value:function(i,t){var e,s,n=this;if(this.isReady)return i=this.enforceValidRatio(i),"height"===t?s=(e=this.viewHeight)*i:e=(s=this.viewWidth)/i,this.resizeFocusPoint=this.getFocusPoint(),this.resize({width:s,height:e});this.on("ready",(function(){return n.setRatio(i,t)}))}},{key:"onPan",value:function(i){this.isPanning||(this.isPanning=!0,this.arena.addClass(this.panningCssClass),this.outline.addClass(this.outlineCssClass));var t=i.startX-i.dx,e=i.startY-i.dy;this.pan({x:t,y:e})}},{key:"onPanEnd",value:function(){return this.isPanning=!1,this.arena.removeClass(this.panningCssClass),this.outline.removeClass(this.outlineCssClass)}},{key:"onDoubleClick",value:function(i){var t=i.pageX,e=i.pageY,s=this.view[0].getBoundingClientRect(),n=t-s.left,h=e-s.top;this.zoomIn({viewX:n,viewY:h})}},{key:"onResize",value:function(i){var t=i.position,e=i.dx,s=i.dy;this.isResizing||(this.isResizing=!0,this.resizeFocusPoint=this.getFocusPoint()),["top","bottom"].includes(t)?(s*=2,this.resize({width:this.viewWidth,height:this.viewHeight+s,keepDimension:"height"})):["left","right"].includes(t)&&(e*=2,this.resize({width:this.viewWidth+e,height:this.viewHeight,keepDimension:"width"}))}},{key:"onResizeEnd",value:function(){this.isResizing=!1,this.resizeFocusPoint=void 0}},{key:"resize",value:function(i){var t=i.width,e=i.height,s=i.keepDimension;this.setViewDimensions({width:t,height:e,keepDimension:s}),this.resizeFocusPoint&&(this.resizeFocusPoint.viewX=this.viewWidth/2,this.resizeFocusPoint.viewY=this.viewHeight/2),this.zoom({width:this.preview.width,height:this.preview.height,focusPoint:this.resizeFocusPoint})}},{key:"setViewDimensions",value:function(i){var t=i.width,e=i.height,s=i.keepDimension;if(this.maxArea){var n=this.enforceMaxArea({width:t,height:e,keepDimension:s});t=n.width,e=n.height}var h=this.enforceViewDimensions({width:t,height:e,keepDimension:s});if(t=h.width,e=h.height,this.view.css({width:t,height:e}),this.viewWidth=t,this.viewHeight=e,this.viewRatio=t/e,this.minResolution){var o=Math.sqrt(this.minResolution*this.viewRatio),a=Math.sqrt(this.minResolution/this.viewRatio);this.maxImageWidth=this.viewWidth/o*this.imageWidth,this.maxImageHeight=this.viewHeight/a*this.imageHeight}this.fireChange()}},{key:"zoomAllOut",value:function(){this.isWidthRestricting()?this.zoom({width:this.viewWidth}):this.zoom({height:this.viewHeight})}},{key:"zoomIn",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomInStep:i.height=this.preview.height*this.zoomInStep,this.zoom(i)}},{key:"zoomOut",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomOutStep:i.height=this.preview.height*this.zoomOutStep,this.zoom(i)}},{key:"zoom",value:function(i){var t=i.width,e=i.height,s=i.viewX,n=i.viewY,h=i.focusPoint;null==h&&(h=this.getFocusPoint({viewX:s,viewY:n}));var o=this.enforceZoom({width:t,height:e});t=o.width,e=o.height,null!=t?(this.preview.setWidth(t),this.fireChange()):null!=e&&(this.preview.setHeight(e),this.fireChange()),this.focus(h)}},{key:"getFocusPoint",value:function(i){null==i&&(i={});var t=i,e=t.viewX,s=t.viewY;null==e&&(e=this.viewWidth/2),null==s&&(s=this.viewHeight/2);var n=this.preview.x+e,h=this.preview.y+s;return{percentX:n/this.preview.width,percentY:h/this.preview.height,viewX:e,viewY:s}}},{key:"focus",value:function(i){var t=i.percentX,e=i.percentY,s=i.viewX,n=i.viewY,h=this.preview.width*t,o=this.preview.height*e;h-=s,o-=n,this.pan({x:h,y:o})}},{key:"center",value:function(){var i=(this.preview.width-this.viewWidth)/2,t=(this.preview.height-this.viewHeight)/2;this.pan({x:i,y:t})}},{key:"pan",value:function(i){i=this.enforceXy(i),this.preview.pan(i.x,i.y),this.fireChange()}},{key:"enforceXy",value:function(i){var t=i.x,e=i.y;return t<0?t=0:t>this.preview.width-this.viewWidth&&(t=this.preview.width-this.viewWidth),e<0?e=0:e>this.preview.height-this.viewHeight&&(e=this.preview.height-this.viewHeight),{x:t,y:e}}},{key:"enforceZoom",value:function(i){var t=i.width,e=i.height;return null!=t&&this.maxImageWidth&&t>this.maxImageWidth?{width:this.maxImageWidth}:null!=t&&tthis.maxImageHeight?{height:this.maxImageHeight}:null!=e&&ethis.maxWidth||ethis.maxHeight||sthis.maxViewRatio)}},{key:"isValidRatio",value:function(i){return!(ithis.maxViewRatio)}},{key:"enforceValidRatio",value:function(i){return ithis.maxViewRatio?this.maxViewRatio:i}},{key:"enforceViewDimensions",value:function(i){var t,e,s,n=i.width,h=i.height,o=i.keepDimension;if(nthis.maxWidth&&(e=this.maxWidth),hthis.maxHeight&&(t=this.maxHeight),o){if(e&&(n=e),t&&(h=t),s=n/h,!this.isValidRatio(s)){s=this.enforceValidRatio(s);var a=this.getRatioBox({ratio:s,width:n,height:h,keepDimension:o});if(n=a.width,h=a.height,n>this.arenaWidth||h>this.arenaHeight){var r=this.centerAlign(this.maxWidth,this.maxHeight,s);n=r.width,h=r.height}}}else if(e||t){s=this.enforceValidRatio(n/h);var u=this.centerAlign(this.maxWidth,this.maxHeight,s);n=u.width,h=u.height}return{width:n,height:h}}},{key:"enforceMaxArea",value:function(i){var t=i.width,e=i.height,s=i.keepDimension,n=t/e;return"width"===s?n=t/(e=this.maxArea/t):"height"===s?n=(t=this.maxArea/e)/e:e=(t=Math.sqrt(this.maxArea*n))/n,this.isValidRatio(n)||(n=this.enforceValidRatio(n),e=(t=Math.sqrt(this.maxArea*n))/n),{width:t,height:e}}},{key:"isWidthRestricting",value:function(){return this.viewRatio>=this.imageRatio}},{key:"getRatioBox",value:function(i){var t=i.ratio,e=i.width,s=i.height,n=i.keepDimension;return"width"===n||null==s?s=e/t:"height"===n||null==e?e=s*t:s=e/t,{width:e,height:s}}},{key:"centerAlign",value:function(i,t,e){var s,n,h,o;return i/t>e?h=(i-(n=t*e))/2:o=(t-(s=i/e))/2,{x:h||0,y:o||0,width:n||i,height:s||t}}},{key:"min",value:function(i){var t,e=i[0],n=s(i);try{for(n.s();!(t=n.n()).done;){var h=t.value;h0){var e=n("").css({opacity:this.opacity}).attr("src",t);this.outline.append(e)}}},{key:"reset",value:function(){this.url=void 0,this.x=this.y=0,this.width=this.height=0,this.img.attr("src",""),this.img.css({width:"",height:"",transform:""}),this.outline&&this.outline.css({transform:""}).html("")}},{key:"setWidth",value:function(i){this.img.css({width:"".concat(i,"px"),height:"auto"});var t=i/this.ratio;this.updateImageDimensions({width:i,height:t})}},{key:"setHeight",value:function(i){this.img.css({width:"auto",height:"".concat(i,"px")});var t=i*this.ratio;this.updateImageDimensions({width:t,height:i})}},{key:"updateImageDimensions",value:function(i){var t=i.width,e=i.height;this.width=t,this.height=e,this.outline&&this.outline.css({width:"".concat(this.width,"px"),height:"".concat(this.height,"px")})}},{key:"pan",value:function(i,t){this.x=i,this.y=t;var e=Math.round(this.x),s=Math.round(this.y);this.img.css({transform:"translate(-".concat(e,"px, -").concat(s,"px)")}),this.outline&&this.outline.css({transform:"translate(-".concat(e,"px, -").concat(s,"px)")})}}])&&s(t.prototype,e),h&&s(t,h),i}()},function(i,t,e){function s(i,t){for(var e=0;es-t.doubleClickThreshold&&t.parent.onDoubleClick(h(e)),i=s}))}},{key:"preventBrowserDragDrop",value:function(){this.view.on("dragstart.srcissors",(function(){return!1}))}},{key:"resizeView",value:function(i){var t=this,e=i.horizontal,s=i.vertical,h=n("
");h.addClass("resize-handler");var o=[];e&&(o=o.concat(["right","left"])),s&&(o=o.concat(["top","bottom"])),o.forEach((function(i){var e=h.clone();e.addClass("resize-handler-".concat(i)),e.on("mousedown.srcissors touchstart.srcissors",t.getResizeMouseDown(i)),t.view.append(e)}))}},{key:"getResizeMouseDown",value:function(i){var t=this,e=n(document);return function(s){var n=h(s),o=n.pageX,a=n.pageY;s.stopPropagation(),e.on("mousemove.srcissors-resize touchmove.srcissors-resize",(function(e){var s,n,r=h(e),u=r.pageX,c=r.pageY;switch(i){case"top":case"bottom":n=c-a,"top"===i&&(n=-n),a=c;break;case"left":case"right":s=u-o,"left"===i&&(s=-s),o=u}t.parent.onResize({position:i,dx:s,dy:n})})).on("mouseup.srcissors-resize touchend.srcissors-resize",(function(){e.off("mouseup.srcissors-resize touchmove.srcissors-resize"),e.off("mousemove.srcissors-resize touchend.srcissors-resize"),t.parent.onResizeEnd({position:i})}))}}},{key:"responsiveArena",value:function(){}}])&&s(t.prototype,e),o&&s(t,o),i}()}])})); //# sourceMappingURL=srcissors.js.map \ No newline at end of file diff --git a/examples/srcissors.js.map b/examples/srcissors.js.map index af2e158..39d7e8a 100644 --- a/examples/srcissors.js.map +++ b/examples/srcissors.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://srcissors/webpack/universalModuleDefinition","webpack://srcissors/webpack/bootstrap","webpack://srcissors/external {\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\",\"amd\":\"jquery\",\"root\":\"jQuery\"}","webpack://srcissors/./src/srcissors.js","webpack://srcissors/./src/crop.js","webpack://srcissors/./src/preview.js","webpack://srcissors/./src/events.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","Crop","new","_ref","arena","url","fixedWidth","fixedHeight","minWidth","minHeight","minRatio","maxRatio","maxArea","zoomStep","crop","actions","minResolution","surroundingImageOpacity","showSurroundingImage","view","find","preview","img","append","outline","length","undefined","allowedActions","pan","zoomOnDoubleClick","resize","resizeHorizontal","resizeVertical","extend","minViewWidth","minViewHeight","minViewRatio","maxViewRatio","Preview","Events","_classCallCheck","this","onPreviewReady","loadingCssClass","panningCssClass","outlineCssClass","isPanning","initialCrop","loadEvent","Callbacks","changeEvent","initializeReadyState","zoomInStep","zoomOutStep","arenaWidth","width","arenaHeight","height","setSurroundingImageVisibility","onReady","opacity","setImage","_createClass","isReady","readyEvent","empty","isInitialized","reset","addClass","visibility","parseFloat","css","imageWidth","imageHeight","zoomAllOut","_ref2","keepDimension","events","parent","imageRatio","imageResolution","minRatioForResolution","maxRatioForResolution","calcMaxMinDimensions","setViewDimensions","removeClass","center","setCrop","fire","_ref3","_this","x","y","factor","viewWidth","previewWidth","zoom","on","viewHeight","roundCrop","validateCrop","Math","round","ratio","_this2","enforceValidRatio","resizeFocusPoint","getFocusPoint","setRatio","data","newX","startX","dx","newY","startY","dy","_ref4","pageX","pageY","_this$view$0$getBound","getBoundingClientRect","viewX","left","viewY","top","zoomIn","_ref5","position","isResizing","includes","_ref6","focusPoint","_ref7","_this$enforceMaxArea","enforceMaxArea","_this$enforceViewDime","enforceViewDimensions","viewRatio","minZoomPixelWidth","sqrt","minZoomPixelHeight","maxImageWidth","maxImageHeight","fireChange","isWidthRestricting","params","_ref8","_this$enforceZoom","enforceZoom","setWidth","setHeight","focus","param","_param","percentX","percentY","_ref9","enforceXy","_ref10","_ref11","maxWidth","min","maxHeight","_ref12","_ref13","newHeight","newWidth","isValidRatio","_this$getRatioBox","getRatioBox","_this$centerAlign","centerAlign","_this$centerAlign2","_ref14","_ref15","areaWidth","areaHeight","array","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","next","done","number","err","return","callback","concat","add","remove","_this3","changeDispatch","setTimeout","getCrop","num","obj","image","previewXy","console","log","updateImageDimensions","show","attr","setBackgroundImage","bgImg","transform","html","x1","y1","horizontal","vertical","doubleClickThreshold","doubleClick","resizeView","preventBrowserDragDrop","responsiveArena","$doc","document","e1","panData","preventDefault","e2","onPan","off","onPanEnd","lastClick","event","now","Date","getTime","onDoubleClick","$template","positions","forEach","$handler","clone","getResizeMouseDown","_this4","lastX","lastY","stopPropagation","onResize","onResizeEnd"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,WACA,mBAAAC,eAAAC,IACAD,QAAA,UAAAJ,GACA,iBAAAC,QACAA,QAAA,UAAAD,EAAAG,QAAA,WAEAJ,EAAA,UAAAC,EAAAD,EAAA,QARA,CASCO,OAAA,SAAAC,GACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAT,QAGA,IAAAC,EAAAM,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAX,YAUA,OANAY,EAAAH,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAU,GAAA,EAGAV,EAAAD,QA0DA,OArDAQ,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAhB,EAAAiB,EAAAC,GACAV,EAAAW,EAAAnB,EAAAiB,IACAG,OAAAC,eAAArB,EAAAiB,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAxB,GACA,oBAAAyB,eAAAC,aACAN,OAAAC,eAAArB,EAAAyB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAArB,EAAA,cAAiD2B,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,E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,SAAA+H,GACpC,IAAIhH,EAAIG,EACR,OAAQY,GACN,IAAK,MAAO,IAAK,SACfZ,EAAK6G,EAAG1G,MAAQ4H,EACC,QAAbnH,IAAsBZ,GAAMA,GAChC+H,EAAQlB,EAAG1G,MACX,MACF,IAAK,OAAQ,IAAK,QAChBN,EAAKgH,EAAG3G,MAAQ4H,EACC,SAAblH,IAAuBf,GAAMA,GACjCiI,EAAQjB,EAAG3G,MAIf2H,EAAKlK,OAAOsK,UAAUrH,WAAUf,KAAIG,SACnClB,GAAG,2BAA4B,WAChC0H,EAAKO,IAAI,4BACTP,EAAKO,IAAI,8BAGTc,EAAKlK,OAAOuK,aAAatH,mBA7GjCxI,IAAA,kBAAAN,MAAA,gBAAAsD,EAAA","file":"./srcissors.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"srcissors\"] = factory(require(\"jquery\"));\n\telse\n\t\troot[\"srcissors\"] = factory(root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","const $ = require('jquery')\nconst Crop = require('./crop')\n\nmodule.exports = {\n new ({\n arena, url, fixedWidth, fixedHeight, minWidth, minHeight,\n minRatio, maxRatio, maxArea, zoomStep, crop, actions, minResolution,\n surroundingImageOpacity, showSurroundingImage\n }) {\n arena = $(arena)\n const view = arena.find('.crop-view')\n const preview = view.find('.crop-preview')\n const img = $('')\n preview.append(img)\n let outline = view.find('.crop-outline')\n if (!outline.length) { outline = undefined }\n\n const allowedActions = {\n pan: true,\n zoomOnDoubleClick: true,\n resize: true,\n resizeHorizontal: !fixedWidth,\n resizeVertical: !fixedHeight\n }\n\n $.extend(allowedActions, actions)\n\n if (zoomStep == null) { zoomStep = 1.25 }\n\n if (minWidth == null) { minWidth = 50 }\n if (minHeight == null) { minHeight = 50 }\n\n return new Crop({\n url, // {String}\n crop, // {Object} Set an inital crop. This is the same as calling setCrop()\n arena, // {jQuery Element}\n view, // {jQuery Element}\n img, // {jQuery Element}\n outline, // {jQuery Element or undefined}\n showSurroundingImage, // {String} always|panning|never\n surroundingImageOpacity, // {Number} e.g. in the 0.0 - 1.0 range\n fixedWidth, // {Number} e.g. 300\n fixedHeight, // {Number} e.g. 500\n minViewWidth: minWidth, // {Number} e.g. 100\n minViewHeight: minHeight, // {Number} e.g. 100\n minViewRatio: minRatio, // {Number} e.g. 1.5/2\n maxViewRatio: maxRatio, // {Number} e.g. 2/1\n maxArea, // {Number} 0.8 -> max 80% of arena area are covered by the preview\n zoomStep, // {Number} e.g. 1.25 -> 125%\n actions: allowedActions,\n minResolution\n })\n }\n}\n","const $ = require('jquery')\nconst Preview = require('./preview')\nconst Events = require('./events')\n\nmodule.exports = class Crop {\n constructor ({\n arena, view, img, outline, url, fixedWidth, fixedHeight,\n minViewWidth, minViewHeight, minViewRatio, maxViewRatio, crop,\n zoomStep, maxArea, actions, minResolution, surroundingImageOpacity,\n showSurroundingImage\n }) {\n // CSS classes\n this.onPreviewReady = this.onPreviewReady.bind(this)\n this.arena = arena\n this.view = view\n this.img = img\n this.outline = outline\n this.fixedWidth = fixedWidth\n this.fixedHeight = fixedHeight\n this.minViewWidth = minViewWidth\n this.minViewHeight = minViewHeight\n this.minViewRatio = minViewRatio\n this.maxViewRatio = maxViewRatio\n this.actions = actions\n this.minResolution = minResolution\n this.surroundingImageOpacity = surroundingImageOpacity\n this.loadingCssClass = 'crop-view--is-loading'\n this.panningCssClass = 'crop-view--is-panning'\n this.outlineCssClass = 'crop-outline--active'\n\n // State\n this.isPanning = false\n this.initialCrop = crop\n\n // Events\n this.loadEvent = $.Callbacks()\n this.changeEvent = $.Callbacks()\n\n // Sets up the ready event and state\n this.initializeReadyState()\n\n // Confguration\n this.zoomInStep = zoomStep\n this.zoomOutStep = 1 / this.zoomInStep\n\n this.arenaWidth = this.arena.width()\n this.arenaHeight = this.arena.height()\n\n // todo: consider to calculate maxArea with regards to the\n // maximum space an image can within the area. That should\n // be more reliable.\n if (maxArea) this.maxArea = (this.arenaWidth * this.arenaHeight) * maxArea\n\n if (this.outline) this.setSurroundingImageVisibility(showSurroundingImage)\n\n this.preview = new Preview({\n onReady: this.onPreviewReady,\n img: this.img,\n outline: this.outline,\n opacity: this.surroundingImageOpacity\n })\n\n this.setImage(url)\n }\n\n initializeReadyState () {\n this.isReady = false\n if (this.readyEvent != null) {\n this.readyEvent.empty()\n }\n this.readyEvent = $.Callbacks('memory once')\n }\n\n setImage (url) {\n if (url === this.preview.url) return\n\n if (this.isInitialized) this.preview.reset()\n this.initializeReadyState()\n this.view.addClass(this.loadingCssClass)\n this.preview.setImage({url})\n }\n\n setSurroundingImageVisibility (visibility) {\n // visibility: always|panning|never\n // override opacity in crop-outline--active css class\n this.surroundingImageOpacity = parseFloat(this.surroundingImageOpacity || 0.2)\n\n if (visibility === 'always') {\n this.outline.css('opacity', 1.0)\n } else if (visibility === 'panning') {\n this.outline.css('opacity', null)\n } else { // 'never' default\n this.outline.css('opacity', 0)\n this.surroundingImageOpacity = 0\n }\n }\n\n reset () {\n if (!this.isReady) return\n\n this.resize({width: this.imageWidth, height: this.imageHeight})\n this.zoomAllOut()\n }\n\n onPreviewReady ({width, height}) {\n let keepDimension\n if (!this.isInitialized) {\n this.events = new Events({\n parent: this,\n view: this.view,\n actions: this.actions\n })\n }\n\n this.imageWidth = width\n this.imageHeight = height\n this.imageRatio = this.imageWidth / this.imageHeight\n const imageResolution = this.imageWidth * this.imageHeight\n\n if (this.minResolution && (this.minResolution > imageResolution)) {\n // If the minimal required resolution is bigger than the actual image\n // resolution, we ignore the configuration\n delete this.minResolution\n }\n\n if (this.minResolution) {\n // For any given image resolution with a minimal required resolution\n // we can calculate both, a minimal resolution and a maximal resolution\n const minRatioForResolution = this.minResolution / (this.imageHeight * this.imageHeight)\n if (!this.minViewRatio || (this.minViewRatio < minRatioForResolution)) {\n this.minViewRatio = minRatioForResolution\n }\n const maxRatioForResolution = (this.imageWidth * this.imageWidth) / this.minResolution\n if (!this.maxViewRatio || (this.maxViewRatio > maxRatioForResolution)) {\n this.maxViewRatio = maxRatioForResolution\n }\n }\n\n this.calcMaxMinDimensions()\n\n if (this.fixedWidth) { keepDimension = 'width' }\n if (this.fixedHeight) { keepDimension = 'height' }\n this.setViewDimensions({\n width: this.imageWidth,\n height: this.imageHeight,\n keepDimension\n })\n\n // ready state\n this.isReady = true\n this.view.removeClass(this.loadingCssClass)\n\n if (!this.isInitialized && (this.initialCrop != null)) {\n this.setCrop(this.initialCrop)\n } else {\n this.zoomAllOut()\n this.center()\n }\n\n this.isInitialized = true\n this.readyEvent.fire()\n this.loadEvent.fire()\n }\n\n setCrop ({x, y, width, height}) {\n if (!this.isReady) {\n this.on('ready', () => this.setCrop({x, y, width, height}))\n return\n }\n\n this.resize({width, height})\n\n const factor = this.viewWidth / width\n const previewWidth = this.imageWidth * factor\n\n this.zoom({width: previewWidth})\n this.pan({x: x * factor, y: y * factor})\n }\n\n getCrop () {\n const factor = this.preview.width / this.imageWidth\n const crop = {\n x: this.preview.x / factor,\n y: this.preview.y / factor,\n width: this.viewWidth / factor,\n height: this.viewHeight / factor\n }\n\n this.roundCrop(crop)\n this.validateCrop(crop)\n return crop\n }\n\n roundCrop (crop) {\n for (const name in crop) {\n const value = crop[name]\n crop[name] = Math.round(value)\n }\n }\n\n validateCrop (crop) {\n const {x, y, width, height} = crop\n if ((x + width) > this.imageWidth) {\n crop.width = this.imageWidth - x\n } else if ((y + height) > this.imageHeight) {\n crop.height = this.imageHeight - y\n }\n\n return crop\n }\n\n setRatio (ratio, keepDimension) {\n let height, width\n if (!this.isReady) {\n this.on('ready', () => this.setRatio(ratio, keepDimension))\n return\n }\n\n ratio = this.enforceValidRatio(ratio)\n\n if (keepDimension === 'height') {\n height = this.viewHeight\n width = height * ratio\n } else {\n width = this.viewWidth\n height = width / ratio\n }\n\n this.resizeFocusPoint = this.getFocusPoint()\n return this.resize({width, height})\n }\n\n // Event handling\n // --------------\n\n onPan (data) {\n if (!this.isPanning) {\n this.isPanning = true\n this.arena.addClass(this.panningCssClass)\n this.outline.addClass(this.outlineCssClass)\n }\n\n const newX = data.startX - data.dx\n const newY = data.startY - data.dy\n this.pan({x: newX, y: newY})\n }\n\n onPanEnd () {\n this.isPanning = false\n this.arena.removeClass(this.panningCssClass)\n return this.outline.removeClass(this.outlineCssClass)\n }\n\n onDoubleClick ({pageX, pageY}) {\n const {left, top} = this.view[0].getBoundingClientRect()\n const viewX = pageX - left\n const viewY = pageY - top\n this.zoomIn({viewX, viewY})\n }\n\n onResize ({position, dx, dy}) {\n if (!this.isResizing) {\n this.isResizing = true\n this.resizeFocusPoint = this.getFocusPoint()\n }\n\n if (['top', 'bottom'].includes(position)) {\n dy = 2 * dy // Because it's centered we need to change width by factor two\n this.resize({width: this.viewWidth, height: this.viewHeight + dy, keepDimension: 'height'})\n } else if (['left', 'right'].includes(position)) {\n dx = 2 * dx\n this.resize({width: this.viewWidth + dx, height: this.viewHeight, keepDimension: 'width'})\n }\n }\n\n onResizeEnd () {\n this.isResizing = false\n this.resizeFocusPoint = undefined\n }\n\n resize ({width, height, keepDimension}) {\n this.setViewDimensions({width, height, keepDimension})\n\n // Update view center of focus point\n if (this.resizeFocusPoint) {\n this.resizeFocusPoint.viewX = this.viewWidth / 2\n this.resizeFocusPoint.viewY = this.viewHeight / 2\n }\n\n // Ensure dimensions and focus\n this.zoom({\n width: this.preview.width,\n height: this.preview.height,\n focusPoint: this.resizeFocusPoint\n })\n }\n\n setViewDimensions ({width, height, keepDimension}) {\n if (this.maxArea) {\n ({width, height} = this.enforceMaxArea({width, height, keepDimension}))\n }\n\n ({width, height} = this.enforceViewDimensions({width, height, keepDimension}))\n\n this.view.css({width, height})\n this.viewWidth = width\n this.viewHeight = height\n this.viewRatio = width / height\n\n if (this.minResolution) {\n const minZoomPixelWidth = Math.sqrt(this.minResolution * this.viewRatio)\n const minZoomPixelHeight = Math.sqrt(this.minResolution / this.viewRatio)\n this.maxImageWidth = (this.viewWidth / minZoomPixelWidth) * this.imageWidth\n this.maxImageHeight = (this.viewHeight / minZoomPixelHeight) * this.imageHeight\n }\n\n this.fireChange()\n }\n\n // Update view\n // -----------\n\n zoomAllOut () {\n if (this.isWidthRestricting()) {\n this.zoom({width: this.viewWidth})\n } else {\n this.zoom({height: this.viewHeight})\n }\n }\n\n zoomIn (params) {\n if (params == null) { params = {} }\n if (this.isWidthRestricting()) {\n params.width = this.preview.width * this.zoomInStep\n } else {\n params.height = this.preview.height * this.zoomInStep\n }\n\n this.zoom(params)\n }\n\n zoomOut (params) {\n if (params == null) { params = {} }\n if (this.isWidthRestricting()) {\n params.width = this.preview.width * this.zoomOutStep\n } else {\n params.height = this.preview.height * this.zoomOutStep\n }\n\n this.zoom(params)\n }\n\n zoom ({width, height, viewX, viewY, focusPoint}) {\n if (focusPoint == null) { focusPoint = this.getFocusPoint({viewX, viewY}) }\n\n ({width, height} = this.enforceZoom({width, height}))\n if (width != null) {\n this.preview.setWidth(width)\n this.fireChange()\n } else if (height != null) {\n this.preview.setHeight(height)\n this.fireChange()\n }\n\n this.focus(focusPoint)\n }\n\n // returns {Object} e.g. percentX: 0.2, percentY: 0.5\n getFocusPoint (param) {\n if (param == null) { param = {} }\n let {viewX, viewY} = param\n if (viewX == null) { viewX = this.viewWidth / 2 }\n if (viewY == null) { viewY = this.viewHeight / 2 }\n const x = this.preview.x + viewX\n const y = this.preview.y + viewY\n const percentX = x / this.preview.width\n const percentY = y / this.preview.height\n return {percentX, percentY, viewX, viewY}\n }\n\n focus ({percentX, percentY, viewX, viewY}) {\n let x = this.preview.width * percentX\n let y = this.preview.height * percentY\n x = x - viewX\n y = y - viewY\n\n this.pan({x, y})\n }\n\n center () {\n const newX = (this.preview.width - this.viewWidth) / 2\n const newY = (this.preview.height - this.viewHeight) / 2\n this.pan({x: newX, y: newY})\n }\n\n // @param { Object }\n // - x {Number} pixel to pan to the left\n // - y {Number} pixels to pan to the top\n pan (data) {\n data = this.enforceXy(data)\n this.preview.pan(data.x, data.y)\n this.fireChange()\n }\n\n // Validations\n // -----------\n\n enforceXy ({x, y}) {\n if (x < 0) {\n x = 0\n } else if (x > (this.preview.width - this.viewWidth)) {\n x = this.preview.width - this.viewWidth\n }\n\n if (y < 0) {\n y = 0\n } else if (y > (this.preview.height - this.viewHeight)) {\n y = this.preview.height - this.viewHeight\n }\n\n return {x, y}\n }\n\n enforceZoom ({width, height}) {\n\n if ((width != null) && this.maxImageWidth && (width > this.maxImageWidth)) {\n // prevent zooming in past the required resolution defined by minResolution\n return {width: this.maxImageWidth}\n }\n\n if ((width != null) && (width < this.viewWidth)) {\n // prevent zooming out past covering the view completely\n return {width: this.viewWidth}\n }\n\n if ((height != null) && this.maxImageHeight && (height > this.maxImageHeight)) {\n // prevent zooming in past the required resolution defined by minResolution\n return {height: this.maxImageHeight}\n }\n\n if ((height != null) && (height < this.viewHeight)) {\n // prevent zooming out past covering the view completely\n return {height: this.viewHeight}\n }\n\n return {width, height}\n }\n\n calcMaxMinDimensions () {\n this.maxWidth = this.min([this.arenaWidth, this.imageWidth])\n this.maxHeight = this.min([this.arenaHeight, this.imageHeight])\n this.minWidth = this.minViewWidth || 0\n this.minHeight = this.minViewHeight || 0\n\n if (this.fixedWidth) this.maxWidth = (this.minWidth = this.fixedWidth)\n if (this.fixedHeight) this.maxHeight = (this.minHeight = this.fixedHeight)\n }\n\n areDimensionsValid ({width, height, keepDimension}) {\n const ratio = width / height\n\n const invalid =\n (width < this.minWidth) ||\n (width > this.maxWidth) ||\n (height < this.minHeight) ||\n (height > this.maxHeight) ||\n (ratio < this.minViewRatio) ||\n (ratio > this.maxViewRatio)\n\n return !invalid\n }\n\n isValidRatio (ratio) {\n return !((ratio < this.minViewRatio) || (ratio > this.maxViewRatio))\n }\n\n enforceValidRatio (ratio) {\n if (ratio < this.minViewRatio) return this.minViewRatio\n if (ratio > this.maxViewRatio) return this.maxViewRatio\n return ratio\n }\n\n enforceViewDimensions ({width, height, keepDimension}) {\n let newHeight, newWidth, ratio\n if (width < this.minWidth) newWidth = this.minWidth\n if (width > this.maxWidth) newWidth = this.maxWidth\n if (height < this.minHeight) newHeight = this.minHeight\n if (height > this.maxHeight) newHeight = this.maxHeight\n\n if (keepDimension) {\n if (newWidth) width = newWidth\n if (newHeight) height = newHeight\n\n // check max/min ratios\n ratio = width / height\n if (!this.isValidRatio(ratio)) {\n ratio = this.enforceValidRatio(ratio);\n ({width, height} = this.getRatioBox({ratio, width, height, keepDimension}))\n if ((width > this.arenaWidth) || (height > this.arenaHeight)) {\n ({width, height} = this.centerAlign(this.maxWidth, this.maxHeight, ratio))\n }\n }\n\n } else if (newWidth || newHeight) {\n ratio = this.enforceValidRatio(width / height);\n ({width, height} = this.centerAlign(this.maxWidth, this.maxHeight, ratio))\n }\n\n return {width, height}\n }\n\n enforceMaxArea ({width, height, keepDimension}) {\n let ratio = width / height\n\n if (keepDimension === 'width') {\n height = this.maxArea / width\n ratio = width / height\n } else if (keepDimension === 'height') {\n width = this.maxArea / height\n ratio = width / height\n } else { // keep ratio\n width = Math.sqrt(this.maxArea * ratio)\n height = width / ratio\n }\n\n if (!this.isValidRatio(ratio)) {\n ratio = this.enforceValidRatio(ratio)\n width = Math.sqrt(this.maxArea * ratio)\n height = width / ratio\n }\n\n return {width, height}\n }\n\n // Calculations\n // ------------\n //\n // Ratio: width / height\n // Tall < 1 (Square) < Wide\n // (A ratio less than one is a tall image format and\n // a ratio greater than one is a wide image format)\n\n // Check if the width or height is restricting\n isWidthRestricting () {\n return this.viewRatio >= this.imageRatio\n }\n\n getRatioBox ({ratio, width, height, keepDimension}) {\n if ((keepDimension === 'width') || (height == null)) {\n height = width / ratio\n } else if ((keepDimension === 'height') || (width == null)) {\n width = height * ratio\n } else {\n height = width / ratio\n }\n\n return {width, height}\n }\n\n centerAlign (areaWidth, areaHeight, ratio) {\n let height, width, x, y\n if ((areaWidth / areaHeight) > ratio) {\n width = areaHeight * ratio\n x = (areaWidth - width) / 2\n } else {\n height = areaWidth / ratio\n y = (areaHeight - height) / 2\n }\n\n // return\n return {\n x: x || 0,\n y: y || 0,\n width: width || areaWidth,\n height: height || areaHeight\n }\n }\n\n min (array) {\n let min = array[0]\n for (const number of array) {\n if (number < min) min = number\n }\n\n return min\n }\n\n // Events\n // ------\n\n on (name, callback) {\n return this[`${name}Event`].add(callback)\n }\n\n off (name, callback) {\n return this[`${name}Event`].remove(callback)\n }\n\n // Debounce change events so they are not fired more\n // than once per tick.\n fireChange () {\n if (this.changeDispatch != null) return\n\n this.changeDispatch = setTimeout(() => {\n this.changeDispatch = undefined\n this.changeEvent.fire(this.getCrop())\n }, 0)\n }\n\n // Development helpers\n // -------------------\n\n debug () {\n const r = num => Math.round(num * 10) / 10\n\n const obj = {\n arena: `${r(this.arenaWidth)}x${r(this.arenaHeight)}`,\n view: `${r(this.viewWidth)}x${r(this.viewHeight)}`,\n image: `${r(this.imageWidth)}x${r(this.imageHeight)}`,\n preview: `${r(this.preview.width)}x${r(this.preview.height)}`,\n previewXy: `${r(this.preview.x)}x${r(this.preview.y)}`\n }\n\n console.log(obj) // eslint-disable-line no-console\n return obj\n }\n}\n","const $ = require('jquery')\n\nmodule.exports = class Preview {\n\n constructor ({onReady, img, opacity, outline}) {\n this.onReady = onReady\n this.img = img\n this.opacity = opacity\n this.outline = outline\n this.x = (this.y = 0)\n this.width = (this.height = 0)\n\n this.img.on('load', () => {\n const width = this.img.width()\n const height = this.img.height()\n this.ratio = width / height\n\n this.updateImageDimensions({width, height})\n this.onReady({width: this.width, height: this.height})\n this.img.show()\n })\n }\n\n setImage ({url}) {\n this.url = url\n this.img.attr('src', this.url)\n if (this.outline) this.setBackgroundImage({url: this.url})\n }\n\n setBackgroundImage ({url}) {\n if (this.opacity > 0) {\n const bgImg = $('').css({opacity: this.opacity}).attr('src', url)\n this.outline.append(bgImg)\n }\n }\n\n reset () {\n this.url = undefined\n this.x = (this.y = 0)\n this.width = (this.height = 0)\n this.img.attr('src', '')\n this.img.css({width: '', height: '', transform: ''})\n if (this.outline) this.outline.css({transform: ''}).html('')\n }\n\n setWidth (width) {\n this.img.css({width: `${width}px`, height: 'auto'})\n const height = width / this.ratio\n this.updateImageDimensions({width, height})\n }\n\n setHeight (height) {\n this.img.css({width: 'auto', height: `${height}px`})\n const width = height * this.ratio\n this.updateImageDimensions({width, height})\n }\n\n updateImageDimensions ({width, height}) {\n this.width = width\n this.height = height\n if (this.outline) this.outline.css({width: `${this.width}px`, height: `${this.height}px`})\n }\n\n pan (x1, y1) {\n // Without rounding some numbers would not be set to css.\n // e.g: '-5.14957320384e-14'\n this.x = x1\n this.y = y1\n const x = Math.round(this.x)\n const y = Math.round(this.y)\n this.img.css({transform: `translate(-${x}px, -${y}px)`})\n if (this.outline) this.outline.css({transform: `translate(-${x}px, -${y}px)`})\n }\n}\n\n","const $ = require('jquery')\n\nmodule.exports = class Events {\n constructor ({parent, view, horizontal, vertical, actions}) {\n this.parent = parent\n this.view = view\n this.doubleClickThreshold = 300\n\n // setup events\n if (actions.pan) { this.pan() }\n if (actions.zoomOnDoubleClick) { this.doubleClick() }\n if (actions.resize) {\n this.resizeView({\n horizontal: actions.resizeHorizontal,\n vertical: actions.resizeVertical\n })\n }\n\n this.preventBrowserDragDrop()\n this.responsiveArena()\n }\n\n pan () {\n const $doc = $(document)\n this.view.on('mousedown.srcissors', (e1) => {\n const panData = {\n startX: this.parent.preview.x,\n startY: this.parent.preview.y\n }\n\n e1.preventDefault()\n $doc.on('mousemove.srcissors-pan', (e2) => {\n panData.dx = e2.pageX - e1.pageX\n panData.dy = e2.pageY - e1.pageY\n this.parent.onPan(panData)\n }).on('mouseup.srcissors-pan', () => {\n $doc.off('mouseup.srcissors-pan')\n $doc.off('mousemove.srcissors-pan')\n\n // only trigger panEnd if pan has been called\n if (panData.dx != null) this.parent.onPanEnd()\n })\n })\n }\n\n doubleClick () {\n let lastClick\n\n this.view.on('mousedown.srcissors', event => {\n const now = new Date().getTime()\n if (lastClick && (lastClick > (now - this.doubleClickThreshold))) {\n this.parent.onDoubleClick({pageX: event.pageX, pageY: event.pageY})\n }\n lastClick = now\n })\n }\n\n preventBrowserDragDrop () {\n this.view.on('dragstart.srcissors', () => false)\n }\n\n // Resize View\n // -----------\n\n resizeView ({horizontal, vertical}) {\n const $template = $('
')\n $template.addClass('resize-handler')\n\n let positions = []\n if (horizontal) positions = positions.concat(['right', 'left'])\n if (vertical) positions = positions.concat(['top', 'bottom'])\n\n positions.forEach(position => {\n const $handler = $template.clone()\n $handler.addClass(`resize-handler-${position}`)\n $handler.on('mousedown.srcissors', this.getResizeMouseDown(position))\n\n this.view.append($handler)\n })\n }\n\n getResizeMouseDown (position) {\n const $doc = $(document)\n\n return (event) => {\n let lastX = event.pageX\n let lastY = event.pageY\n\n event.stopPropagation()\n\n $doc.on('mousemove.srcissors-resize', e2 => {\n let dx, dy\n switch (position) {\n case 'top': case 'bottom':\n dy = e2.pageY - lastY\n if (position === 'top') { dy = -dy }\n lastY = e2.pageY\n break\n case 'left': case 'right':\n dx = e2.pageX - lastX\n if (position === 'left') { dx = -dx }\n lastX = e2.pageX\n break\n }\n\n this.parent.onResize({position, dx, dy})\n }).on('mouseup.srcissors-resize', () => {\n $doc.off('mouseup.srcissors-resize')\n $doc.off('mousemove.srcissors-resize')\n\n // only trigger panEnd if pan has been called\n this.parent.onResizeEnd({position})\n })\n }\n }\n\n responsiveArena () {}\n}\n\n// $(window).on('resize', (event) => console.log 'on window resize')\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://srcissors/srcissors.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","modules","installedModules","__webpack_require__","moduleId","i","l","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","Crop","new","_ref","arena","url","fixedWidth","fixedHeight","minWidth","minHeight","minRatio","maxRatio","maxArea","zoomStep","crop","actions","minResolution","surroundingImageOpacity","showSurroundingImage","view","find","preview","img","append","outline","length","undefined","allowedActions","pan","zoomOnDoubleClick","resize","resizeHorizontal","resizeVertical","extend","minViewWidth","minViewHeight","minViewRatio","maxViewRatio","_createForOfIteratorHelper","allowArrayLike","it","iterator","Array","isArray","minLen","_arrayLikeToArray","toString","slice","constructor","from","test","_unsupportedIterableToArray","F","done","e","_e","f","TypeError","err","normalCompletion","didErr","step","next","_e2","return","arr","len","arr2","_defineProperties","target","props","descriptor","configurable","writable","Preview","Events","instance","Constructor","_classCallCheck","this","onPreviewReady","loadingCssClass","panningCssClass","outlineCssClass","isPanning","initialCrop","loadEvent","Callbacks","changeEvent","initializeReadyState","zoomInStep","zoomOutStep","arenaWidth","width","arenaHeight","height","setSurroundingImageVisibility","onReady","opacity","setImage","protoProps","staticProps","isReady","readyEvent","empty","isInitialized","reset","addClass","visibility","parseFloat","css","imageWidth","imageHeight","zoomAllOut","_ref2","keepDimension","events","parent","imageRatio","imageResolution","minRatioForResolution","maxRatioForResolution","calcMaxMinDimensions","setViewDimensions","removeClass","center","setCrop","fire","_ref3","_this","x","y","factor","viewWidth","previewWidth","zoom","on","viewHeight","roundCrop","validateCrop","Math","round","ratio","_this2","enforceValidRatio","resizeFocusPoint","getFocusPoint","setRatio","data","newX","startX","dx","newY","startY","dy","_ref4","pageX","pageY","_this$view$0$getBound","getBoundingClientRect","viewX","left","viewY","top","zoomIn","_ref5","position","isResizing","includes","_ref6","focusPoint","_ref7","_this$enforceMaxArea","enforceMaxArea","_this$enforceViewDime","enforceViewDimensions","viewRatio","minZoomPixelWidth","sqrt","minZoomPixelHeight","maxImageWidth","maxImageHeight","fireChange","isWidthRestricting","params","_ref8","_this$enforceZoom","enforceZoom","setWidth","setHeight","focus","param","_param","percentX","percentY","_ref9","enforceXy","_ref10","_ref11","maxWidth","min","maxHeight","_ref12","_ref13","newHeight","newWidth","isValidRatio","_this$getRatioBox","getRatioBox","_this$centerAlign","centerAlign","_this$centerAlign2","_ref14","_ref15","areaWidth","areaHeight","array","_step","_iterator","number","callback","concat","add","remove","_this3","changeDispatch","setTimeout","getCrop","num","obj","image","previewXy","console","log","updateImageDimensions","show","attr","setBackgroundImage","bgImg","transform","html","x1","y1","getPageCoordinates","event","type","originalEvent","changedTouches","horizontal","vertical","doubleClickThreshold","doubleClick","resizeView","preventBrowserDragDrop","responsiveArena","$doc","document","e1","panData","preventDefault","e2","_getPageCoordinates","_getPageCoordinates2","prevPageX","prevPageY","onPan","off","onPanEnd","lastClick","now","Date","getTime","onDoubleClick","$template","positions","forEach","$handler","clone","getResizeMouseDown","_this4","_getPageCoordinates3","lastX","lastY","stopPropagation","_getPageCoordinates4","onResize","onResizeEnd"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,WACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,UAAWJ,GACO,iBAAZC,QACdA,QAAmB,UAAID,EAAQG,QAAQ,WAEvCJ,EAAgB,UAAIC,EAAQD,EAAa,QAR3C,CASGO,QAAQ,SAASC,GACpB,OAAgB,SAAUC,GAEhB,IAAIC,EAAmB,GAGvB,SAAS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bpH,IACFZ,GAAMA,GAGRgI,EAAQ7H,EACR,MAEF,IAAK,OACL,IAAK,QACHN,EAAKK,EAAQ6H,EAEI,SAAbnH,IACFf,GAAMA,GAGRkI,EAAQ7H,EAIZ2H,EAAOlK,OAAOwK,SAAS,CACrBvH,SAAUA,EACVf,GAAIA,EACJG,GAAIA,OAELlB,GAAG,sDAAsD,WAC1DuH,EAAKW,IAAI,uDACTX,EAAKW,IAAI,wDAETa,EAAOlK,OAAOyK,YAAY,CACxBxH,SAAUA,UAKjB,CACD/K,IAAK,kBACLN,MAAO,iBAnMmEmF,EAAkBS,EAAYjF,UAAWwG,GAAiBC,GAAajC,EAAkBS,EAAawB,GAsM3K1B,EApLqB","file":"./srcissors.js","sourceRoot":""} \ No newline at end of file diff --git a/srcissors.js b/srcissors.js index eb7280a..eb6bdad 100644 --- a/srcissors.js +++ b/srcissors.js @@ -1,2 +1,2 @@ -!function(i,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?exports.srcissors=t(require("jquery")):i.srcissors=t(i.jQuery)}(window,function(i){return function(i){var t={};function e(s){if(t[s])return t[s].exports;var h=t[s]={i:s,l:!1,exports:{}};return i[s].call(h.exports,h,h.exports,e),h.l=!0,h.exports}return e.m=i,e.c=t,e.d=function(i,t,s){e.o(i,t)||Object.defineProperty(i,t,{enumerable:!0,get:s})},e.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},e.t=function(i,t){if(1&t&&(i=e(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.__esModule)return i;var s=Object.create(null);if(e.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var h in i)e.d(s,h,function(t){return i[t]}.bind(null,h));return s},e.n=function(i){var t=i&&i.__esModule?function(){return i.default}:function(){return i};return e.d(t,"a",t),t},e.o=function(i,t){return Object.prototype.hasOwnProperty.call(i,t)},e.p="",e(e.s=1)}([function(t,e){t.exports=i},function(i,t,e){var s=e(0),h=e(2);i.exports={new:function(i){var t=i.arena,e=i.url,n=i.fixedWidth,a=i.fixedHeight,o=i.minWidth,r=i.minHeight,u=i.minRatio,c=i.maxRatio,l=i.maxArea,g=i.zoomStep,d=i.crop,v=i.actions,m=i.minResolution,w=i.surroundingImageOpacity,p=i.showSurroundingImage,f=(t=s(t)).find(".crop-view"),y=f.find(".crop-preview"),x=s("");y.append(x);var k=f.find(".crop-outline");k.length||(k=void 0);var R={pan:!0,zoomOnDoubleClick:!0,resize:!0,resizeHorizontal:!n,resizeVertical:!a};return s.extend(R,v),null==g&&(g=1.25),null==o&&(o=50),null==r&&(r=50),new h({url:e,crop:d,arena:t,view:f,img:x,outline:k,showSurroundingImage:p,surroundingImageOpacity:w,fixedWidth:n,fixedHeight:a,minViewWidth:o,minViewHeight:r,minViewRatio:u,maxViewRatio:c,maxArea:l,zoomStep:g,actions:R,minResolution:m})}}},function(i,t,e){function s(i,t){for(var e=0;eh&&delete this.minResolution,this.minResolution){var n=this.minResolution/(this.imageHeight*this.imageHeight);(!this.minViewRatio||this.minViewRatioo)&&(this.maxViewRatio=o)}this.calcMaxMinDimensions(),this.fixedWidth&&(t="width"),this.fixedHeight&&(t="height"),this.setViewDimensions({width:this.imageWidth,height:this.imageHeight,keepDimension:t}),this.isReady=!0,this.view.removeClass(this.loadingCssClass),this.isInitialized||null==this.initialCrop?(this.zoomAllOut(),this.center()):this.setCrop(this.initialCrop),this.isInitialized=!0,this.readyEvent.fire(),this.loadEvent.fire()}},{key:"setCrop",value:function(i){var t=this,e=i.x,s=i.y,h=i.width,n=i.height;if(this.isReady){this.resize({width:h,height:n});var a=this.viewWidth/h,o=this.imageWidth*a;this.zoom({width:o}),this.pan({x:e*a,y:s*a})}else this.on("ready",function(){return t.setCrop({x:e,y:s,width:h,height:n})})}},{key:"getCrop",value:function(){var i=this.preview.width/this.imageWidth,t={x:this.preview.x/i,y:this.preview.y/i,width:this.viewWidth/i,height:this.viewHeight/i};return this.roundCrop(t),this.validateCrop(t),t}},{key:"roundCrop",value:function(i){for(var t in i){var e=i[t];i[t]=Math.round(e)}}},{key:"validateCrop",value:function(i){var t=i.x,e=i.y,s=i.width,h=i.height;return t+s>this.imageWidth?i.width=this.imageWidth-t:e+h>this.imageHeight&&(i.height=this.imageHeight-e),i}},{key:"setRatio",value:function(i,t){var e,s,h=this;if(this.isReady)return i=this.enforceValidRatio(i),"height"===t?s=(e=this.viewHeight)*i:e=(s=this.viewWidth)/i,this.resizeFocusPoint=this.getFocusPoint(),this.resize({width:s,height:e});this.on("ready",function(){return h.setRatio(i,t)})}},{key:"onPan",value:function(i){this.isPanning||(this.isPanning=!0,this.arena.addClass(this.panningCssClass),this.outline.addClass(this.outlineCssClass));var t=i.startX-i.dx,e=i.startY-i.dy;this.pan({x:t,y:e})}},{key:"onPanEnd",value:function(){return this.isPanning=!1,this.arena.removeClass(this.panningCssClass),this.outline.removeClass(this.outlineCssClass)}},{key:"onDoubleClick",value:function(i){var t=i.pageX,e=i.pageY,s=this.view[0].getBoundingClientRect(),h=t-s.left,n=e-s.top;this.zoomIn({viewX:h,viewY:n})}},{key:"onResize",value:function(i){var t=i.position,e=i.dx,s=i.dy;this.isResizing||(this.isResizing=!0,this.resizeFocusPoint=this.getFocusPoint()),["top","bottom"].includes(t)?(s*=2,this.resize({width:this.viewWidth,height:this.viewHeight+s,keepDimension:"height"})):["left","right"].includes(t)&&(e*=2,this.resize({width:this.viewWidth+e,height:this.viewHeight,keepDimension:"width"}))}},{key:"onResizeEnd",value:function(){this.isResizing=!1,this.resizeFocusPoint=void 0}},{key:"resize",value:function(i){var t=i.width,e=i.height,s=i.keepDimension;this.setViewDimensions({width:t,height:e,keepDimension:s}),this.resizeFocusPoint&&(this.resizeFocusPoint.viewX=this.viewWidth/2,this.resizeFocusPoint.viewY=this.viewHeight/2),this.zoom({width:this.preview.width,height:this.preview.height,focusPoint:this.resizeFocusPoint})}},{key:"setViewDimensions",value:function(i){var t=i.width,e=i.height,s=i.keepDimension;if(this.maxArea){var h=this.enforceMaxArea({width:t,height:e,keepDimension:s});t=h.width,e=h.height}var n=this.enforceViewDimensions({width:t,height:e,keepDimension:s});if(t=n.width,e=n.height,this.view.css({width:t,height:e}),this.viewWidth=t,this.viewHeight=e,this.viewRatio=t/e,this.minResolution){var a=Math.sqrt(this.minResolution*this.viewRatio),o=Math.sqrt(this.minResolution/this.viewRatio);this.maxImageWidth=this.viewWidth/a*this.imageWidth,this.maxImageHeight=this.viewHeight/o*this.imageHeight}this.fireChange()}},{key:"zoomAllOut",value:function(){this.isWidthRestricting()?this.zoom({width:this.viewWidth}):this.zoom({height:this.viewHeight})}},{key:"zoomIn",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomInStep:i.height=this.preview.height*this.zoomInStep,this.zoom(i)}},{key:"zoomOut",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomOutStep:i.height=this.preview.height*this.zoomOutStep,this.zoom(i)}},{key:"zoom",value:function(i){var t=i.width,e=i.height,s=i.viewX,h=i.viewY,n=i.focusPoint;null==n&&(n=this.getFocusPoint({viewX:s,viewY:h}));var a=this.enforceZoom({width:t,height:e});t=a.width,e=a.height,null!=t?(this.preview.setWidth(t),this.fireChange()):null!=e&&(this.preview.setHeight(e),this.fireChange()),this.focus(n)}},{key:"getFocusPoint",value:function(i){null==i&&(i={});var t=i,e=t.viewX,s=t.viewY;null==e&&(e=this.viewWidth/2),null==s&&(s=this.viewHeight/2);var h=this.preview.x+e,n=this.preview.y+s;return{percentX:h/this.preview.width,percentY:n/this.preview.height,viewX:e,viewY:s}}},{key:"focus",value:function(i){var t=i.percentX,e=i.percentY,s=i.viewX,h=i.viewY,n=this.preview.width*t,a=this.preview.height*e;n-=s,a-=h,this.pan({x:n,y:a})}},{key:"center",value:function(){var i=(this.preview.width-this.viewWidth)/2,t=(this.preview.height-this.viewHeight)/2;this.pan({x:i,y:t})}},{key:"pan",value:function(i){i=this.enforceXy(i),this.preview.pan(i.x,i.y),this.fireChange()}},{key:"enforceXy",value:function(i){var t=i.x,e=i.y;return t<0?t=0:t>this.preview.width-this.viewWidth&&(t=this.preview.width-this.viewWidth),e<0?e=0:e>this.preview.height-this.viewHeight&&(e=this.preview.height-this.viewHeight),{x:t,y:e}}},{key:"enforceZoom",value:function(i){var t=i.width,e=i.height;return null!=t&&this.maxImageWidth&&t>this.maxImageWidth?{width:this.maxImageWidth}:null!=t&&tthis.maxImageHeight?{height:this.maxImageHeight}:null!=e&&ethis.maxWidth||ethis.maxHeight||sthis.maxViewRatio)}},{key:"isValidRatio",value:function(i){return!(ithis.maxViewRatio)}},{key:"enforceValidRatio",value:function(i){return ithis.maxViewRatio?this.maxViewRatio:i}},{key:"enforceViewDimensions",value:function(i){var t,e,s,h=i.width,n=i.height,a=i.keepDimension;if(hthis.maxWidth&&(e=this.maxWidth),nthis.maxHeight&&(t=this.maxHeight),a){if(e&&(h=e),t&&(n=t),s=h/n,!this.isValidRatio(s)){s=this.enforceValidRatio(s);var o=this.getRatioBox({ratio:s,width:h,height:n,keepDimension:a});if(h=o.width,n=o.height,h>this.arenaWidth||n>this.arenaHeight){var r=this.centerAlign(this.maxWidth,this.maxHeight,s);h=r.width,n=r.height}}}else if(e||t){s=this.enforceValidRatio(h/n);var u=this.centerAlign(this.maxWidth,this.maxHeight,s);h=u.width,n=u.height}return{width:h,height:n}}},{key:"enforceMaxArea",value:function(i){var t=i.width,e=i.height,s=i.keepDimension,h=t/e;return"width"===s?h=t/(e=this.maxArea/t):"height"===s?h=(t=this.maxArea/e)/e:e=(t=Math.sqrt(this.maxArea*h))/h,this.isValidRatio(h)||(h=this.enforceValidRatio(h),e=(t=Math.sqrt(this.maxArea*h))/h),{width:t,height:e}}},{key:"isWidthRestricting",value:function(){return this.viewRatio>=this.imageRatio}},{key:"getRatioBox",value:function(i){var t=i.ratio,e=i.width,s=i.height,h=i.keepDimension;return"width"===h||null==s?s=e/t:"height"===h||null==e?e=s*t:s=e/t,{width:e,height:s}}},{key:"centerAlign",value:function(i,t,e){var s,h,n,a;return i/t>e?n=(i-(h=t*e))/2:a=(t-(s=i/e))/2,{x:n||0,y:a||0,width:h||i,height:s||t}}},{key:"min",value:function(i){var t=i[0],e=!0,s=!1,h=void 0;try{for(var n,a=i[Symbol.iterator]();!(e=(n=a.next()).done);e=!0){var o=n.value;o0){var e=h("").css({opacity:this.opacity}).attr("src",t);this.outline.append(e)}}},{key:"reset",value:function(){this.url=void 0,this.x=this.y=0,this.width=this.height=0,this.img.attr("src",""),this.img.css({width:"",height:"",transform:""}),this.outline&&this.outline.css({transform:""}).html("")}},{key:"setWidth",value:function(i){this.img.css({width:"".concat(i,"px"),height:"auto"});var t=i/this.ratio;this.updateImageDimensions({width:i,height:t})}},{key:"setHeight",value:function(i){this.img.css({width:"auto",height:"".concat(i,"px")});var t=i*this.ratio;this.updateImageDimensions({width:t,height:i})}},{key:"updateImageDimensions",value:function(i){var t=i.width,e=i.height;this.width=t,this.height=e,this.outline&&this.outline.css({width:"".concat(this.width,"px"),height:"".concat(this.height,"px")})}},{key:"pan",value:function(i,t){this.x=i,this.y=t;var e=Math.round(this.x),s=Math.round(this.y);this.img.css({transform:"translate(-".concat(e,"px, -").concat(s,"px)")}),this.outline&&this.outline.css({transform:"translate(-".concat(e,"px, -").concat(s,"px)")})}}]),i}()},function(i,t,e){function s(i,t){for(var e=0;es-t.doubleClickThreshold&&t.parent.onDoubleClick({pageX:e.pageX,pageY:e.pageY}),i=s})}},{key:"preventBrowserDragDrop",value:function(){this.view.on("dragstart.srcissors",function(){return!1})}},{key:"resizeView",value:function(i){var t=this,e=i.horizontal,s=i.vertical,n=h("
");n.addClass("resize-handler");var a=[];e&&(a=a.concat(["right","left"])),s&&(a=a.concat(["top","bottom"])),a.forEach(function(i){var e=n.clone();e.addClass("resize-handler-".concat(i)),e.on("mousedown.srcissors",t.getResizeMouseDown(i)),t.view.append(e)})}},{key:"getResizeMouseDown",value:function(i){var t=this,e=h(document);return function(s){var h=s.pageX,n=s.pageY;s.stopPropagation(),e.on("mousemove.srcissors-resize",function(e){var s,a;switch(i){case"top":case"bottom":a=e.pageY-n,"top"===i&&(a=-a),n=e.pageY;break;case"left":case"right":s=e.pageX-h,"left"===i&&(s=-s),h=e.pageX}t.parent.onResize({position:i,dx:s,dy:a})}).on("mouseup.srcissors-resize",function(){e.off("mouseup.srcissors-resize"),e.off("mousemove.srcissors-resize"),t.parent.onResizeEnd({position:i})})}}},{key:"responsiveArena",value:function(){}}]),i}()}])}); +!function(i,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?exports.srcissors=t(require("jquery")):i.srcissors=t(i.jQuery)}(window,(function(i){return function(i){var t={};function e(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return i[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=i,e.c=t,e.d=function(i,t,s){e.o(i,t)||Object.defineProperty(i,t,{enumerable:!0,get:s})},e.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},e.t=function(i,t){if(1&t&&(i=e(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.__esModule)return i;var s=Object.create(null);if(e.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var n in i)e.d(s,n,function(t){return i[t]}.bind(null,n));return s},e.n=function(i){var t=i&&i.__esModule?function(){return i.default}:function(){return i};return e.d(t,"a",t),t},e.o=function(i,t){return Object.prototype.hasOwnProperty.call(i,t)},e.p="",e(e.s=1)}([function(t,e){t.exports=i},function(i,t,e){var s=e(0),n=e(2);i.exports={new:function(i){var t=i.arena,e=i.url,h=i.fixedWidth,o=i.fixedHeight,a=i.minWidth,r=i.minHeight,u=i.minRatio,c=i.maxRatio,l=i.maxArea,g=i.zoomStep,d=i.crop,v=i.actions,m=i.minResolution,w=i.surroundingImageOpacity,p=i.showSurroundingImage,f=(t=s(t)).find(".crop-view"),y=f.find(".crop-preview"),x=s("");y.append(x);var k=f.find(".crop-outline");k.length||(k=void 0);var R={pan:!0,zoomOnDoubleClick:!0,resize:!0,resizeHorizontal:!h,resizeVertical:!o};return s.extend(R,v),null==g&&(g=1.25),null==a&&(a=50),null==r&&(r=50),new n({url:e,crop:d,arena:t,view:f,img:x,outline:k,showSurroundingImage:p,surroundingImageOpacity:w,fixedWidth:h,fixedHeight:o,minViewWidth:a,minViewHeight:r,minViewRatio:u,maxViewRatio:c,maxArea:l,zoomStep:g,actions:R,minResolution:m})}}},function(i,t,e){function s(i,t){var e;if("undefined"==typeof Symbol||null==i[Symbol.iterator]){if(Array.isArray(i)||(e=function(i,t){if(!i)return;if("string"==typeof i)return n(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);"Object"===e&&i.constructor&&(e=i.constructor.name);if("Map"===e||"Set"===e)return Array.from(i);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return n(i,t)}(i))||t&&i&&"number"==typeof i.length){e&&(i=e);var s=0,h=function(){};return{s:h,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(i){throw i},f:h}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,r=!1;return{s:function(){e=i[Symbol.iterator]()},n:function(){var i=e.next();return a=i.done,i},e:function(i){r=!0,o=i},f:function(){try{a||null==e.return||e.return()}finally{if(r)throw o}}}}function n(i,t){(null==t||t>i.length)&&(t=i.length);for(var e=0,s=new Array(t);en&&delete this.minResolution,this.minResolution){var h=this.minResolution/(this.imageHeight*this.imageHeight);(!this.minViewRatio||this.minViewRatioo)&&(this.maxViewRatio=o)}this.calcMaxMinDimensions(),this.fixedWidth&&(t="width"),this.fixedHeight&&(t="height"),this.setViewDimensions({width:this.imageWidth,height:this.imageHeight,keepDimension:t}),this.isReady=!0,this.view.removeClass(this.loadingCssClass),this.isInitialized||null==this.initialCrop?(this.zoomAllOut(),this.center()):this.setCrop(this.initialCrop),this.isInitialized=!0,this.readyEvent.fire(),this.loadEvent.fire()}},{key:"setCrop",value:function(i){var t=this,e=i.x,s=i.y,n=i.width,h=i.height;if(this.isReady){this.resize({width:n,height:h});var o=this.viewWidth/n,a=this.imageWidth*o;this.zoom({width:a}),this.pan({x:e*o,y:s*o})}else this.on("ready",(function(){return t.setCrop({x:e,y:s,width:n,height:h})}))}},{key:"getCrop",value:function(){var i=this.preview.width/this.imageWidth,t={x:this.preview.x/i,y:this.preview.y/i,width:this.viewWidth/i,height:this.viewHeight/i};return this.roundCrop(t),this.validateCrop(t),t}},{key:"roundCrop",value:function(i){for(var t in i){var e=i[t];i[t]=Math.round(e)}}},{key:"validateCrop",value:function(i){var t=i.x,e=i.y,s=i.width,n=i.height;return t+s>this.imageWidth?i.width=this.imageWidth-t:e+n>this.imageHeight&&(i.height=this.imageHeight-e),i}},{key:"setRatio",value:function(i,t){var e,s,n=this;if(this.isReady)return i=this.enforceValidRatio(i),"height"===t?s=(e=this.viewHeight)*i:e=(s=this.viewWidth)/i,this.resizeFocusPoint=this.getFocusPoint(),this.resize({width:s,height:e});this.on("ready",(function(){return n.setRatio(i,t)}))}},{key:"onPan",value:function(i){this.isPanning||(this.isPanning=!0,this.arena.addClass(this.panningCssClass),this.outline.addClass(this.outlineCssClass));var t=i.startX-i.dx,e=i.startY-i.dy;this.pan({x:t,y:e})}},{key:"onPanEnd",value:function(){return this.isPanning=!1,this.arena.removeClass(this.panningCssClass),this.outline.removeClass(this.outlineCssClass)}},{key:"onDoubleClick",value:function(i){var t=i.pageX,e=i.pageY,s=this.view[0].getBoundingClientRect(),n=t-s.left,h=e-s.top;this.zoomIn({viewX:n,viewY:h})}},{key:"onResize",value:function(i){var t=i.position,e=i.dx,s=i.dy;this.isResizing||(this.isResizing=!0,this.resizeFocusPoint=this.getFocusPoint()),["top","bottom"].includes(t)?(s*=2,this.resize({width:this.viewWidth,height:this.viewHeight+s,keepDimension:"height"})):["left","right"].includes(t)&&(e*=2,this.resize({width:this.viewWidth+e,height:this.viewHeight,keepDimension:"width"}))}},{key:"onResizeEnd",value:function(){this.isResizing=!1,this.resizeFocusPoint=void 0}},{key:"resize",value:function(i){var t=i.width,e=i.height,s=i.keepDimension;this.setViewDimensions({width:t,height:e,keepDimension:s}),this.resizeFocusPoint&&(this.resizeFocusPoint.viewX=this.viewWidth/2,this.resizeFocusPoint.viewY=this.viewHeight/2),this.zoom({width:this.preview.width,height:this.preview.height,focusPoint:this.resizeFocusPoint})}},{key:"setViewDimensions",value:function(i){var t=i.width,e=i.height,s=i.keepDimension;if(this.maxArea){var n=this.enforceMaxArea({width:t,height:e,keepDimension:s});t=n.width,e=n.height}var h=this.enforceViewDimensions({width:t,height:e,keepDimension:s});if(t=h.width,e=h.height,this.view.css({width:t,height:e}),this.viewWidth=t,this.viewHeight=e,this.viewRatio=t/e,this.minResolution){var o=Math.sqrt(this.minResolution*this.viewRatio),a=Math.sqrt(this.minResolution/this.viewRatio);this.maxImageWidth=this.viewWidth/o*this.imageWidth,this.maxImageHeight=this.viewHeight/a*this.imageHeight}this.fireChange()}},{key:"zoomAllOut",value:function(){this.isWidthRestricting()?this.zoom({width:this.viewWidth}):this.zoom({height:this.viewHeight})}},{key:"zoomIn",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomInStep:i.height=this.preview.height*this.zoomInStep,this.zoom(i)}},{key:"zoomOut",value:function(i){null==i&&(i={}),this.isWidthRestricting()?i.width=this.preview.width*this.zoomOutStep:i.height=this.preview.height*this.zoomOutStep,this.zoom(i)}},{key:"zoom",value:function(i){var t=i.width,e=i.height,s=i.viewX,n=i.viewY,h=i.focusPoint;null==h&&(h=this.getFocusPoint({viewX:s,viewY:n}));var o=this.enforceZoom({width:t,height:e});t=o.width,e=o.height,null!=t?(this.preview.setWidth(t),this.fireChange()):null!=e&&(this.preview.setHeight(e),this.fireChange()),this.focus(h)}},{key:"getFocusPoint",value:function(i){null==i&&(i={});var t=i,e=t.viewX,s=t.viewY;null==e&&(e=this.viewWidth/2),null==s&&(s=this.viewHeight/2);var n=this.preview.x+e,h=this.preview.y+s;return{percentX:n/this.preview.width,percentY:h/this.preview.height,viewX:e,viewY:s}}},{key:"focus",value:function(i){var t=i.percentX,e=i.percentY,s=i.viewX,n=i.viewY,h=this.preview.width*t,o=this.preview.height*e;h-=s,o-=n,this.pan({x:h,y:o})}},{key:"center",value:function(){var i=(this.preview.width-this.viewWidth)/2,t=(this.preview.height-this.viewHeight)/2;this.pan({x:i,y:t})}},{key:"pan",value:function(i){i=this.enforceXy(i),this.preview.pan(i.x,i.y),this.fireChange()}},{key:"enforceXy",value:function(i){var t=i.x,e=i.y;return t<0?t=0:t>this.preview.width-this.viewWidth&&(t=this.preview.width-this.viewWidth),e<0?e=0:e>this.preview.height-this.viewHeight&&(e=this.preview.height-this.viewHeight),{x:t,y:e}}},{key:"enforceZoom",value:function(i){var t=i.width,e=i.height;return null!=t&&this.maxImageWidth&&t>this.maxImageWidth?{width:this.maxImageWidth}:null!=t&&tthis.maxImageHeight?{height:this.maxImageHeight}:null!=e&&ethis.maxWidth||ethis.maxHeight||sthis.maxViewRatio)}},{key:"isValidRatio",value:function(i){return!(ithis.maxViewRatio)}},{key:"enforceValidRatio",value:function(i){return ithis.maxViewRatio?this.maxViewRatio:i}},{key:"enforceViewDimensions",value:function(i){var t,e,s,n=i.width,h=i.height,o=i.keepDimension;if(nthis.maxWidth&&(e=this.maxWidth),hthis.maxHeight&&(t=this.maxHeight),o){if(e&&(n=e),t&&(h=t),s=n/h,!this.isValidRatio(s)){s=this.enforceValidRatio(s);var a=this.getRatioBox({ratio:s,width:n,height:h,keepDimension:o});if(n=a.width,h=a.height,n>this.arenaWidth||h>this.arenaHeight){var r=this.centerAlign(this.maxWidth,this.maxHeight,s);n=r.width,h=r.height}}}else if(e||t){s=this.enforceValidRatio(n/h);var u=this.centerAlign(this.maxWidth,this.maxHeight,s);n=u.width,h=u.height}return{width:n,height:h}}},{key:"enforceMaxArea",value:function(i){var t=i.width,e=i.height,s=i.keepDimension,n=t/e;return"width"===s?n=t/(e=this.maxArea/t):"height"===s?n=(t=this.maxArea/e)/e:e=(t=Math.sqrt(this.maxArea*n))/n,this.isValidRatio(n)||(n=this.enforceValidRatio(n),e=(t=Math.sqrt(this.maxArea*n))/n),{width:t,height:e}}},{key:"isWidthRestricting",value:function(){return this.viewRatio>=this.imageRatio}},{key:"getRatioBox",value:function(i){var t=i.ratio,e=i.width,s=i.height,n=i.keepDimension;return"width"===n||null==s?s=e/t:"height"===n||null==e?e=s*t:s=e/t,{width:e,height:s}}},{key:"centerAlign",value:function(i,t,e){var s,n,h,o;return i/t>e?h=(i-(n=t*e))/2:o=(t-(s=i/e))/2,{x:h||0,y:o||0,width:n||i,height:s||t}}},{key:"min",value:function(i){var t,e=i[0],n=s(i);try{for(n.s();!(t=n.n()).done;){var h=t.value;h0){var e=n("").css({opacity:this.opacity}).attr("src",t);this.outline.append(e)}}},{key:"reset",value:function(){this.url=void 0,this.x=this.y=0,this.width=this.height=0,this.img.attr("src",""),this.img.css({width:"",height:"",transform:""}),this.outline&&this.outline.css({transform:""}).html("")}},{key:"setWidth",value:function(i){this.img.css({width:"".concat(i,"px"),height:"auto"});var t=i/this.ratio;this.updateImageDimensions({width:i,height:t})}},{key:"setHeight",value:function(i){this.img.css({width:"auto",height:"".concat(i,"px")});var t=i*this.ratio;this.updateImageDimensions({width:t,height:i})}},{key:"updateImageDimensions",value:function(i){var t=i.width,e=i.height;this.width=t,this.height=e,this.outline&&this.outline.css({width:"".concat(this.width,"px"),height:"".concat(this.height,"px")})}},{key:"pan",value:function(i,t){this.x=i,this.y=t;var e=Math.round(this.x),s=Math.round(this.y);this.img.css({transform:"translate(-".concat(e,"px, -").concat(s,"px)")}),this.outline&&this.outline.css({transform:"translate(-".concat(e,"px, -").concat(s,"px)")})}}])&&s(t.prototype,e),h&&s(t,h),i}()},function(i,t,e){function s(i,t){for(var e=0;es-t.doubleClickThreshold&&t.parent.onDoubleClick(h(e)),i=s}))}},{key:"preventBrowserDragDrop",value:function(){this.view.on("dragstart.srcissors",(function(){return!1}))}},{key:"resizeView",value:function(i){var t=this,e=i.horizontal,s=i.vertical,h=n("
");h.addClass("resize-handler");var o=[];e&&(o=o.concat(["right","left"])),s&&(o=o.concat(["top","bottom"])),o.forEach((function(i){var e=h.clone();e.addClass("resize-handler-".concat(i)),e.on("mousedown.srcissors touchstart.srcissors",t.getResizeMouseDown(i)),t.view.append(e)}))}},{key:"getResizeMouseDown",value:function(i){var t=this,e=n(document);return function(s){var n=h(s),o=n.pageX,a=n.pageY;s.stopPropagation(),e.on("mousemove.srcissors-resize touchmove.srcissors-resize",(function(e){var s,n,r=h(e),u=r.pageX,c=r.pageY;switch(i){case"top":case"bottom":n=c-a,"top"===i&&(n=-n),a=c;break;case"left":case"right":s=u-o,"left"===i&&(s=-s),o=u}t.parent.onResize({position:i,dx:s,dy:n})})).on("mouseup.srcissors-resize touchend.srcissors-resize",(function(){e.off("mouseup.srcissors-resize touchmove.srcissors-resize"),e.off("mousemove.srcissors-resize touchend.srcissors-resize"),t.parent.onResizeEnd({position:i})}))}}},{key:"responsiveArena",value:function(){}}])&&s(t.prototype,e),o&&s(t,o),i}()}])})); //# sourceMappingURL=srcissors.js.map \ No newline at end of file diff --git a/srcissors.js.map b/srcissors.js.map index af2e158..39d7e8a 100644 --- a/srcissors.js.map +++ b/srcissors.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://srcissors/webpack/universalModuleDefinition","webpack://srcissors/webpack/bootstrap","webpack://srcissors/external {\"commonjs\":\"jquery\",\"commonjs2\":\"jquery\",\"amd\":\"jquery\",\"root\":\"jQuery\"}","webpack://srcissors/./src/srcissors.js","webpack://srcissors/./src/crop.js","webpack://srcissors/./src/preview.js","webpack://srcissors/./src/events.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","Crop","new","_ref","arena","url","fixedWidth","fixedHeight","minWidth","minHeight","minRatio","maxRatio","maxArea","zoomStep","crop","actions","minResolution","surroundingImageOpacity","showSurroundingImage","view","find","preview","img","append","outline","length","undefined","allowedActions","pan","zoomOnDoubleClick","resize","resizeHorizontal","resizeVertical","extend","minViewWidth","minViewHeight","minViewRatio","maxViewRatio","Preview","Events","_classCallCheck","this","onPreviewReady","loadingCssClass","panningCssClass","outlineCssClass","isPanning","initialCrop","loadEvent","Callbacks","changeEvent","initializeReadyState","zoomInStep","zoomOutStep","arenaWidth","width","arenaHeight","height","setSurroundingImageVisibility","onReady","opacity","setImage","_createClass","isReady","readyEvent","empty","isInitialized","reset","addClass","visibility","parseFloat","css","imageWidth","imageHeight","zoomAllOut","_ref2","keepDimension","events","parent","imageRatio","imageResolution","minRatioForResolution","maxRatioForResolution","calcMaxMinDimensions","setViewDimensions","removeClass","center","setCrop","fire","_ref3","_this","x","y","factor","viewWidth","previewWidth","zoom","on","viewHeight","roundCrop","validateCrop","Math","round","ratio","_this2","enforceValidRatio","resizeFocusPoint","getFocusPoint","setRatio","data","newX","startX","dx","newY","startY","dy","_ref4","pageX","pageY","_this$view$0$getBound","getBoundingClientRect","viewX","left","viewY","top","zoomIn","_ref5","position","isResizing","includes","_ref6","focusPoint","_ref7","_this$enforceMaxArea","enforceMaxArea","_this$enforceViewDime","enforceViewDimensions","viewRatio","minZoomPixelWidth","sqrt","minZoomPixelHeight","maxImageWidth","maxImageHeight","fireChange","isWidthRestricting","params","_ref8","_this$enforceZoom","enforceZoom","setWidth","setHeight","focus","param","_param","percentX","percentY","_ref9","enforceXy","_ref10","_ref11","maxWidth","min","maxHeight","_ref12","_ref13","newHeight","newWidth","isValidRatio","_this$getRatioBox","getRatioBox","_this$centerAlign","centerAlign","_this$centerAlign2","_ref14","_ref15","areaWidth","areaHeight","array","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","next","done","number","err","return","callback","concat","add","remove","_this3","changeDispatch","setTimeout","getCrop","num","obj","image","previewXy","console","log","updateImageDimensions","show","attr","setBackgroundImage","bgImg","transform","html","x1","y1","horizontal","vertical","doubleClickThreshold","doubleClick","resizeView","preventBrowserDragDrop","responsiveArena","$doc","document","e1","panData","preventDefault","e2","onPan","off","onPanEnd","lastClick","event","now","Date","getTime","onDoubleClick","$template","positions","forEach","$handler","clone","getResizeMouseDown","_this4","lastX","lastY","stopPropagation","onResize","onResizeEnd"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,WACA,mBAAAC,eAAAC,IACAD,QAAA,UAAAJ,GACA,iBAAAC,QACAA,QAAA,UAAAD,EAAAG,QAAA,WAEAJ,EAAA,UAAAC,EAAAD,EAAA,QARA,CASCO,OAAA,SAAAC,GACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAT,QAGA,IAAAC,EAAAM,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAX,YAUA,OANAY,EAAAH,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAU,GAAA,EAGAV,EAAAD,QA0DA,OArDAQ,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAhB,EAAAiB,EAAAC,GACAV,EAAAW,EAAAnB,EAAAiB,IACAG,OAAAC,eAAArB,EAAAiB,GAA0CK,YAAA,EAAAC,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AKI,OAAOsN,QA3EvBtP,IAAA,qBAAAN,MAAA,SA+EsB8I,GAAU,IAAAiH,EAAAvM,KACtBkL,EAAO3N,EAAE4N,UAEf,OAAO,SAACS,GACN,IAAIY,EAAQZ,EAAMhH,MACd6H,EAAQb,EAAM/G,MAElB+G,EAAMc,kBAENxB,EAAK1H,GAAG,6BAA8B,SAAA+H,GACpC,IAAIhH,EAAIG,EACR,OAAQY,GACN,IAAK,MAAO,IAAK,SACfZ,EAAK6G,EAAG1G,MAAQ4H,EACC,QAAbnH,IAAsBZ,GAAMA,GAChC+H,EAAQlB,EAAG1G,MACX,MACF,IAAK,OAAQ,IAAK,QAChBN,EAAKgH,EAAG3G,MAAQ4H,EACC,SAAblH,IAAuBf,GAAMA,GACjCiI,EAAQjB,EAAG3G,MAIf2H,EAAKlK,OAAOsK,UAAUrH,WAAUf,KAAIG,SACnClB,GAAG,2BAA4B,WAChC0H,EAAKO,IAAI,4BACTP,EAAKO,IAAI,8BAGTc,EAAKlK,OAAOuK,aAAatH,mBA7GjCxI,IAAA,kBAAAN,MAAA,gBAAAsD,EAAA","file":"./srcissors.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"srcissors\"] = factory(require(\"jquery\"));\n\telse\n\t\troot[\"srcissors\"] = factory(root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","const $ = require('jquery')\nconst Crop = require('./crop')\n\nmodule.exports = {\n new ({\n arena, url, fixedWidth, fixedHeight, minWidth, minHeight,\n minRatio, maxRatio, maxArea, zoomStep, crop, actions, minResolution,\n surroundingImageOpacity, showSurroundingImage\n }) {\n arena = $(arena)\n const view = arena.find('.crop-view')\n const preview = view.find('.crop-preview')\n const img = $('')\n preview.append(img)\n let outline = view.find('.crop-outline')\n if (!outline.length) { outline = undefined }\n\n const allowedActions = {\n pan: true,\n zoomOnDoubleClick: true,\n resize: true,\n resizeHorizontal: !fixedWidth,\n resizeVertical: !fixedHeight\n }\n\n $.extend(allowedActions, actions)\n\n if (zoomStep == null) { zoomStep = 1.25 }\n\n if (minWidth == null) { minWidth = 50 }\n if (minHeight == null) { minHeight = 50 }\n\n return new Crop({\n url, // {String}\n crop, // {Object} Set an inital crop. This is the same as calling setCrop()\n arena, // {jQuery Element}\n view, // {jQuery Element}\n img, // {jQuery Element}\n outline, // {jQuery Element or undefined}\n showSurroundingImage, // {String} always|panning|never\n surroundingImageOpacity, // {Number} e.g. in the 0.0 - 1.0 range\n fixedWidth, // {Number} e.g. 300\n fixedHeight, // {Number} e.g. 500\n minViewWidth: minWidth, // {Number} e.g. 100\n minViewHeight: minHeight, // {Number} e.g. 100\n minViewRatio: minRatio, // {Number} e.g. 1.5/2\n maxViewRatio: maxRatio, // {Number} e.g. 2/1\n maxArea, // {Number} 0.8 -> max 80% of arena area are covered by the preview\n zoomStep, // {Number} e.g. 1.25 -> 125%\n actions: allowedActions,\n minResolution\n })\n }\n}\n","const $ = require('jquery')\nconst Preview = require('./preview')\nconst Events = require('./events')\n\nmodule.exports = class Crop {\n constructor ({\n arena, view, img, outline, url, fixedWidth, fixedHeight,\n minViewWidth, minViewHeight, minViewRatio, maxViewRatio, crop,\n zoomStep, maxArea, actions, minResolution, surroundingImageOpacity,\n showSurroundingImage\n }) {\n // CSS classes\n this.onPreviewReady = this.onPreviewReady.bind(this)\n this.arena = arena\n this.view = view\n this.img = img\n this.outline = outline\n this.fixedWidth = fixedWidth\n this.fixedHeight = fixedHeight\n this.minViewWidth = minViewWidth\n this.minViewHeight = minViewHeight\n this.minViewRatio = minViewRatio\n this.maxViewRatio = maxViewRatio\n this.actions = actions\n this.minResolution = minResolution\n this.surroundingImageOpacity = surroundingImageOpacity\n this.loadingCssClass = 'crop-view--is-loading'\n this.panningCssClass = 'crop-view--is-panning'\n this.outlineCssClass = 'crop-outline--active'\n\n // State\n this.isPanning = false\n this.initialCrop = crop\n\n // Events\n this.loadEvent = $.Callbacks()\n this.changeEvent = $.Callbacks()\n\n // Sets up the ready event and state\n this.initializeReadyState()\n\n // Confguration\n this.zoomInStep = zoomStep\n this.zoomOutStep = 1 / this.zoomInStep\n\n this.arenaWidth = this.arena.width()\n this.arenaHeight = this.arena.height()\n\n // todo: consider to calculate maxArea with regards to the\n // maximum space an image can within the area. That should\n // be more reliable.\n if (maxArea) this.maxArea = (this.arenaWidth * this.arenaHeight) * maxArea\n\n if (this.outline) this.setSurroundingImageVisibility(showSurroundingImage)\n\n this.preview = new Preview({\n onReady: this.onPreviewReady,\n img: this.img,\n outline: this.outline,\n opacity: this.surroundingImageOpacity\n })\n\n this.setImage(url)\n }\n\n initializeReadyState () {\n this.isReady = false\n if (this.readyEvent != null) {\n this.readyEvent.empty()\n }\n this.readyEvent = $.Callbacks('memory once')\n }\n\n setImage (url) {\n if (url === this.preview.url) return\n\n if (this.isInitialized) this.preview.reset()\n this.initializeReadyState()\n this.view.addClass(this.loadingCssClass)\n this.preview.setImage({url})\n }\n\n setSurroundingImageVisibility (visibility) {\n // visibility: always|panning|never\n // override opacity in crop-outline--active css class\n this.surroundingImageOpacity = parseFloat(this.surroundingImageOpacity || 0.2)\n\n if (visibility === 'always') {\n this.outline.css('opacity', 1.0)\n } else if (visibility === 'panning') {\n this.outline.css('opacity', null)\n } else { // 'never' default\n this.outline.css('opacity', 0)\n this.surroundingImageOpacity = 0\n }\n }\n\n reset () {\n if (!this.isReady) return\n\n this.resize({width: this.imageWidth, height: this.imageHeight})\n this.zoomAllOut()\n }\n\n onPreviewReady ({width, height}) {\n let keepDimension\n if (!this.isInitialized) {\n this.events = new Events({\n parent: this,\n view: this.view,\n actions: this.actions\n })\n }\n\n this.imageWidth = width\n this.imageHeight = height\n this.imageRatio = this.imageWidth / this.imageHeight\n const imageResolution = this.imageWidth * this.imageHeight\n\n if (this.minResolution && (this.minResolution > imageResolution)) {\n // If the minimal required resolution is bigger than the actual image\n // resolution, we ignore the configuration\n delete this.minResolution\n }\n\n if (this.minResolution) {\n // For any given image resolution with a minimal required resolution\n // we can calculate both, a minimal resolution and a maximal resolution\n const minRatioForResolution = this.minResolution / (this.imageHeight * this.imageHeight)\n if (!this.minViewRatio || (this.minViewRatio < minRatioForResolution)) {\n this.minViewRatio = minRatioForResolution\n }\n const maxRatioForResolution = (this.imageWidth * this.imageWidth) / this.minResolution\n if (!this.maxViewRatio || (this.maxViewRatio > maxRatioForResolution)) {\n this.maxViewRatio = maxRatioForResolution\n }\n }\n\n this.calcMaxMinDimensions()\n\n if (this.fixedWidth) { keepDimension = 'width' }\n if (this.fixedHeight) { keepDimension = 'height' }\n this.setViewDimensions({\n width: this.imageWidth,\n height: this.imageHeight,\n keepDimension\n })\n\n // ready state\n this.isReady = true\n this.view.removeClass(this.loadingCssClass)\n\n if (!this.isInitialized && (this.initialCrop != null)) {\n this.setCrop(this.initialCrop)\n } else {\n this.zoomAllOut()\n this.center()\n }\n\n this.isInitialized = true\n this.readyEvent.fire()\n this.loadEvent.fire()\n }\n\n setCrop ({x, y, width, height}) {\n if (!this.isReady) {\n this.on('ready', () => this.setCrop({x, y, width, height}))\n return\n }\n\n this.resize({width, height})\n\n const factor = this.viewWidth / width\n const previewWidth = this.imageWidth * factor\n\n this.zoom({width: previewWidth})\n this.pan({x: x * factor, y: y * factor})\n }\n\n getCrop () {\n const factor = this.preview.width / this.imageWidth\n const crop = {\n x: this.preview.x / factor,\n y: this.preview.y / factor,\n width: this.viewWidth / factor,\n height: this.viewHeight / factor\n }\n\n this.roundCrop(crop)\n this.validateCrop(crop)\n return crop\n }\n\n roundCrop (crop) {\n for (const name in crop) {\n const value = crop[name]\n crop[name] = Math.round(value)\n }\n }\n\n validateCrop (crop) {\n const {x, y, width, height} = crop\n if ((x + width) > this.imageWidth) {\n crop.width = this.imageWidth - x\n } else if ((y + height) > this.imageHeight) {\n crop.height = this.imageHeight - y\n }\n\n return crop\n }\n\n setRatio (ratio, keepDimension) {\n let height, width\n if (!this.isReady) {\n this.on('ready', () => this.setRatio(ratio, keepDimension))\n return\n }\n\n ratio = this.enforceValidRatio(ratio)\n\n if (keepDimension === 'height') {\n height = this.viewHeight\n width = height * ratio\n } else {\n width = this.viewWidth\n height = width / ratio\n }\n\n this.resizeFocusPoint = this.getFocusPoint()\n return this.resize({width, height})\n }\n\n // Event handling\n // --------------\n\n onPan (data) {\n if (!this.isPanning) {\n this.isPanning = true\n this.arena.addClass(this.panningCssClass)\n this.outline.addClass(this.outlineCssClass)\n }\n\n const newX = data.startX - data.dx\n const newY = data.startY - data.dy\n this.pan({x: newX, y: newY})\n }\n\n onPanEnd () {\n this.isPanning = false\n this.arena.removeClass(this.panningCssClass)\n return this.outline.removeClass(this.outlineCssClass)\n }\n\n onDoubleClick ({pageX, pageY}) {\n const {left, top} = this.view[0].getBoundingClientRect()\n const viewX = pageX - left\n const viewY = pageY - top\n this.zoomIn({viewX, viewY})\n }\n\n onResize ({position, dx, dy}) {\n if (!this.isResizing) {\n this.isResizing = true\n this.resizeFocusPoint = this.getFocusPoint()\n }\n\n if (['top', 'bottom'].includes(position)) {\n dy = 2 * dy // Because it's centered we need to change width by factor two\n this.resize({width: this.viewWidth, height: this.viewHeight + dy, keepDimension: 'height'})\n } else if (['left', 'right'].includes(position)) {\n dx = 2 * dx\n this.resize({width: this.viewWidth + dx, height: this.viewHeight, keepDimension: 'width'})\n }\n }\n\n onResizeEnd () {\n this.isResizing = false\n this.resizeFocusPoint = undefined\n }\n\n resize ({width, height, keepDimension}) {\n this.setViewDimensions({width, height, keepDimension})\n\n // Update view center of focus point\n if (this.resizeFocusPoint) {\n this.resizeFocusPoint.viewX = this.viewWidth / 2\n this.resizeFocusPoint.viewY = this.viewHeight / 2\n }\n\n // Ensure dimensions and focus\n this.zoom({\n width: this.preview.width,\n height: this.preview.height,\n focusPoint: this.resizeFocusPoint\n })\n }\n\n setViewDimensions ({width, height, keepDimension}) {\n if (this.maxArea) {\n ({width, height} = this.enforceMaxArea({width, height, keepDimension}))\n }\n\n ({width, height} = this.enforceViewDimensions({width, height, keepDimension}))\n\n this.view.css({width, height})\n this.viewWidth = width\n this.viewHeight = height\n this.viewRatio = width / height\n\n if (this.minResolution) {\n const minZoomPixelWidth = Math.sqrt(this.minResolution * this.viewRatio)\n const minZoomPixelHeight = Math.sqrt(this.minResolution / this.viewRatio)\n this.maxImageWidth = (this.viewWidth / minZoomPixelWidth) * this.imageWidth\n this.maxImageHeight = (this.viewHeight / minZoomPixelHeight) * this.imageHeight\n }\n\n this.fireChange()\n }\n\n // Update view\n // -----------\n\n zoomAllOut () {\n if (this.isWidthRestricting()) {\n this.zoom({width: this.viewWidth})\n } else {\n this.zoom({height: this.viewHeight})\n }\n }\n\n zoomIn (params) {\n if (params == null) { params = {} }\n if (this.isWidthRestricting()) {\n params.width = this.preview.width * this.zoomInStep\n } else {\n params.height = this.preview.height * this.zoomInStep\n }\n\n this.zoom(params)\n }\n\n zoomOut (params) {\n if (params == null) { params = {} }\n if (this.isWidthRestricting()) {\n params.width = this.preview.width * this.zoomOutStep\n } else {\n params.height = this.preview.height * this.zoomOutStep\n }\n\n this.zoom(params)\n }\n\n zoom ({width, height, viewX, viewY, focusPoint}) {\n if (focusPoint == null) { focusPoint = this.getFocusPoint({viewX, viewY}) }\n\n ({width, height} = this.enforceZoom({width, height}))\n if (width != null) {\n this.preview.setWidth(width)\n this.fireChange()\n } else if (height != null) {\n this.preview.setHeight(height)\n this.fireChange()\n }\n\n this.focus(focusPoint)\n }\n\n // returns {Object} e.g. percentX: 0.2, percentY: 0.5\n getFocusPoint (param) {\n if (param == null) { param = {} }\n let {viewX, viewY} = param\n if (viewX == null) { viewX = this.viewWidth / 2 }\n if (viewY == null) { viewY = this.viewHeight / 2 }\n const x = this.preview.x + viewX\n const y = this.preview.y + viewY\n const percentX = x / this.preview.width\n const percentY = y / this.preview.height\n return {percentX, percentY, viewX, viewY}\n }\n\n focus ({percentX, percentY, viewX, viewY}) {\n let x = this.preview.width * percentX\n let y = this.preview.height * percentY\n x = x - viewX\n y = y - viewY\n\n this.pan({x, y})\n }\n\n center () {\n const newX = (this.preview.width - this.viewWidth) / 2\n const newY = (this.preview.height - this.viewHeight) / 2\n this.pan({x: newX, y: newY})\n }\n\n // @param { Object }\n // - x {Number} pixel to pan to the left\n // - y {Number} pixels to pan to the top\n pan (data) {\n data = this.enforceXy(data)\n this.preview.pan(data.x, data.y)\n this.fireChange()\n }\n\n // Validations\n // -----------\n\n enforceXy ({x, y}) {\n if (x < 0) {\n x = 0\n } else if (x > (this.preview.width - this.viewWidth)) {\n x = this.preview.width - this.viewWidth\n }\n\n if (y < 0) {\n y = 0\n } else if (y > (this.preview.height - this.viewHeight)) {\n y = this.preview.height - this.viewHeight\n }\n\n return {x, y}\n }\n\n enforceZoom ({width, height}) {\n\n if ((width != null) && this.maxImageWidth && (width > this.maxImageWidth)) {\n // prevent zooming in past the required resolution defined by minResolution\n return {width: this.maxImageWidth}\n }\n\n if ((width != null) && (width < this.viewWidth)) {\n // prevent zooming out past covering the view completely\n return {width: this.viewWidth}\n }\n\n if ((height != null) && this.maxImageHeight && (height > this.maxImageHeight)) {\n // prevent zooming in past the required resolution defined by minResolution\n return {height: this.maxImageHeight}\n }\n\n if ((height != null) && (height < this.viewHeight)) {\n // prevent zooming out past covering the view completely\n return {height: this.viewHeight}\n }\n\n return {width, height}\n }\n\n calcMaxMinDimensions () {\n this.maxWidth = this.min([this.arenaWidth, this.imageWidth])\n this.maxHeight = this.min([this.arenaHeight, this.imageHeight])\n this.minWidth = this.minViewWidth || 0\n this.minHeight = this.minViewHeight || 0\n\n if (this.fixedWidth) this.maxWidth = (this.minWidth = this.fixedWidth)\n if (this.fixedHeight) this.maxHeight = (this.minHeight = this.fixedHeight)\n }\n\n areDimensionsValid ({width, height, keepDimension}) {\n const ratio = width / height\n\n const invalid =\n (width < this.minWidth) ||\n (width > this.maxWidth) ||\n (height < this.minHeight) ||\n (height > this.maxHeight) ||\n (ratio < this.minViewRatio) ||\n (ratio > this.maxViewRatio)\n\n return !invalid\n }\n\n isValidRatio (ratio) {\n return !((ratio < this.minViewRatio) || (ratio > this.maxViewRatio))\n }\n\n enforceValidRatio (ratio) {\n if (ratio < this.minViewRatio) return this.minViewRatio\n if (ratio > this.maxViewRatio) return this.maxViewRatio\n return ratio\n }\n\n enforceViewDimensions ({width, height, keepDimension}) {\n let newHeight, newWidth, ratio\n if (width < this.minWidth) newWidth = this.minWidth\n if (width > this.maxWidth) newWidth = this.maxWidth\n if (height < this.minHeight) newHeight = this.minHeight\n if (height > this.maxHeight) newHeight = this.maxHeight\n\n if (keepDimension) {\n if (newWidth) width = newWidth\n if (newHeight) height = newHeight\n\n // check max/min ratios\n ratio = width / height\n if (!this.isValidRatio(ratio)) {\n ratio = this.enforceValidRatio(ratio);\n ({width, height} = this.getRatioBox({ratio, width, height, keepDimension}))\n if ((width > this.arenaWidth) || (height > this.arenaHeight)) {\n ({width, height} = this.centerAlign(this.maxWidth, this.maxHeight, ratio))\n }\n }\n\n } else if (newWidth || newHeight) {\n ratio = this.enforceValidRatio(width / height);\n ({width, height} = this.centerAlign(this.maxWidth, this.maxHeight, ratio))\n }\n\n return {width, height}\n }\n\n enforceMaxArea ({width, height, keepDimension}) {\n let ratio = width / height\n\n if (keepDimension === 'width') {\n height = this.maxArea / width\n ratio = width / height\n } else if (keepDimension === 'height') {\n width = this.maxArea / height\n ratio = width / height\n } else { // keep ratio\n width = Math.sqrt(this.maxArea * ratio)\n height = width / ratio\n }\n\n if (!this.isValidRatio(ratio)) {\n ratio = this.enforceValidRatio(ratio)\n width = Math.sqrt(this.maxArea * ratio)\n height = width / ratio\n }\n\n return {width, height}\n }\n\n // Calculations\n // ------------\n //\n // Ratio: width / height\n // Tall < 1 (Square) < Wide\n // (A ratio less than one is a tall image format and\n // a ratio greater than one is a wide image format)\n\n // Check if the width or height is restricting\n isWidthRestricting () {\n return this.viewRatio >= this.imageRatio\n }\n\n getRatioBox ({ratio, width, height, keepDimension}) {\n if ((keepDimension === 'width') || (height == null)) {\n height = width / ratio\n } else if ((keepDimension === 'height') || (width == null)) {\n width = height * ratio\n } else {\n height = width / ratio\n }\n\n return {width, height}\n }\n\n centerAlign (areaWidth, areaHeight, ratio) {\n let height, width, x, y\n if ((areaWidth / areaHeight) > ratio) {\n width = areaHeight * ratio\n x = (areaWidth - width) / 2\n } else {\n height = areaWidth / ratio\n y = (areaHeight - height) / 2\n }\n\n // return\n return {\n x: x || 0,\n y: y || 0,\n width: width || areaWidth,\n height: height || areaHeight\n }\n }\n\n min (array) {\n let min = array[0]\n for (const number of array) {\n if (number < min) min = number\n }\n\n return min\n }\n\n // Events\n // ------\n\n on (name, callback) {\n return this[`${name}Event`].add(callback)\n }\n\n off (name, callback) {\n return this[`${name}Event`].remove(callback)\n }\n\n // Debounce change events so they are not fired more\n // than once per tick.\n fireChange () {\n if (this.changeDispatch != null) return\n\n this.changeDispatch = setTimeout(() => {\n this.changeDispatch = undefined\n this.changeEvent.fire(this.getCrop())\n }, 0)\n }\n\n // Development helpers\n // -------------------\n\n debug () {\n const r = num => Math.round(num * 10) / 10\n\n const obj = {\n arena: `${r(this.arenaWidth)}x${r(this.arenaHeight)}`,\n view: `${r(this.viewWidth)}x${r(this.viewHeight)}`,\n image: `${r(this.imageWidth)}x${r(this.imageHeight)}`,\n preview: `${r(this.preview.width)}x${r(this.preview.height)}`,\n previewXy: `${r(this.preview.x)}x${r(this.preview.y)}`\n }\n\n console.log(obj) // eslint-disable-line no-console\n return obj\n }\n}\n","const $ = require('jquery')\n\nmodule.exports = class Preview {\n\n constructor ({onReady, img, opacity, outline}) {\n this.onReady = onReady\n this.img = img\n this.opacity = opacity\n this.outline = outline\n this.x = (this.y = 0)\n this.width = (this.height = 0)\n\n this.img.on('load', () => {\n const width = this.img.width()\n const height = this.img.height()\n this.ratio = width / height\n\n this.updateImageDimensions({width, height})\n this.onReady({width: this.width, height: this.height})\n this.img.show()\n })\n }\n\n setImage ({url}) {\n this.url = url\n this.img.attr('src', this.url)\n if (this.outline) this.setBackgroundImage({url: this.url})\n }\n\n setBackgroundImage ({url}) {\n if (this.opacity > 0) {\n const bgImg = $('').css({opacity: this.opacity}).attr('src', url)\n this.outline.append(bgImg)\n }\n }\n\n reset () {\n this.url = undefined\n this.x = (this.y = 0)\n this.width = (this.height = 0)\n this.img.attr('src', '')\n this.img.css({width: '', height: '', transform: ''})\n if (this.outline) this.outline.css({transform: ''}).html('')\n }\n\n setWidth (width) {\n this.img.css({width: `${width}px`, height: 'auto'})\n const height = width / this.ratio\n this.updateImageDimensions({width, height})\n }\n\n setHeight (height) {\n this.img.css({width: 'auto', height: `${height}px`})\n const width = height * this.ratio\n this.updateImageDimensions({width, height})\n }\n\n updateImageDimensions ({width, height}) {\n this.width = width\n this.height = height\n if (this.outline) this.outline.css({width: `${this.width}px`, height: `${this.height}px`})\n }\n\n pan (x1, y1) {\n // Without rounding some numbers would not be set to css.\n // e.g: '-5.14957320384e-14'\n this.x = x1\n this.y = y1\n const x = Math.round(this.x)\n const y = Math.round(this.y)\n this.img.css({transform: `translate(-${x}px, -${y}px)`})\n if (this.outline) this.outline.css({transform: `translate(-${x}px, -${y}px)`})\n }\n}\n\n","const $ = require('jquery')\n\nmodule.exports = class Events {\n constructor ({parent, view, horizontal, vertical, actions}) {\n this.parent = parent\n this.view = view\n this.doubleClickThreshold = 300\n\n // setup events\n if (actions.pan) { this.pan() }\n if (actions.zoomOnDoubleClick) { this.doubleClick() }\n if (actions.resize) {\n this.resizeView({\n horizontal: actions.resizeHorizontal,\n vertical: actions.resizeVertical\n })\n }\n\n this.preventBrowserDragDrop()\n this.responsiveArena()\n }\n\n pan () {\n const $doc = $(document)\n this.view.on('mousedown.srcissors', (e1) => {\n const panData = {\n startX: this.parent.preview.x,\n startY: this.parent.preview.y\n }\n\n e1.preventDefault()\n $doc.on('mousemove.srcissors-pan', (e2) => {\n panData.dx = e2.pageX - e1.pageX\n panData.dy = e2.pageY - e1.pageY\n this.parent.onPan(panData)\n }).on('mouseup.srcissors-pan', () => {\n $doc.off('mouseup.srcissors-pan')\n $doc.off('mousemove.srcissors-pan')\n\n // only trigger panEnd if pan has been called\n if (panData.dx != null) this.parent.onPanEnd()\n })\n })\n }\n\n doubleClick () {\n let lastClick\n\n this.view.on('mousedown.srcissors', event => {\n const now = new Date().getTime()\n if (lastClick && (lastClick > (now - this.doubleClickThreshold))) {\n this.parent.onDoubleClick({pageX: event.pageX, pageY: event.pageY})\n }\n lastClick = now\n })\n }\n\n preventBrowserDragDrop () {\n this.view.on('dragstart.srcissors', () => false)\n }\n\n // Resize View\n // -----------\n\n resizeView ({horizontal, vertical}) {\n const $template = $('
')\n $template.addClass('resize-handler')\n\n let positions = []\n if (horizontal) positions = positions.concat(['right', 'left'])\n if (vertical) positions = positions.concat(['top', 'bottom'])\n\n positions.forEach(position => {\n const $handler = $template.clone()\n $handler.addClass(`resize-handler-${position}`)\n $handler.on('mousedown.srcissors', this.getResizeMouseDown(position))\n\n this.view.append($handler)\n })\n }\n\n getResizeMouseDown (position) {\n const $doc = $(document)\n\n return (event) => {\n let lastX = event.pageX\n let lastY = event.pageY\n\n event.stopPropagation()\n\n $doc.on('mousemove.srcissors-resize', e2 => {\n let dx, dy\n switch (position) {\n case 'top': case 'bottom':\n dy = e2.pageY - lastY\n if (position === 'top') { dy = -dy }\n lastY = e2.pageY\n break\n case 'left': case 'right':\n dx = e2.pageX - lastX\n if (position === 'left') { dx = -dx }\n lastX = e2.pageX\n break\n }\n\n this.parent.onResize({position, dx, dy})\n }).on('mouseup.srcissors-resize', () => {\n $doc.off('mouseup.srcissors-resize')\n $doc.off('mousemove.srcissors-resize')\n\n // only trigger panEnd if pan has been called\n this.parent.onResizeEnd({position})\n })\n }\n }\n\n responsiveArena () {}\n}\n\n// $(window).on('resize', (event) => console.log 'on window resize')\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://srcissors/srcissors.js"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","modules","installedModules","__webpack_require__","moduleId","i","l","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","Crop","new","_ref","arena","url","fixedWidth","fixedHeight","minWidth","minHeight","minRatio","maxRatio","maxArea","zoomStep","crop","actions","minResolution","surroundingImageOpacity","showSurroundingImage","view","find","preview","img","append","outline","length","undefined","allowedActions","pan","zoomOnDoubleClick","resize","resizeHorizontal","resizeVertical","extend","minViewWidth","minViewHeight","minViewRatio","maxViewRatio","_createForOfIteratorHelper","allowArrayLike","it","iterator","Array","isArray","minLen","_arrayLikeToArray","toString","slice","constructor","from","test","_unsupportedIterableToArray","F","done","e","_e","f","TypeError","err","normalCompletion","didErr","step","next","_e2","return","arr","len","arr2","_defineProperties","target","props","descriptor","configurable","writable","Preview","Events","instance","Constructor","_classCallCheck","this","onPreviewReady","loadingCssClass","panningCssClass","outlineCssClass","isPanning","initialCrop","loadEvent","Callbacks","changeEvent","initializeReadyState","zoomInStep","zoomOutStep","arenaWidth","width","arenaHeight","height","setSurroundingImageVisibility","onReady","opacity","setImage","protoProps","staticProps","isReady","readyEvent","empty","isInitialized","reset","addClass","visibility","parseFloat","css","imageWidth","imageHeight","zoomAllOut","_ref2","keepDimension","events","parent","imageRatio","imageResolution","minRatioForResolution","maxRatioForResolution","calcMaxMinDimensions","setViewDimensions","removeClass","center","setCrop","fire","_ref3","_this","x","y","factor","viewWidth","previewWidth","zoom","on","viewHeight","roundCrop","validateCrop","Math","round","ratio","_this2","enforceValidRatio","resizeFocusPoint","getFocusPoint","setRatio","data","newX","startX","dx","newY","startY","dy","_ref4","pageX","pageY","_this$view$0$getBound","getBoundingClientRect","viewX","left","viewY","top","zoomIn","_ref5","position","isResizing","includes","_ref6","focusPoint","_ref7","_this$enforceMaxArea","enforceMaxArea","_this$enforceViewDime","enforceViewDimensions","viewRatio","minZoomPixelWidth","sqrt","minZoomPixelHeight","maxImageWidth","maxImageHeight","fireChange","isWidthRestricting","params","_ref8","_this$enforceZoom","enforceZoom","setWidth","setHeight","focus","param","_param","percentX","percentY","_ref9","enforceXy","_ref10","_ref11","maxWidth","min","maxHeight","_ref12","_ref13","newHeight","newWidth","isValidRatio","_this$getRatioBox","getRatioBox","_this$centerAlign","centerAlign","_this$centerAlign2","_ref14","_ref15","areaWidth","areaHeight","array","_step","_iterator","number","callback","concat","add","remove","_this3","changeDispatch","setTimeout","getCrop","num","obj","image","previewXy","console","log","updateImageDimensions","show","attr","setBackgroundImage","bgImg","transform","html","x1","y1","getPageCoordinates","event","type","originalEvent","changedTouches","horizontal","vertical","doubleClickThreshold","doubleClick","resizeView","preventBrowserDragDrop","responsiveArena","$doc","document","e1","panData","preventDefault","e2","_getPageCoordinates","_getPageCoordinates2","prevPageX","prevPageY","onPan","off","onPanEnd","lastClick","now","Date","getTime","onDoubleClick","$template","positions","forEach","$handler","clone","getResizeMouseDown","_this4","_getPageCoordinates3","lastX","lastY","stopPropagation","_getPageCoordinates4","onResize","onResizeEnd"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,WAC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