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: http://core.svn.wordpress.org/trunk@22603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-15 23:53:06 +00:00
parent 9f258e4342
commit b19d48e7fe
2 changed files with 4 additions and 7 deletions

View File

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

View File

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