Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../wp-admin/js
File: image-edit.js
[500] Fix | Delete
// Reset size to its original state.
[501] Fix | Delete
if ( setSize ) {
[502] Fix | Delete
if ( !history.length ) {
[503] Fix | Delete
this.hold.w = this.hold.ow;
[504] Fix | Delete
this.hold.h = this.hold.oh;
[505] Fix | Delete
return '';
[506] Fix | Delete
}
[507] Fix | Delete
[508] Fix | Delete
// Restore original 'o'.
[509] Fix | Delete
o = history[history.length - 1];
[510] Fix | Delete
[511] Fix | Delete
// c = 'crop', r = 'rotate', f = 'flip'.
[512] Fix | Delete
o = o.c || o.r || o.f || false;
[513] Fix | Delete
[514] Fix | Delete
if ( o ) {
[515] Fix | Delete
// fw = Full image width.
[516] Fix | Delete
this.hold.w = o.fw;
[517] Fix | Delete
// fh = Full image height.
[518] Fix | Delete
this.hold.h = o.fh;
[519] Fix | Delete
}
[520] Fix | Delete
}
[521] Fix | Delete
[522] Fix | Delete
// Filter the last step/action from the history.
[523] Fix | Delete
for ( n in history ) {
[524] Fix | Delete
i = history[n];
[525] Fix | Delete
if ( i.hasOwnProperty('c') ) {
[526] Fix | Delete
op[n] = { 'c': { 'x': i.c.x, 'y': i.c.y, 'w': i.c.w, 'h': i.c.h } };
[527] Fix | Delete
} else if ( i.hasOwnProperty('r') ) {
[528] Fix | Delete
op[n] = { 'r': i.r.r };
[529] Fix | Delete
} else if ( i.hasOwnProperty('f') ) {
[530] Fix | Delete
op[n] = { 'f': i.f.f };
[531] Fix | Delete
}
[532] Fix | Delete
}
[533] Fix | Delete
return JSON.stringify(op);
[534] Fix | Delete
}
[535] Fix | Delete
return '';
[536] Fix | Delete
},
[537] Fix | Delete
/**
[538] Fix | Delete
* Binds the necessary events to the image.
[539] Fix | Delete
*
[540] Fix | Delete
* When the image source is reloaded the image will be reloaded.
[541] Fix | Delete
*
[542] Fix | Delete
* @since 2.9.0
[543] Fix | Delete
*
[544] Fix | Delete
* @memberof imageEdit
[545] Fix | Delete
*
[546] Fix | Delete
* @param {number} postid The post ID.
[547] Fix | Delete
* @param {string} nonce The nonce to verify the request.
[548] Fix | Delete
* @param {function} callback Function to execute when the image is loaded.
[549] Fix | Delete
*
[550] Fix | Delete
* @return {void}
[551] Fix | Delete
*/
[552] Fix | Delete
refreshEditor : function(postid, nonce, callback) {
[553] Fix | Delete
var t = this, data, img;
[554] Fix | Delete
[555] Fix | Delete
t.toggleEditor(postid, 1);
[556] Fix | Delete
data = {
[557] Fix | Delete
'action': 'imgedit-preview',
[558] Fix | Delete
'_ajax_nonce': nonce,
[559] Fix | Delete
'postid': postid,
[560] Fix | Delete
'history': t.filterHistory(postid, 1),
[561] Fix | Delete
'rand': t.intval(Math.random() * 1000000)
[562] Fix | Delete
};
[563] Fix | Delete
[564] Fix | Delete
img = $( '<img id="image-preview-' + postid + '" alt="" />' )
[565] Fix | Delete
.on( 'load', { history: data.history }, function( event ) {
[566] Fix | Delete
var max1, max2,
[567] Fix | Delete
parent = $( '#imgedit-crop-' + postid ),
[568] Fix | Delete
t = imageEdit,
[569] Fix | Delete
historyObj;
[570] Fix | Delete
[571] Fix | Delete
// Checks if there already is some image-edit history.
[572] Fix | Delete
if ( '' !== event.data.history ) {
[573] Fix | Delete
historyObj = JSON.parse( event.data.history );
[574] Fix | Delete
// If last executed action in history is a crop action.
[575] Fix | Delete
if ( historyObj[historyObj.length - 1].hasOwnProperty( 'c' ) ) {
[576] Fix | Delete
/*
[577] Fix | Delete
* A crop action has completed and the crop button gets disabled
[578] Fix | Delete
* ensure the undo button is enabled.
[579] Fix | Delete
*/
[580] Fix | Delete
t.setDisabled( $( '#image-undo-' + postid) , true );
[581] Fix | Delete
// Move focus to the undo button to avoid a focus loss.
[582] Fix | Delete
$( '#image-undo-' + postid ).trigger( 'focus' );
[583] Fix | Delete
}
[584] Fix | Delete
}
[585] Fix | Delete
[586] Fix | Delete
parent.empty().append(img);
[587] Fix | Delete
[588] Fix | Delete
// w, h are the new full size dimensions.
[589] Fix | Delete
max1 = Math.max( t.hold.w, t.hold.h );
[590] Fix | Delete
max2 = Math.max( $(img).width(), $(img).height() );
[591] Fix | Delete
t.hold.sizer = max1 > max2 ? max2 / max1 : 1;
[592] Fix | Delete
[593] Fix | Delete
t.initCrop(postid, img, parent);
[594] Fix | Delete
[595] Fix | Delete
if ( (typeof callback !== 'undefined') && callback !== null ) {
[596] Fix | Delete
callback();
[597] Fix | Delete
}
[598] Fix | Delete
[599] Fix | Delete
if ( $('#imgedit-history-' + postid).val() && $('#imgedit-undone-' + postid).val() === '0' ) {
[600] Fix | Delete
$('button.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', false);
[601] Fix | Delete
} else {
[602] Fix | Delete
$('button.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', true);
[603] Fix | Delete
}
[604] Fix | Delete
var successMessage = __( 'Image updated.' );
[605] Fix | Delete
[606] Fix | Delete
t.toggleEditor(postid, 0);
[607] Fix | Delete
wp.a11y.speak( successMessage, 'assertive' );
[608] Fix | Delete
})
[609] Fix | Delete
.on( 'error', function() {
[610] Fix | Delete
var errorMessage = __( 'Could not load the preview image. Please reload the page and try again.' );
[611] Fix | Delete
[612] Fix | Delete
$( '#imgedit-crop-' + postid )
[613] Fix | Delete
.empty()
[614] Fix | Delete
.append( '<div class="notice notice-error" tabindex="-1" role="alert"><p>' + errorMessage + '</p></div>' );
[615] Fix | Delete
[616] Fix | Delete
t.toggleEditor( postid, 0, true );
[617] Fix | Delete
wp.a11y.speak( errorMessage, 'assertive' );
[618] Fix | Delete
} )
[619] Fix | Delete
.attr('src', ajaxurl + '?' + $.param(data));
[620] Fix | Delete
},
[621] Fix | Delete
/**
[622] Fix | Delete
* Performs an image edit action.
[623] Fix | Delete
*
[624] Fix | Delete
* @since 2.9.0
[625] Fix | Delete
*
[626] Fix | Delete
* @memberof imageEdit
[627] Fix | Delete
*
[628] Fix | Delete
* @param {number} postid The post ID.
[629] Fix | Delete
* @param {string} nonce The nonce to verify the request.
[630] Fix | Delete
* @param {string} action The action to perform on the image.
[631] Fix | Delete
* The possible actions are: "scale" and "restore".
[632] Fix | Delete
*
[633] Fix | Delete
* @return {boolean|void} Executes a post request that refreshes the page
[634] Fix | Delete
* when the action is performed.
[635] Fix | Delete
* Returns false if an invalid action is given,
[636] Fix | Delete
* or when the action cannot be performed.
[637] Fix | Delete
*/
[638] Fix | Delete
action : function(postid, nonce, action) {
[639] Fix | Delete
var t = this, data, w, h, fw, fh;
[640] Fix | Delete
[641] Fix | Delete
if ( t.notsaved(postid) ) {
[642] Fix | Delete
return false;
[643] Fix | Delete
}
[644] Fix | Delete
[645] Fix | Delete
data = {
[646] Fix | Delete
'action': 'image-editor',
[647] Fix | Delete
'_ajax_nonce': nonce,
[648] Fix | Delete
'postid': postid
[649] Fix | Delete
};
[650] Fix | Delete
[651] Fix | Delete
if ( 'scale' === action ) {
[652] Fix | Delete
w = $('#imgedit-scale-width-' + postid),
[653] Fix | Delete
h = $('#imgedit-scale-height-' + postid),
[654] Fix | Delete
fw = t.intval(w.val()),
[655] Fix | Delete
fh = t.intval(h.val());
[656] Fix | Delete
[657] Fix | Delete
if ( fw < 1 ) {
[658] Fix | Delete
w.trigger( 'focus' );
[659] Fix | Delete
return false;
[660] Fix | Delete
} else if ( fh < 1 ) {
[661] Fix | Delete
h.trigger( 'focus' );
[662] Fix | Delete
return false;
[663] Fix | Delete
}
[664] Fix | Delete
[665] Fix | Delete
if ( fw === t.hold.ow || fh === t.hold.oh ) {
[666] Fix | Delete
return false;
[667] Fix | Delete
}
[668] Fix | Delete
[669] Fix | Delete
data['do'] = 'scale';
[670] Fix | Delete
data.fwidth = fw;
[671] Fix | Delete
data.fheight = fh;
[672] Fix | Delete
} else if ( 'restore' === action ) {
[673] Fix | Delete
data['do'] = 'restore';
[674] Fix | Delete
} else {
[675] Fix | Delete
return false;
[676] Fix | Delete
}
[677] Fix | Delete
[678] Fix | Delete
t.toggleEditor(postid, 1);
[679] Fix | Delete
$.post( ajaxurl, data, function( response ) {
[680] Fix | Delete
$( '#image-editor-' + postid ).empty().append( response.data.html );
[681] Fix | Delete
t.toggleEditor( postid, 0, true );
[682] Fix | Delete
// Refresh the attachment model so that changes propagate.
[683] Fix | Delete
if ( t._view ) {
[684] Fix | Delete
t._view.refresh();
[685] Fix | Delete
}
[686] Fix | Delete
} ).done( function( response ) {
[687] Fix | Delete
// Whether the executed action was `scale` or `restore`, the response does have a message.
[688] Fix | Delete
if ( response && response.data.message.msg ) {
[689] Fix | Delete
wp.a11y.speak( response.data.message.msg );
[690] Fix | Delete
return;
[691] Fix | Delete
}
[692] Fix | Delete
[693] Fix | Delete
if ( response && response.data.message.error ) {
[694] Fix | Delete
wp.a11y.speak( response.data.message.error );
[695] Fix | Delete
}
[696] Fix | Delete
} );
[697] Fix | Delete
},
[698] Fix | Delete
[699] Fix | Delete
/**
[700] Fix | Delete
* Stores the changes that are made to the image.
[701] Fix | Delete
*
[702] Fix | Delete
* @since 2.9.0
[703] Fix | Delete
*
[704] Fix | Delete
* @memberof imageEdit
[705] Fix | Delete
*
[706] Fix | Delete
* @param {number} postid The post ID to get the image from the database.
[707] Fix | Delete
* @param {string} nonce The nonce to verify the request.
[708] Fix | Delete
*
[709] Fix | Delete
* @return {boolean|void} If the actions are successfully saved a response message is shown.
[710] Fix | Delete
* Returns false if there is no image editing history,
[711] Fix | Delete
* thus there are not edit-actions performed on the image.
[712] Fix | Delete
*/
[713] Fix | Delete
save : function(postid, nonce) {
[714] Fix | Delete
var data,
[715] Fix | Delete
target = this.getTarget(postid),
[716] Fix | Delete
history = this.filterHistory(postid, 0),
[717] Fix | Delete
self = this;
[718] Fix | Delete
[719] Fix | Delete
if ( '' === history ) {
[720] Fix | Delete
return false;
[721] Fix | Delete
}
[722] Fix | Delete
[723] Fix | Delete
this.toggleEditor(postid, 1);
[724] Fix | Delete
data = {
[725] Fix | Delete
'action': 'image-editor',
[726] Fix | Delete
'_ajax_nonce': nonce,
[727] Fix | Delete
'postid': postid,
[728] Fix | Delete
'history': history,
[729] Fix | Delete
'target': target,
[730] Fix | Delete
'context': $('#image-edit-context').length ? $('#image-edit-context').val() : null,
[731] Fix | Delete
'do': 'save'
[732] Fix | Delete
};
[733] Fix | Delete
// Post the image edit data to the backend.
[734] Fix | Delete
$.post( ajaxurl, data, function( response ) {
[735] Fix | Delete
// If a response is returned, close the editor and show an error.
[736] Fix | Delete
if ( response.data.error ) {
[737] Fix | Delete
$( '#imgedit-response-' + postid )
[738] Fix | Delete
.html( '<div class="notice notice-error" tabindex="-1" role="alert"><p>' + response.data.error + '</p></div>' );
[739] Fix | Delete
[740] Fix | Delete
imageEdit.close(postid);
[741] Fix | Delete
wp.a11y.speak( response.data.error );
[742] Fix | Delete
return;
[743] Fix | Delete
}
[744] Fix | Delete
[745] Fix | Delete
if ( response.data.fw && response.data.fh ) {
[746] Fix | Delete
$( '#media-dims-' + postid ).html( response.data.fw + ' &times; ' + response.data.fh );
[747] Fix | Delete
}
[748] Fix | Delete
[749] Fix | Delete
if ( response.data.thumbnail ) {
[750] Fix | Delete
$( '.thumbnail', '#thumbnail-head-' + postid ).attr( 'src', '' + response.data.thumbnail );
[751] Fix | Delete
}
[752] Fix | Delete
[753] Fix | Delete
if ( response.data.msg ) {
[754] Fix | Delete
$( '#imgedit-response-' + postid )
[755] Fix | Delete
.html( '<div class="notice notice-success" tabindex="-1" role="alert"><p>' + response.data.msg + '</p></div>' );
[756] Fix | Delete
[757] Fix | Delete
wp.a11y.speak( response.data.msg );
[758] Fix | Delete
}
[759] Fix | Delete
[760] Fix | Delete
if ( self._view ) {
[761] Fix | Delete
self._view.save();
[762] Fix | Delete
} else {
[763] Fix | Delete
imageEdit.close(postid);
[764] Fix | Delete
}
[765] Fix | Delete
});
[766] Fix | Delete
},
[767] Fix | Delete
[768] Fix | Delete
/**
[769] Fix | Delete
* Creates the image edit window.
[770] Fix | Delete
*
[771] Fix | Delete
* @since 2.9.0
[772] Fix | Delete
*
[773] Fix | Delete
* @memberof imageEdit
[774] Fix | Delete
*
[775] Fix | Delete
* @param {number} postid The post ID for the image.
[776] Fix | Delete
* @param {string} nonce The nonce to verify the request.
[777] Fix | Delete
* @param {Object} view The image editor view to be used for the editing.
[778] Fix | Delete
*
[779] Fix | Delete
* @return {void|promise} Either returns void if the button was already activated
[780] Fix | Delete
* or returns an instance of the image editor, wrapped in a promise.
[781] Fix | Delete
*/
[782] Fix | Delete
open : function( postid, nonce, view ) {
[783] Fix | Delete
this._view = view;
[784] Fix | Delete
[785] Fix | Delete
var dfd, data,
[786] Fix | Delete
elem = $( '#image-editor-' + postid ),
[787] Fix | Delete
head = $( '#media-head-' + postid ),
[788] Fix | Delete
btn = $( '#imgedit-open-btn-' + postid ),
[789] Fix | Delete
spin = btn.siblings( '.spinner' );
[790] Fix | Delete
[791] Fix | Delete
/*
[792] Fix | Delete
* Instead of disabling the button, which causes a focus loss and makes screen
[793] Fix | Delete
* readers announce "unavailable", return if the button was already clicked.
[794] Fix | Delete
*/
[795] Fix | Delete
if ( btn.hasClass( 'button-activated' ) ) {
[796] Fix | Delete
return;
[797] Fix | Delete
}
[798] Fix | Delete
[799] Fix | Delete
spin.addClass( 'is-active' );
[800] Fix | Delete
[801] Fix | Delete
data = {
[802] Fix | Delete
'action': 'image-editor',
[803] Fix | Delete
'_ajax_nonce': nonce,
[804] Fix | Delete
'postid': postid,
[805] Fix | Delete
'do': 'open'
[806] Fix | Delete
};
[807] Fix | Delete
[808] Fix | Delete
dfd = $.ajax( {
[809] Fix | Delete
url: ajaxurl,
[810] Fix | Delete
type: 'post',
[811] Fix | Delete
data: data,
[812] Fix | Delete
beforeSend: function() {
[813] Fix | Delete
btn.addClass( 'button-activated' );
[814] Fix | Delete
}
[815] Fix | Delete
} ).done( function( response ) {
[816] Fix | Delete
var errorMessage;
[817] Fix | Delete
[818] Fix | Delete
if ( '-1' === response ) {
[819] Fix | Delete
errorMessage = __( 'Could not load the preview image.' );
[820] Fix | Delete
elem.html( '<div class="notice notice-error" tabindex="-1" role="alert"><p>' + errorMessage + '</p></div>' );
[821] Fix | Delete
}
[822] Fix | Delete
[823] Fix | Delete
if ( response.data && response.data.html ) {
[824] Fix | Delete
elem.html( response.data.html );
[825] Fix | Delete
}
[826] Fix | Delete
[827] Fix | Delete
head.fadeOut( 'fast', function() {
[828] Fix | Delete
elem.fadeIn( 'fast', function() {
[829] Fix | Delete
if ( errorMessage ) {
[830] Fix | Delete
$( document ).trigger( 'image-editor-ui-ready' );
[831] Fix | Delete
}
[832] Fix | Delete
} );
[833] Fix | Delete
btn.removeClass( 'button-activated' );
[834] Fix | Delete
spin.removeClass( 'is-active' );
[835] Fix | Delete
} );
[836] Fix | Delete
// Initialize the Image Editor now that everything is ready.
[837] Fix | Delete
imageEdit.init( postid );
[838] Fix | Delete
} );
[839] Fix | Delete
[840] Fix | Delete
return dfd;
[841] Fix | Delete
},
[842] Fix | Delete
[843] Fix | Delete
/**
[844] Fix | Delete
* Initializes the cropping tool and sets a default cropping selection.
[845] Fix | Delete
*
[846] Fix | Delete
* @since 2.9.0
[847] Fix | Delete
*
[848] Fix | Delete
* @memberof imageEdit
[849] Fix | Delete
*
[850] Fix | Delete
* @param {number} postid The post ID.
[851] Fix | Delete
*
[852] Fix | Delete
* @return {void}
[853] Fix | Delete
*/
[854] Fix | Delete
imgLoaded : function(postid) {
[855] Fix | Delete
var img = $('#image-preview-' + postid), parent = $('#imgedit-crop-' + postid);
[856] Fix | Delete
[857] Fix | Delete
// Ensure init has run even when directly loaded.
[858] Fix | Delete
if ( 'undefined' === typeof this.hold.sizer ) {
[859] Fix | Delete
this.init( postid );
[860] Fix | Delete
}
[861] Fix | Delete
[862] Fix | Delete
this.initCrop(postid, img, parent);
[863] Fix | Delete
this.setCropSelection( postid, { 'x1': 0, 'y1': 0, 'x2': 0, 'y2': 0, 'width': img.innerWidth(), 'height': img.innerHeight() } );
[864] Fix | Delete
[865] Fix | Delete
this.toggleEditor( postid, 0, true );
[866] Fix | Delete
},
[867] Fix | Delete
[868] Fix | Delete
/**
[869] Fix | Delete
* Manages keyboard focus in the Image Editor user interface.
[870] Fix | Delete
*
[871] Fix | Delete
* @since 5.5.0
[872] Fix | Delete
*
[873] Fix | Delete
* @return {void}
[874] Fix | Delete
*/
[875] Fix | Delete
focusManager: function() {
[876] Fix | Delete
/*
[877] Fix | Delete
* Editor is ready. Move focus to one of the admin alert notices displayed
[878] Fix | Delete
* after a user action or to the first focusable element. Since the DOM
[879] Fix | Delete
* update is pretty large, the timeout helps browsers update their
[880] Fix | Delete
* accessibility tree to better support assistive technologies.
[881] Fix | Delete
*/
[882] Fix | Delete
setTimeout( function() {
[883] Fix | Delete
var elementToSetFocusTo = $( '.notice[role="alert"]' );
[884] Fix | Delete
[885] Fix | Delete
if ( ! elementToSetFocusTo.length ) {
[886] Fix | Delete
elementToSetFocusTo = $( '.imgedit-wrap' ).find( ':tabbable:first' );
[887] Fix | Delete
}
[888] Fix | Delete
[889] Fix | Delete
elementToSetFocusTo.attr( 'tabindex', '-1' ).trigger( 'focus' );
[890] Fix | Delete
}, 100 );
[891] Fix | Delete
},
[892] Fix | Delete
[893] Fix | Delete
/**
[894] Fix | Delete
* Initializes the cropping tool.
[895] Fix | Delete
*
[896] Fix | Delete
* @since 2.9.0
[897] Fix | Delete
*
[898] Fix | Delete
* @memberof imageEdit
[899] Fix | Delete
*
[900] Fix | Delete
* @param {number} postid The post ID.
[901] Fix | Delete
* @param {HTMLElement} image The preview image.
[902] Fix | Delete
* @param {HTMLElement} parent The preview image container.
[903] Fix | Delete
*
[904] Fix | Delete
* @return {void}
[905] Fix | Delete
*/
[906] Fix | Delete
initCrop : function(postid, image, parent) {
[907] Fix | Delete
var t = this,
[908] Fix | Delete
selW = $('#imgedit-sel-width-' + postid),
[909] Fix | Delete
selH = $('#imgedit-sel-height-' + postid),
[910] Fix | Delete
selX = $('#imgedit-start-x-' + postid),
[911] Fix | Delete
selY = $('#imgedit-start-y-' + postid),
[912] Fix | Delete
$image = $( image ),
[913] Fix | Delete
$img;
[914] Fix | Delete
[915] Fix | Delete
// Already initialized?
[916] Fix | Delete
if ( $image.data( 'imgAreaSelect' ) ) {
[917] Fix | Delete
return;
[918] Fix | Delete
}
[919] Fix | Delete
[920] Fix | Delete
t.iasapi = $image.imgAreaSelect({
[921] Fix | Delete
parent: parent,
[922] Fix | Delete
instance: true,
[923] Fix | Delete
handles: true,
[924] Fix | Delete
keys: true,
[925] Fix | Delete
minWidth: 3,
[926] Fix | Delete
minHeight: 3,
[927] Fix | Delete
[928] Fix | Delete
/**
[929] Fix | Delete
* Sets the CSS styles and binds events for locking the aspect ratio.
[930] Fix | Delete
*
[931] Fix | Delete
* @ignore
[932] Fix | Delete
*
[933] Fix | Delete
* @param {jQuery} img The preview image.
[934] Fix | Delete
*/
[935] Fix | Delete
onInit: function( img ) {
[936] Fix | Delete
// Ensure that the imgAreaSelect wrapper elements are position:absolute
[937] Fix | Delete
// (even if we're in a position:fixed modal).
[938] Fix | Delete
$img = $( img );
[939] Fix | Delete
$img.next().css( 'position', 'absolute' )
[940] Fix | Delete
.nextAll( '.imgareaselect-outer' ).css( 'position', 'absolute' );
[941] Fix | Delete
/**
[942] Fix | Delete
* Binds mouse down event to the cropping container.
[943] Fix | Delete
*
[944] Fix | Delete
* @return {void}
[945] Fix | Delete
*/
[946] Fix | Delete
parent.children().on( 'mousedown, touchstart', function(e){
[947] Fix | Delete
var ratio = false, sel, defRatio;
[948] Fix | Delete
[949] Fix | Delete
if ( e.shiftKey ) {
[950] Fix | Delete
sel = t.iasapi.getSelection();
[951] Fix | Delete
defRatio = t.getSelRatio(postid);
[952] Fix | Delete
ratio = ( sel && sel.width && sel.height ) ? sel.width + ':' + sel.height : defRatio;
[953] Fix | Delete
}
[954] Fix | Delete
[955] Fix | Delete
t.iasapi.setOptions({
[956] Fix | Delete
aspectRatio: ratio
[957] Fix | Delete
});
[958] Fix | Delete
});
[959] Fix | Delete
},
[960] Fix | Delete
[961] Fix | Delete
/**
[962] Fix | Delete
* Event triggered when starting a selection.
[963] Fix | Delete
*
[964] Fix | Delete
* @ignore
[965] Fix | Delete
*
[966] Fix | Delete
* @return {void}
[967] Fix | Delete
*/
[968] Fix | Delete
onSelectStart: function() {
[969] Fix | Delete
imageEdit.setDisabled($('#imgedit-crop-sel-' + postid), 1);
[970] Fix | Delete
imageEdit.setDisabled($('.imgedit-crop-clear'), 1);
[971] Fix | Delete
imageEdit.setDisabled($('.imgedit-crop-apply'), 1);
[972] Fix | Delete
},
[973] Fix | Delete
/**
[974] Fix | Delete
* Event triggered when the selection is ended.
[975] Fix | Delete
*
[976] Fix | Delete
* @ignore
[977] Fix | Delete
*
[978] Fix | Delete
* @param {Object} img jQuery object representing the image.
[979] Fix | Delete
* @param {Object} c The selection.
[980] Fix | Delete
*
[981] Fix | Delete
* @return {Object}
[982] Fix | Delete
*/
[983] Fix | Delete
onSelectEnd: function(img, c) {
[984] Fix | Delete
imageEdit.setCropSelection(postid, c);
[985] Fix | Delete
if ( ! $('#imgedit-crop > *').is(':visible') ) {
[986] Fix | Delete
imageEdit.toggleControls($('.imgedit-crop.button'));
[987] Fix | Delete
}
[988] Fix | Delete
},
[989] Fix | Delete
[990] Fix | Delete
/**
[991] Fix | Delete
* Event triggered when the selection changes.
[992] Fix | Delete
*
[993] Fix | Delete
* @ignore
[994] Fix | Delete
*
[995] Fix | Delete
* @param {Object} img jQuery object representing the image.
[996] Fix | Delete
* @param {Object} c The selection.
[997] Fix | Delete
*
[998] Fix | Delete
* @return {void}
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function