mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 10:08:27 +01:00
New: Add patch from meos to resize images
This commit is contained in:
29
htdocs/lib/lib_photosresize.js
Normal file
29
htdocs/lib/lib_photosresize.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* http://deepliquid.com/content/Jcrop.html
|
||||
*/
|
||||
|
||||
|
||||
jQuery(function() {
|
||||
jQuery('#cropbox').Jcrop({
|
||||
onSelect: updateCoords,
|
||||
onChange: updateCoords
|
||||
});
|
||||
});
|
||||
|
||||
function updateCoords(c)
|
||||
{
|
||||
$('#x').val(c.x);
|
||||
$('#y').val(c.y);
|
||||
$('#x2').val(c.x2);
|
||||
$('#y2').val(c.y2);
|
||||
$('#w').val(c.w);
|
||||
$('#h').val(c.h);
|
||||
};
|
||||
|
||||
function checkCoords()
|
||||
{
|
||||
if (parseInt($('#w').val())) return true;
|
||||
alert('Please select a crop region then press submit.');
|
||||
return false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user