Remove the Cancel Upload button, fixes #19050

git-svn-id: http://svn.automattic.com/wordpress/trunk@19127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-11-03 01:47:12 +00:00
parent 1fcdc41bdb
commit 84a23bfd81
4 changed files with 6 additions and 20 deletions

View File

@ -1345,8 +1345,7 @@ wpUploaderInit = <?php echo json_encode($plupload_init); ?>;
<div id="drag-drop-area">
<div class="drag-drop-inside">
<p class="drag-drop-info"><?php _e('Drop files here or'); ?></p>
<p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" />
<input id="cancel-upload" disabled="true" onclick="cancelUpload()" type="button" value="<?php esc_attr_e('Cancel Upload'); ?>" class="button" /></p>
<p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
</div>
</div>
<?php do_action('post-plupload-upload-ui'); // hook change, old name: 'post-flash-upload-ui' ?>

View File

@ -19,9 +19,8 @@ function fileQueued(fileObj) {
// Display the progress div
jQuery('.progress', '#media-item-' + fileObj.id).show();
// Disable submit and enable cancel
// Disable submit
jQuery('#insert-gallery').prop('disabled', true);
jQuery('#cancel-upload').prop('disabled', false);
}
function uploadStart(fileObj) {
@ -192,23 +191,12 @@ function prepareMediaItemInit(fileObj) {
jQuery('#media-item-' + fileObj.id + '.startopen').removeClass('startopen').slideToggle(500).siblings('.toggle').toggle();
}
function cancelUpload() {
uploader.stop();
uploadComplete();
jQuery.each(uploader.files, function(i,file) {
if ( file.status == plupload.STOPPED )
jQuery('#media-item-' + file.id).remove();
});
}
// wp-specific error handlers
// generic message
// generic error message
function wpQueueError(message) {
jQuery('#media-upload-error').show().html( '<div class="error"><p>' + message + '</p></div>' );
}
// file-specific message
// file-specific error messages
function wpFileError(fileObj, message) {
var item = jQuery('#media-item-' + fileObj.id), filename = jQuery('.filename', item).text();
@ -269,7 +257,6 @@ function deleteError(X, textStatus, errorThrown) {
}
function uploadComplete() {
jQuery('#cancel-upload').prop('disabled', true);
jQuery('#insert-gallery').prop('disabled', false);
}

File diff suppressed because one or more lines are too long

View File

@ -220,7 +220,7 @@ function wp_default_scripts( &$scripts ) {
// cannot use the plupload.full.js, as it loads browserplus init JS from Yahoo
$scripts->add( 'plupload-full', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1.5b');
$scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-full', 'jquery'), '20111101');
$scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-full', 'jquery'), '20111102');
$scripts->add_script_data( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
// keep 'swfupload' for back-compat.