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.



git-svn-id: https://develop.svn.wordpress.org/trunk@27242 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-02-24 20:25:54 +00:00
parent 2a900a80a1
commit 5ead62b90c
2 changed files with 22 additions and 5 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 );

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>