WordPress.org

Make WordPress Core

Changeset 27242


Ignore:
Timestamp:
02/24/2014 08:25:54 PM (7 years ago)
Author:
wonderboymusic
Message:

Load default settings state when creating a new playlist in the media modal. Add a few missing inline @this annotations in media-editor.js.

See #26631.

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

Legend:

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

    r27239 r27242  
    584584                tracklist: false,
    585585                tracknumbers: false,
    586                 images: false
     586                images: true
    587587            }
    588588        };
     
    813813
    814814            workflow.state('playlist-edit').on( 'update', function( selection ) {
     815                /**
     816                 * @this wp.media.editor
     817                 */
    815818                this.insert( wp.media.playlist.shortcode( selection ).string() );
    816819            }, this );
    817820
    818821            workflow.state('video-playlist-edit').on( 'update', function( selection ) {
     822                /**
     823                 * @this wp.media.editor
     824                 */
    819825                this.insert( wp.media['video-playlist'].shortcode( selection ).string() );
    820826            }, this );
  • trunk/src/wp-includes/media-template.php

    r27241 r27242  
    432432        </label>
    433433
     434        <#
     435            var playlist = 'playlist-edit' === data.controller.id, emptyModel = 'undefined' === typeof data.model.style;
     436        #>
    434437        <label class="setting">
    435438            <span><?php _e( 'Show Tracklist' ); ?></span>
    436             <input type="checkbox" data-setting="_tracklist" />
     439            <input type="checkbox" data-setting="_tracklist" <# if ( playlist && emptyModel ) { #>
     440                checked="checked"
     441            <# } #> />
    437442        </label>
    438443
    439444        <label class="setting">
    440445            <span><?php _e( 'Show Track Numbers' ); ?></span>
    441             <input type="checkbox" data-setting="_tracknumbers" />
     446            <input type="checkbox" data-setting="_tracknumbers" <# if ( playlist && emptyModel ) { #>
     447                checked="checked"
     448            <# } #> />
    442449        </label>
    443450
    444451        <label class="setting">
    445452            <span><?php _e( 'Show Artist Name in Tracklist' ); ?></span>
    446             <input type="checkbox" data-setting="_artists" />
     453            <input type="checkbox" data-setting="_artists" <# if ( playlist && emptyModel ) { #>
     454                checked="checked"
     455            <# } #> />
    447456        </label>
    448457
    449458        <label class="setting">
    450459            <span><?php _e( 'Show Images' ); ?></span>
    451             <input type="checkbox" data-setting="_images" />
     460            <input type="checkbox" data-setting="_images" <# if ( emptyModel ) { #>
     461                checked="checked"
     462            <# } #> />
    452463        </label>
    453464    </script>
Note: See TracChangeset for help on using the changeset viewer.