In the Post/Select frames, for audio files:

* Show `artist` and `album` fields in the Attachment Details sidebar
* Sync their values on `change`

See #28839.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-07-11 21:02:15 +00:00
parent 59ffcf668b
commit ba688f4ff9
3 changed files with 15 additions and 2 deletions

View File

@ -4633,6 +4633,8 @@
this.model.on( 'change', this.render, this ); this.model.on( 'change', this.render, this );
this.model.on( 'change:title', this._syncTitle, this ); this.model.on( 'change:title', this._syncTitle, this );
this.model.on( 'change:caption', this._syncCaption, this ); this.model.on( 'change:caption', this._syncCaption, this );
this.model.on( 'change:artist', this._syncArtist, this );
this.model.on( 'change:album', this._syncAlbum, this );
this.model.on( 'change:percent', this.progress, this ); this.model.on( 'change:percent', this.progress, this );
// Update the selection. // Update the selection.

File diff suppressed because one or more lines are too long

View File

@ -522,6 +522,17 @@ function wp_print_media_templates() {
<span class="name"><?php _e('Title'); ?></span> <span class="name"><?php _e('Title'); ?></span>
<input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
</label> </label>
<# if ( 'audio' === data.type ) { #>
<?php foreach ( array(
'artist' => __( 'Artist' ),
'album' => __( 'Album' ),
) as $key => $label ) : ?>
<label class="setting" data-setting="<?php echo esc_attr( $key ) ?>">
<span class="name"><?php echo $label ?></span>
<input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" />
</label>
<?php endforeach; ?>
<# } #>
<label class="setting" data-setting="caption"> <label class="setting" data-setting="caption">
<span class="name"><?php _e('Caption'); ?></span> <span class="name"><?php _e('Caption'); ?></span>
<textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea>