CoreFiles by mySites.guru
crop.es6.min.js1 lines, 2,227 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
30f6a3d46e4e57001d682dd09cbe2676
sha1
d5f79275b078ba1444cfdb575d9220c2c26404fe
sha256
e0b14fce9bc2f125c7c553d5e07fd25dc4b4dbffdd2bab5fe3dd1d4a881eab6a
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){var b=Math.round;document.getElementById("jform_crop_x").value=b(a.detail.x),document.getElementById("jform_crop_y").value=b(a.detail.y),document.getElementById("jform_crop_width").value=b(a.detail.width),document.getElementById("jform_crop_height").value=b(a.detail.height);const c="jpg"===Joomla.MediaManager.Edit.original.extension?"jpeg":Joomla.MediaManager.Edit.original.extension,d=document.getElementById("jform_crop_quality").value;Joomla.MediaManager.Edit.current.contents=this.cropper.getCroppedCanvas().toDataURL("image/".concat(c),d),window.dispatchEvent(new Event("mediaManager.history.point"))}}),document.getElementById("jform_crop_x").addEventListener("change",a=>{Joomla.MediaManager.Edit.crop.cropper.setData({x:parseInt(a.target.value,10)})}),document.getElementById("jform_crop_y").addEventListener("change",a=>{Joomla.MediaManager.Edit.crop.cropper.setData({y:parseInt(a.target.value,10)})}),document.getElementById("jform_crop_width").addEventListener("change",a=>{Joomla.MediaManager.Edit.crop.cropper.setData({width:parseInt(a.target.value,10)})}),document.getElementById("jform_crop_height").addEventListener("change",a=>{Joomla.MediaManager.Edit.crop.cropper.setData({height:parseInt(a.target.value,10)})}),document.getElementById("jform_aspectRatio").addEventListener("change",a=>{Joomla.MediaManager.Edit.crop.cropper.setAspectRatio(a.target.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 5 releases, Joomla 4.0.0-alpha8 to 4.0.0-alpha12. See them all, or every version of this file.