Make WordPress Core

Ticket #30689: 30689.patch

File 30689.patch, 3.7 KB (added by ocean90, 12 years ago)
  • src/wp-admin/js/customize-controls.js

     
    10491049                 */
    10501050                initFrame: function() {
    10511051                        this.frame = wp.media({
    1052                                 // The title of the media modal.
    1053                                 title: this.params.button_labels.frame_title,
    1054 
    1055                                 // Restrict the library to specified mime type.
    1056                                 library: {
    1057                                         type: this.params.mime_type
    1058                                 },
    10591052                                button: {
    1060                                         // Change the submit button label.
    10611053                                        text: this.params.button_labels.frame_button
    10621054                                },
    1063                                 multiple: false
     1055                                states: [
     1056                                        new wp.media.controller.Library({
     1057                                                title:     this.params.button_labels.frame_title,
     1058                                                library:   wp.media.query({ type: this.params.mime_type }),
     1059                                                multiple:  false,
     1060                                                date:      false
     1061                                        })
     1062                                ]
    10641063                        });
    10651064
    10661065                        // When a file is selected, run a callback.
     
    12641263                                                title:     l10n.chooseImage,
    12651264                                                library:   wp.media.query({ type: 'image' }),
    12661265                                                multiple:  false,
     1266                                                date: false,
    12671267                                                priority:  20,
    12681268                                                suggestedWidth: _wpCustomizeHeader.data.width,
    12691269                                                suggestedHeight: _wpCustomizeHeader.data.height
  • src/wp-includes/js/media-views.js

     
    25982598                                sortable:   state.get('sortable'),
    25992599                                search:     state.get('searchable'),
    26002600                                filters:    state.get('filterable'),
     2601                                date:       state.get('date'),
    26012602                                display:    state.has('display') ? state.get('display') : state.get('displaySettings'),
    26022603                                dragInfo:   state.get('dragInfo'),
    26032604
     
    62276228         *                                              Accepts 'uploaded' and 'all'.
    62286229         * @param {object}      [options.search=true]   Whether to show the search interface in the
    62296230         *                                              browser's toolbar.
     6231         * @param {object}      [options.date=true]     Whether to show the date filter in the
     6232         *                                              browser's toolbar.
    62306233         * @param {object}      [options.display=false] Whether to show the attachments display settings
    62316234         *                                              view in the sidebar.
    62326235         * @param {bool|string} [options.sidebar=true]  Whether to create a sidebar for the browser.
     
    62406243                        _.defaults( this.options, {
    62416244                                filters: false,
    62426245                                search:  true,
     6246                                date:  true,
    62436247                                display: false,
    62446248                                sidebar: true,
    62456249                                AttachmentView: media.view.Attachment.Library
     
    64546458                                }
    64556459
    64566460                        } else {
    6457                                 // DateFilter is a <select>, screen reader text needs to be rendered before
    6458                                 this.toolbar.set( 'dateFilterLabel', new media.view.Label({
    6459                                         value: l10n.filterByDate,
    6460                                         attributes: {
    6461                                                 'for': 'media-attachment-date-filters'
    6462                                         },
    6463                                         priority: -75
    6464                                 }).render() );
    6465                                 this.toolbar.set( 'dateFilter', new media.view.DateFilter({
    6466                                         controller: this.controller,
    6467                                         model:      this.collection.props,
    6468                                         priority: -75
    6469                                 }).render() );
     6461                                if ( this.options.date ) {
     6462                                        // DateFilter is a <select>, screen reader text needs to be rendered before
     6463                                        this.toolbar.set( 'dateFilterLabel', new media.view.Label({
     6464                                                value: l10n.filterByDate,
     6465                                                attributes: {
     6466                                                        'for': 'media-attachment-date-filters'
     6467                                                },
     6468                                                priority: -75
     6469                                        }).render() );
     6470                                        this.toolbar.set( 'dateFilter', new media.view.DateFilter({
     6471                                                controller: this.controller,
     6472                                                model:      this.collection.props,
     6473                                                priority: -75
     6474                                        }).render() );
     6475                                }
    64706476                        }
    64716477
    64726478                        if ( this.options.search ) {