Make WordPress Core

Changeset 29434


Ignore:
Timestamp:
08/07/2014 08:08:18 PM (10 years ago)
Author:
wonderboymusic
Message:

Create a new Backbone view, media.view.Label, which can be used as a subview in things like toolbars, which need screen reader text.

Make an initial instance of it for the label for Bulk Actions in Media Grid.

See #29026.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r29432 r29434  
    541541            });
    542542
     543            this.views.add( new media.view.Label({
     544                value: l10n.bulkActionsLabel,
     545                attributes: {
     546                    'for': 'bulk-select-dropdown'
     547                }
     548            }) );
     549
    543550            this.views.add(
    544551                new media.view.BulkSelectionActionDropdown({
     
    566573     */
    567574    media.view.BulkSelectionActionDropdown = media.View.extend({
    568         tagName:   'select',
     575        tagName: 'select',
     576        id:      'bulk-select-dropdown',
    569577
    570578        initialize: function() {
  • trunk/src/wp-includes/js/media-views.js

    r29432 r29434  
    65656565        loading: function() {
    65666566            this.$el.toggleClass( 'embed-loading', this.model.get('loading') );
     6567        }
     6568    });
     6569
     6570    /**
     6571     * @constructor
     6572     * @augments wp.media.View
     6573     * @augments wp.Backbone.View
     6574     * @augments Backbone.View
     6575     */
     6576    media.view.Label = media.View.extend({
     6577        tagName: 'label',
     6578        className: 'screen-reader-text',
     6579
     6580        initialize: function() {
     6581            this.value = this.options.value;
     6582        },
     6583
     6584        render: function() {
     6585            this.$el.html( this.value );
    65676586        }
    65686587    });
  • trunk/src/wp-includes/media.php

    r29432 r29434  
    29382938        'warnBulkDelete'         => __( "You are about to permanently delete these items.\n  'Cancel' to stop, 'OK' to delete." ),
    29392939        'bulkActions'            => __( 'Bulk Actions' ),
     2940        'bulkActionsLabel'       => __( 'Select bulk action' ),
    29402941        'deletePermanently'      => __( 'Delete Permanently' ),
    29412942        'apply'                  => __( 'Apply' ),
Note: See TracChangeset for help on using the changeset viewer.