Media: Update in-grid captions.

* Use input fields instead of textboxes (which provide better handling for smaller attachments).
* Provide `data-setting` properties to properly sync the changes.

see #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-11-15 23:53:06 +00:00
parent c20cd04a7b
commit ee694739ec
2 changed files with 4 additions and 7 deletions

View File

@ -603,7 +603,6 @@
position: relative;
display: block;
width: 100%;
height: 50px;
margin: -1px 0 0;
padding: 8px;
font-size: 12px;

View File

@ -1447,19 +1447,17 @@ function wp_print_media_templates( $attachment ) {
</div>
<# if ( data.describe ) { #>
<# if ( 'image' === data.type ) { #>
<textarea class="describe"
placeholder="<?php esc_attr_e('Describe this image&hellip;'); ?>"
>{{ data.caption }}</textarea>
<input type="text" value="{{ data.caption }}" class="describe" data-setting="caption"
placeholder="<?php esc_attr_e('Describe this image&hellip;'); ?>" />
<# } else { #>
<textarea class="describe"
<input type="text" value="{{ data.title }}" class="describe" data-setting="title"
<# if ( 'video' === data.type ) { #>
placeholder="<?php esc_attr_e('Describe this video&hellip;'); ?>"
<# } else if ( 'audio' === data.type ) { #>
placeholder="<?php esc_attr_e('Describe this audio file&hellip;'); ?>"
<# } else { #>
placeholder="<?php esc_attr_e('Describe this media file&hellip;'); ?>"
<# } #>
>{{ data.title }}</textarea>
<# } #> />
<# } #>
<# } #>
</script>