Ticket #27320: 27320.diff
File 27320.diff, 6.0 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/media-audiovideo.js
207 207 208 208 defaults : { 209 209 id : wp.media.view.settings.post.id, 210 src 211 loop 210 src : '', 211 loop : false, 212 212 autoplay : false, 213 preload : 'none' 213 preload : 'none', 214 caption : '' 214 215 }, 215 216 216 217 edit : function (data) { … … 266 267 loop : false, 267 268 autoplay : false, 268 269 preload : 'metadata', 269 content : '' 270 content : '', 271 caption : '' 270 272 }, 271 273 272 274 edit : function (data) { -
src/wp-includes/js/media-editor.js
198 198 } 199 199 } 200 200 201 if ( ! _.isEmpty( attachment.caption ) ) { 202 shortcode.caption = attachment.caption; 203 } else if ( attachment.meta && attachment.meta.title ) { 204 shortcode.caption = '“' + attachment.meta.title + '”'; 205 if ( attachment.meta.album ) { 206 shortcode.caption += ' from ' + attachment.meta.album; 207 } 208 209 if ( attachment.meta.artist ) { 210 shortcode.caption += ' by ' + attachment.meta.artist; 211 } 212 } else if ( ! _.isEmpty( attachment.description ) ) { 213 shortcode.caption = attachment.description; 214 } else { 215 shortcode.caption = attachment.title; 216 } 217 201 218 extension = attachment.filename.split('.').pop(); 202 219 203 220 if ( _.contains( wp.media.view.settings.embedExts, extension ) ) { -
src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
281 281 margin: 2px 5px; 282 282 } 283 283 284 .wpview-type-audio .track-details { 285 position: absolute; 286 top: 0; 287 left: 5px; 288 width: 85%; 289 overflow: hidden; 290 white-space: nowrap; 291 text-overflow: ellipsis; 292 } 293 284 294 .wpview-type-audio .toolbar, 285 295 .wpview-type-video .toolbar, 286 296 .wpview-type-gallery.selected .toolbar { -
src/wp-includes/media-template.php
814 814 <div class="setting preload"> 815 815 <span><?php _e( 'Preload' ); ?></span> 816 816 <div class="button-group button-large" data-setting="preload"> 817 <button class="button" value="auto"><?php _ex( 'Auto', 'auto preload video' ); ?></button>817 <button class="button" value="auto"><?php _ex( 'Auto', 'auto preload audio' ); ?></button> 818 818 <button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button> 819 819 <button class="button active" value="none"><?php _e( 'None' ); ?></button> 820 820 </div> … … 829 829 <span><?php _e( 'Loop' ); ?></span> 830 830 <input type="checkbox" data-setting="loop" /> 831 831 </label> 832 833 <label class="setting"> 834 <span><?php _e( 'Caption' ); ?></span> 835 <input type="text" data-setting="caption" value="{{ data.model.caption }}" /> 836 </label> 837 832 838 <div class="clear"></div> 833 839 </div> 834 840 </div> … … 901 907 <div class="setting preload"> 902 908 <span><?php _e( 'Preload' ); ?></span> 903 909 <div class="button-group button-large" data-setting="preload"> 904 <button class="button" value="auto"><?php _e ( 'Auto' ); ?></button>910 <button class="button" value="auto"><?php _ex( 'Auto', 'auto preload video' ); ?></button> 905 911 <button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button> 906 912 <button class="button active" value="none"><?php _e( 'None' ); ?></button> 907 913 </div> … … 936 942 <# } #> 937 943 <textarea class="hidden content-setting">{{ content }}</textarea> 938 944 </label> 945 946 <label class="setting"> 947 <span><?php _e( 'Caption' ); ?></span> 948 <input type="text" data-setting="caption" value="{{ data.model.caption }}" /> 949 </label> 939 950 </div> 940 951 </div> 941 952 </script> … … 964 975 965 976 <script type="text/html" id="tmpl-editor-audio"> 966 977 <div class="toolbar"> 967 <div class="dashicons dashicons- format-audioedit"></div>978 <div class="dashicons dashicons-edit edit"></div> 968 979 <div class="dashicons dashicons-no-alt remove"></div> 969 980 </div> 981 <# if ( ! _.isEmpty( data.model.caption ) ) { #> 982 <div class="track-details">{{{ data.model.caption }}}</div> 983 <# } #> 970 984 <?php wp_underscore_audio_template() ?> 971 985 </script> 972 986 973 987 <script type="text/html" id="tmpl-editor-video"> 974 988 <div class="toolbar"> 975 <div class="dashicons dashicons- format-videoedit"></div>989 <div class="dashicons dashicons-edit edit"></div> 976 990 <div class="dashicons dashicons-no-alt remove"></div> 977 991 </div> 992 <# if ( ! _.isEmpty( data.model.caption ) ) { #> 993 <div class="track-details">{{{ data.model.caption }}}</div> 994 <# } #> 978 995 <?php wp_underscore_video_template() ?> 979 996 </script> 980 997 -
src/wp-includes/media.php
1390 1390 1391 1391 $default_types = wp_get_audio_extensions(); 1392 1392 $defaults_atts = array( 1393 'caption' => '', 1393 1394 'src' => '', 1394 1395 'loop' => '', 1395 1396 'autoplay' => '', … … 1549 1550 1550 1551 $default_types = wp_get_video_extensions(); 1551 1552 $defaults_atts = array( 1553 'caption' => '', 1552 1554 'src' => '', 1553 1555 'poster' => '', 1554 1556 'loop' => '', … … 2327 2329 $response['width'] = (int) $meta['width']; 2328 2330 if ( isset( $meta['height'] ) ) 2329 2331 $response['height'] = (int) $meta['height']; 2332 } elseif ( $meta && 'audio' === $type ) { 2333 $response['meta'] = array(); 2334 foreach ( array( 'title', 'artist', 'album' ) as $key ) { 2335 if ( ! empty( $meta[ $key ] ) ) { 2336 $response['meta'][ $key ] = $meta[ $key ]; 2337 } 2338 } 2330 2339 } 2331 2340 2332 2341 if ( $meta && ( 'audio' === $type || 'video' === $type ) ) {