From ff204257db27af58fda9f9b2e7acb3f86a0e8370 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Mon, 19 Nov 2012 03:11:48 +0000 Subject: [PATCH] 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 --- wp-includes/js/media-views.js | 121 +--------------------------------- wp-includes/media.php | 6 -- 2 files changed, 2 insertions(+), 125 deletions(-) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 1f381f5524..d6a5dc3aba 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -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({ diff --git a/wp-includes/media.php b/wp-includes/media.php index 2b55019961..3a5b9d141b 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -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' ),