/**
* The functions necessary for editing images.
*
* @since 2.9.0
* @output wp-admin/js/image-edit.js
*/
/* global ajaxurl, confirm */
(function($) {
var __ = wp.i18n.__;
/**
* Contains all the methods to initialize and control the image editor.
*
* @namespace imageEdit
*/
var imageEdit = window.imageEdit = {
iasapi : {},
hold : {},
postid : '',
_view : false,
/**
* Enable crop tool.
*/
toggleCropTool: function( postid, nonce, cropButton ) {
var img = $( '#image-preview-' + postid ),
selection = this.iasapi.getSelection();
imageEdit.toggleControls( cropButton );
var $el = $( cropButton );
var state = ( $el.attr( 'aria-expanded' ) === 'true' ) ? 'true' : 'false';
// Crop tools have been closed.
if ( 'false' === state ) {
// Cancel selection, but do not unset inputs.
this.iasapi.cancelSelection();
imageEdit.setDisabled($('.imgedit-crop-clear'), 0);
} else {
imageEdit.setDisabled($('.imgedit-crop-clear'), 1);
// Get values from inputs to restore previous selection.
var startX = ( $( '#imgedit-start-x-' + postid ).val() ) ? $('#imgedit-start-x-' + postid).val() : 0;
var startY = ( $( '#imgedit-start-y-' + postid ).val() ) ? $('#imgedit-start-y-' + postid).val() : 0;
var width = ( $( '#imgedit-sel-width-' + postid ).val() ) ? $('#imgedit-sel-width-' + postid).val() : img.innerWidth();
var height = ( $( '#imgedit-sel-height-' + postid ).val() ) ? $('#imgedit-sel-height-' + postid).val() : img.innerHeight();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX