Make WordPress Core

Changeset 22658


Ignore:
Timestamp:
11/19/2012 03:11:48 AM (14 years ago)
Author:
koopersmith
Message:

Media: Remove unused batch edit states and strings. see #21390.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/media-views.js

    r22656 r22658  
    10921092                createStates: function() {
    10931093                        var options = this.options,
    1094                                 main, gallery, batch;
     1094                                main, gallery;
    10951095
    10961096                        main = {
     
    11091109                                toolbar:      'gallery-add',
    11101110                                excludeState: 'gallery-edit'
    1111                         };
    1112 
    1113                         batch = {
    1114                                 multiple:     true,
    1115                                 menu:         'batch',
    1116                                 toolbar:      'batch-add',
    1117                                 excludeState: 'batch-edit'
    11181111                        };
    11191112
     
    11461139                                new media.controller.Upload( _.defaults({
    11471140                                        id: 'gallery-upload'
    1148                                 }, gallery ) ),
    1149 
    1150                                 // Batch states.
    1151                                 new media.controller.Library({
    1152                                         id:         'batch-edit',
    1153                                         multiple:   false,
    1154                                         describe:   true,
    1155                                         edge:       199,
    1156                                         sortable:   true,
    1157                                         searchable: false,
    1158                                         menu:       'batch',
    1159                                         toolbar:    'batch-edit',
    1160                                         sidebar:    'attachment-settings'
    1161                                 }),
    1162 
    1163                                 new media.controller.Library( _.defaults({
    1164                                         id:      'batch-library',
    1165                                         library: media.query({ type: 'image' })
    1166                                 }, batch ) ),
    1167 
    1168                                 new media.controller.Upload( _.defaults({
    1169                                         id: 'batch-upload'
    1170                                 }, batch ) )
     1141                                }, gallery ) )
    11711142                        ]);
    11721143                },
     
    11771148                        var handlers = {
    11781149                                        menu: {
    1179                                                 'batch':   'batchMenu',
    11801150                                                'gallery': 'galleryMenu'
    11811151                                        },
     
    11931163                                                'main-attachments': 'mainAttachmentsToolbar',
    11941164                                                'main-embed':       'mainEmbedToolbar',
    1195                                                 'batch-edit':       'batchEditToolbar',
    1196                                                 'batch-add':        'batchAddToolbar',
    11971165                                                'gallery-edit':     'galleryEditToolbar',
    11981166                                                'gallery-add':      'galleryAddToolbar'
     
    12231191                                }
    12241192                        });
    1225                 },
    1226 
    1227                 batchMenu: function() {
    1228                         var previous = this.previous(),
    1229                                 frame = this;
    1230 
    1231                         this.menu.view( new media.view.Menu({
    1232                                 controller: this,
    1233                                 views: {
    1234                                         cancel: {
    1235                                                 text:     l10n.cancelBatchTitle,
    1236                                                 priority: 20,
    1237                                                 click:    function() {
    1238                                                         if ( previous )
    1239                                                                 frame.state( previous );
    1240                                                         else
    1241                                                                 frame.close();
    1242                                                 }
    1243                                         },
    1244                                         separateCancel: new media.View({
    1245                                                 className: 'separator',
    1246                                                 priority: 40
    1247                                         }),
    1248                                         'batch-edit': {
    1249                                                 text: l10n.editBatchTitle,
    1250                                                 priority: 60
    1251                                         },
    1252                                         'batch-upload': {
    1253                                                 text: l10n.uploadFilesTitle,
    1254                                                 priority: 80
    1255                                         },
    1256                                         'batch-library': {
    1257                                                 text: l10n.mediaLibraryTitle,
    1258                                                 priority: 100
    1259                                         }
    1260                                 }
    1261                         }) );
    12621193                },
    12631194
     
    13981329                },
    13991330
    1400                 batchEditToolbar: function() {
    1401                         this.toolbar.view( new media.view.Toolbar({
    1402                                 controller: this,
    1403                                 items: {
    1404                                         insert: {
    1405                                                 style:    'primary',
    1406                                                 text:     l10n.insertIntoPost,
    1407                                                 priority: 80,
    1408 
    1409                                                 click: function() {
    1410                                                         var controller = this.controller,
    1411                                                                 state = controller.state();
    1412 
    1413                                                         controller.close();
    1414                                                         state.trigger( 'insert', state.get('library') );
    1415 
    1416                                                         controller.reset();
    1417                                                         // @todo: Make the state activated dynamic (instead of hardcoded).
    1418                                                         controller.state('upload');
    1419                                                 }
    1420                                         }
    1421                                 }
    1422                         }) );
    1423                 },
    1424 
    1425                 batchAddToolbar: function() {
    1426                         this.toolbar.view( new media.view.Toolbar({
    1427                                 controller: this,
    1428                                 items: {
    1429                                         insert: {
    1430                                                 style:    'primary',
    1431                                                 text:     l10n.addToBatch,
    1432                                                 priority: 80,
    1433 
    1434                                                 click: function() {
    1435                                                         var controller = this.controller,
    1436                                                                 state = controller.state(),
    1437                                                                 edit = controller.get('batch-edit');
    1438 
    1439                                                         edit.get('library').add( state.get('selection').models );
    1440                                                         state.trigger('reset');
    1441                                                         controller.state('batch-edit');
    1442                                                 }
    1443                                         }
    1444                                 }
    1445                         }) );
    1446                 },
    1447 
    14481331                galleryEditToolbar: function() {
    14491332                        var editing = this.state().get('editing');
  • trunk/wp-includes/media.php

    r22648 r22658  
    13621362                'insertEmbed'       => __( 'Insert embed' ),
    13631363
    1364                 // Batch
    1365                 'batchInsert'      => __( 'Batch insert' ),
    1366                 'cancelBatchTitle' => __( '← Cancel Batch' ),
    1367                 'editBatchTitle'   => __( 'Edit Batch' ),
    1368                 'addToBatch'       => __( 'Add to batch' ),
    1369 
    13701364                // Gallery
    13711365                'createGalleryTitle' => __( 'Create Gallery' ),
Note: See TracChangeset for help on using the changeset viewer.