Edit File by line
/home/barbar84/www/wp-inclu.../js/plupload
File: handlers.js
[500] Fix | Delete
if ( response.success ) {
[501] Fix | Delete
uploadSuccess( file, response.data.id );
[502] Fix | Delete
} else {
[503] Fix | Delete
if ( response.data && response.data.message ) {
[504] Fix | Delete
message = response.data.message;
[505] Fix | Delete
}
[506] Fix | Delete
[507] Fix | Delete
wpQueueError( message || pluploadL10n.http_error_image );
[508] Fix | Delete
}
[509] Fix | Delete
}).fail( function( jqXHR ) {
[510] Fix | Delete
// If another HTTP 5xx error, try try again...
[511] Fix | Delete
if ( jqXHR.status >= 500 && jqXHR.status < 600 ) {
[512] Fix | Delete
tryAgain( up, error );
[513] Fix | Delete
return;
[514] Fix | Delete
}
[515] Fix | Delete
[516] Fix | Delete
wpQueueError( pluploadL10n.http_error_image );
[517] Fix | Delete
});
[518] Fix | Delete
}
[519] Fix | Delete
[520] Fix | Delete
// Init and set the uploader.
[521] Fix | Delete
uploader_init = function() {
[522] Fix | Delete
uploader = new plupload.Uploader( wpUploaderInit );
[523] Fix | Delete
[524] Fix | Delete
$( '#image_resize' ).bind( 'change', function() {
[525] Fix | Delete
var arg = $( this ).prop( 'checked' );
[526] Fix | Delete
[527] Fix | Delete
setResize( arg );
[528] Fix | Delete
[529] Fix | Delete
if ( arg )
[530] Fix | Delete
setUserSetting( 'upload_resize', '1' );
[531] Fix | Delete
else
[532] Fix | Delete
deleteUserSetting( 'upload_resize' );
[533] Fix | Delete
});
[534] Fix | Delete
[535] Fix | Delete
uploader.bind( 'Init', function( up ) {
[536] Fix | Delete
var uploaddiv = $( '#plupload-upload-ui' );
[537] Fix | Delete
[538] Fix | Delete
setResize( getUserSetting( 'upload_resize', false ) );
[539] Fix | Delete
[540] Fix | Delete
if ( up.features.dragdrop && ! $( document.body ).hasClass( 'mobile' ) ) {
[541] Fix | Delete
uploaddiv.addClass( 'drag-drop' );
[542] Fix | Delete
[543] Fix | Delete
$( '#drag-drop-area' ).on( 'dragover.wp-uploader', function() { // dragenter doesn't fire right :(
[544] Fix | Delete
uploaddiv.addClass( 'drag-over' );
[545] Fix | Delete
}).on( 'dragleave.wp-uploader, drop.wp-uploader', function() {
[546] Fix | Delete
uploaddiv.removeClass( 'drag-over' );
[547] Fix | Delete
});
[548] Fix | Delete
} else {
[549] Fix | Delete
uploaddiv.removeClass( 'drag-drop' );
[550] Fix | Delete
$( '#drag-drop-area' ).off( '.wp-uploader' );
[551] Fix | Delete
}
[552] Fix | Delete
[553] Fix | Delete
if ( up.runtime === 'html4' ) {
[554] Fix | Delete
$( '.upload-flash-bypass' ).hide();
[555] Fix | Delete
}
[556] Fix | Delete
});
[557] Fix | Delete
[558] Fix | Delete
uploader.bind( 'postinit', function( up ) {
[559] Fix | Delete
up.refresh();
[560] Fix | Delete
});
[561] Fix | Delete
[562] Fix | Delete
uploader.init();
[563] Fix | Delete
[564] Fix | Delete
uploader.bind( 'FilesAdded', function( up, files ) {
[565] Fix | Delete
$( '#media-upload-error' ).empty();
[566] Fix | Delete
uploadStart();
[567] Fix | Delete
[568] Fix | Delete
plupload.each( files, function( file ) {
[569] Fix | Delete
if ( file.type === 'image/heic' && up.settings.heic_upload_error ) {
[570] Fix | Delete
// Show error but do not block uploading.
[571] Fix | Delete
wpQueueError( pluploadL10n.unsupported_image )
[572] Fix | Delete
}
[573] Fix | Delete
[574] Fix | Delete
fileQueued( file );
[575] Fix | Delete
});
[576] Fix | Delete
[577] Fix | Delete
up.refresh();
[578] Fix | Delete
up.start();
[579] Fix | Delete
});
[580] Fix | Delete
[581] Fix | Delete
uploader.bind( 'UploadFile', function( up, file ) {
[582] Fix | Delete
fileUploading( up, file );
[583] Fix | Delete
});
[584] Fix | Delete
[585] Fix | Delete
uploader.bind( 'UploadProgress', function( up, file ) {
[586] Fix | Delete
uploadProgress( up, file );
[587] Fix | Delete
});
[588] Fix | Delete
[589] Fix | Delete
uploader.bind( 'Error', function( up, error ) {
[590] Fix | Delete
var isImage = error.file && error.file.type && error.file.type.indexOf( 'image/' ) === 0;
[591] Fix | Delete
var status = error && error.status;
[592] Fix | Delete
[593] Fix | Delete
// If the file is an image and the error is HTTP 5xx try to create sub-sizes again.
[594] Fix | Delete
if ( isImage && status >= 500 && status < 600 ) {
[595] Fix | Delete
tryAgain( up, error );
[596] Fix | Delete
return;
[597] Fix | Delete
}
[598] Fix | Delete
[599] Fix | Delete
uploadError( error.file, error.code, error.message, up );
[600] Fix | Delete
up.refresh();
[601] Fix | Delete
});
[602] Fix | Delete
[603] Fix | Delete
uploader.bind( 'FileUploaded', function( up, file, response ) {
[604] Fix | Delete
uploadSuccess( file, response.response );
[605] Fix | Delete
});
[606] Fix | Delete
[607] Fix | Delete
uploader.bind( 'UploadComplete', function() {
[608] Fix | Delete
uploadComplete();
[609] Fix | Delete
});
[610] Fix | Delete
};
[611] Fix | Delete
[612] Fix | Delete
if ( typeof( wpUploaderInit ) == 'object' ) {
[613] Fix | Delete
uploader_init();
[614] Fix | Delete
}
[615] Fix | Delete
[616] Fix | Delete
});
[617] Fix | Delete
[618] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function