CoreFiles by mySites.guru
crop.es6.min.js1 lines, 2,260 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
ac4fa5c83fa340df55fb6292eeb4110b
sha1
5c04411353c61bc2c388e2e17b77e471f63eb1ec
sha256
980a445b51b7d9ee9ab0a2d9bf9a97595bc5a57d47cc3f99a989bcfdd837f334
Joomla=window.Joomla||{},Joomla.MediaManager=Joomla.MediaManager||{},Joomla.MediaManager.Edit=Joomla.MediaManager.Edit||{},(()=>{'use strict';const a=()=>{const a=document.getElementById("image-preview");Joomla.MediaManager.Edit.crop.cropper=new Cropper(a,{viewMode:1,responsive:!0,restore:!0,autoCrop:!0,movable:!1,zoomable:!1,rotatable:!1,autoCropArea:1,minContainerWidth:a.offsetWidth,minContainerHeight:a.offsetHeight,crop(a){document.getElementById("jform_crop_x").value=Math.round(a.detail.x),document.getElementById("jform_crop_y").value=Math.round(a.detail.y),document.getElementById("jform_crop_width").value=Math.round(a.detail.width),document.getElementById("jform_crop_height").value=Math.round(a.detail.height);const b="jpg"===Joomla.MediaManager.Edit.original.extension?"jpeg":Joomla.MediaManager.Edit.original.extension,c=document.getElementById("jform_crop_quality").value;Joomla.MediaManager.Edit.current.contents=this.cropper.getCroppedCanvas().toDataURL(`image/${b}`,c),window.dispatchEvent(new Event("mediaManager.history.point"))}}),document.getElementById("jform_crop_x").addEventListener("change",({target:a})=>{Joomla.MediaManager.Edit.crop.cropper.setData({x:parseInt(a.value,10)})}),document.getElementById("jform_crop_y").addEventListener("change",({target:a})=>{Joomla.MediaManager.Edit.crop.cropper.setData({y:parseInt(a.value,10)})}),document.getElementById("jform_crop_width").addEventListener("change",({target:a})=>{Joomla.MediaManager.Edit.crop.cropper.setData({width:parseInt(a.value,10)})}),document.getElementById("jform_crop_height").addEventListener("change",({target:a})=>{Joomla.MediaManager.Edit.crop.cropper.setData({height:parseInt(a.value,10)})}),document.getElementById("jform_aspectRatio").addEventListener("change",({target:a})=>{Joomla.MediaManager.Edit.crop.cropper.setAspectRatio(a.value)}),a.addEventListener("load",()=>{const b=[].slice.call(document.querySelectorAll(".crop-aspect-ratio-option")),c=a.naturalWidth/a.naturalHeight;!Number.isNaN(c)&&Number.isFinite(c)&&(b[0].value=c),Joomla.MediaManager.Edit.crop.cropper.setAspectRatio(b[0].value)})};Joomla.MediaManager.Edit.crop={Activate(b){a(b)},Deactivate(){Joomla.MediaManager.Edit.crop.cropper&&Joomla.MediaManager.Edit.crop.cropper.destroy()}}})();

The same content is in 7 releases, Joomla 4.0.0-beta to 4.0.0-beta7. See them all, or every version of this file.