Add error message when loading the preview image in the image editor fails, fixes #18723
git-svn-id: https://develop.svn.wordpress.org/trunk@18798 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
91c746f586
commit
2a7b8b4764
@ -181,6 +181,9 @@ imageEdit = {
|
||||
$('input.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', true);
|
||||
|
||||
t.toggleEditor(postid, 0);
|
||||
}).error(function(){
|
||||
$('#imgedit-crop-' + postid).empty().append('<div class="error"><p>' + imageEditL10n.error + '</p></div>');
|
||||
t.toggleEditor(postid, 0);
|
||||
}).attr('src', ajaxurl + '?' + $.param(data));
|
||||
},
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -374,7 +374,10 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery-ui-draggable' ), '20101022', 1 );
|
||||
|
||||
$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20110524', 1 );
|
||||
$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20110927', 1 );
|
||||
$scripts->add_script_data( 'image-edit', 'imageEditL10n', array(
|
||||
'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
|
||||
));
|
||||
|
||||
$scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20100518', 1 );
|
||||
$scripts->add_script_data( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
|
||||
|
Loading…
Reference in New Issue
Block a user