Media: Add an "upload more files" button to upload states. see #21390.

git-svn-id: https://develop.svn.wordpress.org/trunk@22552 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-11-12 23:52:17 +00:00
parent b73b44b8db
commit 4ee51a98cb
3 changed files with 23 additions and 2 deletions

View File

@ -619,6 +619,14 @@
height: 50px;
}
.attachments-browser .media-toolbar-primary > .media-button,
.attachments-browser .media-toolbar-primary > .media-button-group,
.attachments-browser .media-toolbar-secondary > .media-button,
.attachments-browser .media-toolbar-secondary > .media-button-group {
margin-top: 10px;
}
.attachments-browser .attachments {
position: absolute;
top: 50px;

View File

@ -470,7 +470,9 @@
// ---------------------------
media.controller.Upload = media.controller.Library.extend({
defaults: _.defaults({
id: 'upload'
id: 'upload',
upload: { text: l10n.uploadMoreFiles },
searchable: false
}, media.controller.Library.prototype.defaults ),
initialize: function() {
@ -852,6 +854,7 @@
model: state,
sortable: state.get('sortable'),
search: state.get('searchable'),
upload: state.get('upload'),
AttachmentView: state.get('AttachmentView')
}).render() );
@ -1526,7 +1529,7 @@
this.$el.html( this.template( this.options ) );
$placeholder = this.$('.browser');
$browser.text( $placeholder.text() );
$browser.detach().text( $placeholder.text() );
$browser[0].className = $placeholder[0].className;
$placeholder.replaceWith( $browser.show() );
@ -2505,6 +2508,15 @@
}) );
}
if ( this.options.upload && this.controller.uploader ) {
this.toolbar.set( 'upload', new media.view.Button( _.extend({
el: this.controller.uploader.$browser.detach()[0],
priority: -60,
size: 'large',
text: l10n.selectFiles
}, this.options.upload ) ).render() );
}
this.attachments = new media.view.Attachments({
controller: this.controller,
collection: this.collection,

View File

@ -1339,6 +1339,7 @@ function wp_enqueue_media() {
'uploadFilesTitle' => __( 'Upload Files' ),
'selectFiles' => __( 'Select files' ),
'uploadImagesTitle' => __( 'Upload Images' ),
'uploadMoreFiles' => __( 'Upload more files' ),
// Library
'mediaLibraryTitle' => __( 'Media Library' ),