From 53b87eff1e9fffe4b1f83f7985cd0ab579481cdc Mon Sep 17 00:00:00 2001 From: Volkmar Kantor Date: Sun, 20 Sep 2015 18:25:10 +0200 Subject: [PATCH] add the 'same_ratio_active' parameter in the ajax-request (@see https://wordpress.org/support/topic/return-same-ratio-daja-in-ajax-request) --- functions/save.php | 3 ++- js/cpt-crop.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/functions/save.php b/functions/save.php index 31e1dc3..d5195d3 100644 --- a/functions/save.php +++ b/functions/save.php @@ -13,6 +13,7 @@ class CptSaveThumbnail { * * $_REQUEST['selection'] - json-object - data of the selection/crop * * $_REQUEST['raw_values'] - json-object - data of the original image * * $_REQUEST['active_values'] - json-array - array with data of the images to crop + * * $_REQUEST['same_ratio_active'] - boolean - was the same_ratio_checkbox checked or not * The main code is wraped via try-catch - the errorMessage will send back to JavaScript for displaying in an alert-box. * Called die() at the end. */ @@ -253,4 +254,4 @@ function generateFilename( $file, $w, $h ){ return $destfilename; } } -?> \ No newline at end of file +?> diff --git a/js/cpt-crop.js b/js/cpt-crop.js index 60ef8e6..dd5a957 100644 --- a/js/cpt-crop.js +++ b/js/cpt-crop.js @@ -80,7 +80,8 @@ jQuery(document).ready(function($) { cookie: encodeURIComponent(document.cookie), selection: JSON.stringify(cropping.api.tellSelect()), raw_values: JSON.stringify(cropping.img.data('values')), - active_values: JSON.stringify(active_array) + active_values: JSON.stringify(active_array), + same_ratio_active: $('#cpt-same-ratio').is('checked') }, complete : function() { $('.mainWindow').show();