Media: Use a full uploader status view in the inline uploader. see #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-22 12:54:49 +00:00
parent 27e8de7e3a
commit 5f25155408
3 changed files with 21 additions and 18 deletions

View File

@ -757,10 +757,17 @@ a.media-modal-close {
.media-uploader-status { .media-uploader-status {
position: relative; position: relative;
padding-bottom: 10px; padding-bottom: 10px;
}
.media-sidebar .media-uploader-status {
border-bottom: 1px solid #dfdfdf; border-bottom: 1px solid #dfdfdf;
box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff;
} }
.uploader-inline .media-uploader-status h3 {
display: none;
}
.media-uploader-status .upload-details { .media-uploader-status .upload-details {
display: none; display: none;
font-size: 12px; font-size: 12px;
@ -791,10 +798,13 @@ a.media-modal-close {
} }
.media-uploader-status .upload-dismiss-errors { .media-uploader-status .upload-dismiss-errors {
text-decoration: none;
}
.media-sidebar .media-uploader-status .upload-dismiss-errors {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
text-decoration: none;
} }
.upload-errors .upload-error { .upload-errors .upload-error {
@ -811,8 +821,12 @@ a.media-modal-close {
margin-right: 8px; margin-right: 8px;
font-weight: bold; font-weight: bold;
color: #fff; color: #fff;
background: #f00; background: #e00;
background: -webkit-linear-gradient( top, #e00, #a00 ); background-image: -webkit-gradient(linear, left top, left bottom, from(#e00), to(#a00));
background-image: -webkit-linear-gradient(top, #e00, #a00);
background-image: -moz-linear-gradient(top, #e00, #a00);
background-image: -o-linear-gradient(top, #e00, #a00);
background-image: linear-gradient(to bottom, #e00, #a00);
border-radius: 3px; border-radius: 3px;
} }

View File

@ -1793,19 +1793,8 @@
if ( ! this.options.$browser && this.controller.uploader ) if ( ! this.options.$browser && this.controller.uploader )
this.options.$browser = this.controller.uploader.$browser; this.options.$browser = this.controller.uploader.$browser;
wp.Uploader.errors.on( 'add', this.error, this ); this.views.set( '.upload-inline-status', new media.view.UploaderStatus({
}, controller: this.controller
dispose: function() {
wp.Uploader.errors.off( null, null, this );
media.View.prototype.dispose.apply( this, arguments );
return this;
},
error: function( error ) {
this.views.set( '.upload-errors', new media.view.UploaderStatusError({
filename: error.get('file').name,
message: error.get('message')
}) ); }) );
}, },
@ -1844,9 +1833,9 @@
this.queue.on( 'add remove reset change:uploading', this.info, this ); this.queue.on( 'add remove reset change:uploading', this.info, this );
this.errors = wp.Uploader.errors; this.errors = wp.Uploader.errors;
this.errors.reset();
this.errors.on( 'add remove reset', this.visibility, this ); this.errors.on( 'add remove reset', this.visibility, this );
this.errors.on( 'add', this.error, this ); this.errors.on( 'add', this.error, this );
_.each( this.errors.models, this.error, this );
}, },
dispose: function() { dispose: function() {

View File

@ -1497,7 +1497,7 @@ function wp_print_media_templates( $attachment ) {
<a href="#" class="browser button button-hero"><?php _e( 'Select Files' ); ?></a> <a href="#" class="browser button button-hero"><?php _e( 'Select Files' ); ?></a>
</div> </div>
<div class="upload-errors"></div> <div class="upload-inline-status"></div>
<div class="post-upload-ui"> <div class="post-upload-ui">
<?php do_action( 'pre-upload-ui' ); ?> <?php do_action( 'pre-upload-ui' ); ?>