mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Media: Remove unused batch edit states and strings. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
29a9b52ca9
commit
ff204257db
@ -1091,7 +1091,7 @@
|
||||
|
||||
createStates: function() {
|
||||
var options = this.options,
|
||||
main, gallery, batch;
|
||||
main, gallery;
|
||||
|
||||
main = {
|
||||
multiple: this.options.multiple,
|
||||
@ -1110,13 +1110,6 @@
|
||||
excludeState: 'gallery-edit'
|
||||
};
|
||||
|
||||
batch = {
|
||||
multiple: true,
|
||||
menu: 'batch',
|
||||
toolbar: 'batch-add',
|
||||
excludeState: 'batch-edit'
|
||||
};
|
||||
|
||||
// Add the default states.
|
||||
this.states.add([
|
||||
// Main states.
|
||||
@ -1145,29 +1138,7 @@
|
||||
|
||||
new media.controller.Upload( _.defaults({
|
||||
id: 'gallery-upload'
|
||||
}, gallery ) ),
|
||||
|
||||
// Batch states.
|
||||
new media.controller.Library({
|
||||
id: 'batch-edit',
|
||||
multiple: false,
|
||||
describe: true,
|
||||
edge: 199,
|
||||
sortable: true,
|
||||
searchable: false,
|
||||
menu: 'batch',
|
||||
toolbar: 'batch-edit',
|
||||
sidebar: 'attachment-settings'
|
||||
}),
|
||||
|
||||
new media.controller.Library( _.defaults({
|
||||
id: 'batch-library',
|
||||
library: media.query({ type: 'image' })
|
||||
}, batch ) ),
|
||||
|
||||
new media.controller.Upload( _.defaults({
|
||||
id: 'batch-upload'
|
||||
}, batch ) )
|
||||
}, gallery ) )
|
||||
]);
|
||||
},
|
||||
|
||||
@ -1176,7 +1147,6 @@
|
||||
|
||||
var handlers = {
|
||||
menu: {
|
||||
'batch': 'batchMenu',
|
||||
'gallery': 'galleryMenu'
|
||||
},
|
||||
|
||||
@ -1192,8 +1162,6 @@
|
||||
toolbar: {
|
||||
'main-attachments': 'mainAttachmentsToolbar',
|
||||
'main-embed': 'mainEmbedToolbar',
|
||||
'batch-edit': 'batchEditToolbar',
|
||||
'batch-add': 'batchAddToolbar',
|
||||
'gallery-edit': 'galleryEditToolbar',
|
||||
'gallery-add': 'galleryAddToolbar'
|
||||
}
|
||||
@ -1224,43 +1192,6 @@
|
||||
});
|
||||
},
|
||||
|
||||
batchMenu: function() {
|
||||
var previous = this.previous(),
|
||||
frame = this;
|
||||
|
||||
this.menu.view( new media.view.Menu({
|
||||
controller: this,
|
||||
views: {
|
||||
cancel: {
|
||||
text: l10n.cancelBatchTitle,
|
||||
priority: 20,
|
||||
click: function() {
|
||||
if ( previous )
|
||||
frame.state( previous );
|
||||
else
|
||||
frame.close();
|
||||
}
|
||||
},
|
||||
separateCancel: new media.View({
|
||||
className: 'separator',
|
||||
priority: 40
|
||||
}),
|
||||
'batch-edit': {
|
||||
text: l10n.editBatchTitle,
|
||||
priority: 60
|
||||
},
|
||||
'batch-upload': {
|
||||
text: l10n.uploadFilesTitle,
|
||||
priority: 80
|
||||
},
|
||||
'batch-library': {
|
||||
text: l10n.mediaLibraryTitle,
|
||||
priority: 100
|
||||
}
|
||||
}
|
||||
}) );
|
||||
},
|
||||
|
||||
galleryMenu: function() {
|
||||
var previous = this.previous(),
|
||||
frame = this;
|
||||
@ -1397,54 +1328,6 @@
|
||||
this.$el.removeClass('hide-toolbar');
|
||||
},
|
||||
|
||||
batchEditToolbar: function() {
|
||||
this.toolbar.view( new media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
style: 'primary',
|
||||
text: l10n.insertIntoPost,
|
||||
priority: 80,
|
||||
|
||||
click: function() {
|
||||
var controller = this.controller,
|
||||
state = controller.state();
|
||||
|
||||
controller.close();
|
||||
state.trigger( 'insert', state.get('library') );
|
||||
|
||||
controller.reset();
|
||||
// @todo: Make the state activated dynamic (instead of hardcoded).
|
||||
controller.state('upload');
|
||||
}
|
||||
}
|
||||
}
|
||||
}) );
|
||||
},
|
||||
|
||||
batchAddToolbar: function() {
|
||||
this.toolbar.view( new media.view.Toolbar({
|
||||
controller: this,
|
||||
items: {
|
||||
insert: {
|
||||
style: 'primary',
|
||||
text: l10n.addToBatch,
|
||||
priority: 80,
|
||||
|
||||
click: function() {
|
||||
var controller = this.controller,
|
||||
state = controller.state(),
|
||||
edit = controller.get('batch-edit');
|
||||
|
||||
edit.get('library').add( state.get('selection').models );
|
||||
state.trigger('reset');
|
||||
controller.state('batch-edit');
|
||||
}
|
||||
}
|
||||
}
|
||||
}) );
|
||||
},
|
||||
|
||||
galleryEditToolbar: function() {
|
||||
var editing = this.state().get('editing');
|
||||
this.toolbar.view( new media.view.Toolbar({
|
||||
|
@ -1361,12 +1361,6 @@ function wp_enqueue_media( $args = array() ) {
|
||||
'embedFromUrlTitle' => __( 'Embed From URL' ),
|
||||
'insertEmbed' => __( 'Insert embed' ),
|
||||
|
||||
// Batch
|
||||
'batchInsert' => __( 'Batch insert' ),
|
||||
'cancelBatchTitle' => __( '← Cancel Batch' ),
|
||||
'editBatchTitle' => __( 'Edit Batch' ),
|
||||
'addToBatch' => __( 'Add to batch' ),
|
||||
|
||||
// Gallery
|
||||
'createGalleryTitle' => __( 'Create Gallery' ),
|
||||
'editGalleryTitle' => __( 'Edit Gallery' ),
|
||||
|
Loading…
Reference in New Issue
Block a user