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.


Built from https://develop.svn.wordpress.org/trunk@27242


git-svn-id: http://core.svn.wordpress.org/trunk@27099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-02-24 20:26:14 +00:00
parent 700ba14371
commit c0379aaafc
3 changed files with 23 additions and 6 deletions

View File

@ -583,7 +583,7 @@
style: 'light',
tracklist: false,
tracknumbers: false,
images: false
images: true
}
};
@ -812,10 +812,16 @@
}, this );
workflow.state('playlist-edit').on( 'update', function( selection ) {
/**
* @this wp.media.editor
*/
this.insert( wp.media.playlist.shortcode( selection ).string() );
}, this );
workflow.state('video-playlist-edit').on( 'update', function( selection ) {
/**
* @this wp.media.editor
*/
this.insert( wp.media['video-playlist'].shortcode( selection ).string() );
}, this );

File diff suppressed because one or more lines are too long

View File

@ -431,24 +431,35 @@ function wp_print_media_templates() {
</select>
</label>
<#
var playlist = 'playlist-edit' === data.controller.id, emptyModel = 'undefined' === typeof data.model.style;
#>
<label class="setting">
<span><?php _e( 'Show Tracklist' ); ?></span>
<input type="checkbox" data-setting="_tracklist" />
<input type="checkbox" data-setting="_tracklist" <# if ( playlist && emptyModel ) { #>
checked="checked"
<# } #> />
</label>
<label class="setting">
<span><?php _e( 'Show Track Numbers' ); ?></span>
<input type="checkbox" data-setting="_tracknumbers" />
<input type="checkbox" data-setting="_tracknumbers" <# if ( playlist && emptyModel ) { #>
checked="checked"
<# } #> />
</label>
<label class="setting">
<span><?php _e( 'Show Artist Name in Tracklist' ); ?></span>
<input type="checkbox" data-setting="_artists" />
<input type="checkbox" data-setting="_artists" <# if ( playlist && emptyModel ) { #>
checked="checked"
<# } #> />
</label>
<label class="setting">
<span><?php _e( 'Show Images' ); ?></span>
<input type="checkbox" data-setting="_images" />
<input type="checkbox" data-setting="_images" <# if ( emptyModel ) { #>
checked="checked"
<# } #> />
</label>
</script>