Add error message when loading the preview image in the image editor fails, fixes #18723

git-svn-id: http://svn.automattic.com/wordpress/trunk@18798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-09-28 06:08:56 +00:00
parent 8c1bc6831a
commit 8315e48d3a
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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(