Changeset 29456
- Timestamp:
- 08/09/2014 07:38:40 PM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/css/media-views.css
r29452 r29456 2682 2682 } 2683 2683 2684 .edit-attachment-frame .attachment-media-view img{2684 .edit-attachment-frame .attachment-media-view .details-image { 2685 2685 display: block; 2686 2686 margin-bottom: 16px; -
trunk/src/wp-includes/js/media-audiovideo.js
r29194 r29456 637 637 'click .remove-setting' : 'removeSetting', 638 638 'change .content-track' : 'setTracks', 639 'click .remove-track' : 'setTracks' 639 'click .remove-track' : 'setTracks', 640 'click .add-media-source' : 'addSource' 640 641 } ); 641 642 … … 681 682 this.model.set( 'content', tracks ); 682 683 this.trigger( 'media:setting:remove', this ); 684 }, 685 686 addSource : function( e ) { 687 this.controller.lastMime = $( e.currentTarget ).data( 'mime' ); 688 this.controller.setState( 'add-' + this.controller.defaults.id + '-source' ); 683 689 }, 684 690 … … 823 829 }); 824 830 825 /**826 * Event binding827 */828 function init() {829 $(document.body)830 .on( 'click', '.add-media-source', function( e ) {831 media.frame.lastMime = $( e.currentTarget ).data( 'mime' );832 media.frame.setState( 'add-' + media.frame.defaults.id + '-source' );833 } );834 }835 836 $( init );837 838 831 }(jQuery, _, Backbone)); -
trunk/src/wp-includes/js/mediaelement/wp-mediaelement.css
r29179 r29456 91 91 float: none; 92 92 margin: 0 0 10px; 93 } 94 95 .wp-video { 96 max-width: 100%; 97 height: auto; 93 98 } 94 99 -
trunk/src/wp-includes/media-template.php
r29436 r29456 51 51 $video_types = wp_get_video_extensions(); 52 52 ?> 53 <# var w_rule = '', h_rule = '',53 <# var w_rule = '', 54 54 w, h, settings = wp.media.view.settings, 55 55 isYouTube = ! _.isEmpty( data.model.src ) && data.model.src.match(/youtube|youtu\.be/); … … 70 70 w_rule = ' width: ' + w + 'px;'; 71 71 } 72 73 if ( h ) {74 h_rule = ' height: auto';75 }76 72 #> 77 <div style=" max-width: 100%;{{ w_rule }}{{ h_rule }}">73 <div style="{{ w_rule }}" class="wp-video"> 78 74 <video controls 79 75 class="wp-video-shortcode{{ isYouTube ? ' youtube-video' : '' }}" … … 279 275 <div class="media-progress-bar"><div></div></div> 280 276 <# } else if ( 'image' === data.type ) { #> 281 <img src="{{ data.sizes.full.url }}" draggable="false" />277 <img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" /> 282 278 <# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #> 283 <img src="{{ data.icon }}" class="icon" draggable="false" />279 <img class="details-image" src="{{ data.icon }}" class="icon" draggable="false" /> 284 280 <# } #> 285 281 … … 291 287 </div> 292 288 <# } else if ( 'video' === data.type ) { 293 var w_rule = h_rule ='';289 var w_rule = ''; 294 290 if ( data.width ) { 295 w_rule = ' 291 w_rule = 'width: ' + data.width + 'px;'; 296 292 } else if ( wp.media.view.settings.contentWidth ) { 297 w_rule = ' width: ' + wp.media.view.settings.contentWidth + 'px;'; 298 } 299 if ( data.height ) { 300 h_rule = ' height: auto'; 293 w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;'; 301 294 } 302 295 #> 303 <div style=" max-width: 100%; {{ w_rule }}{{ h_rule }}" class="wp-media-wrapper">304 <video controls class="wp-video-shortcode" preload="metadata"296 <div style="{{ w_rule }}" class="wp-media-wrapper wp-video"> 297 <video controls="controls" class="wp-video-shortcode" preload="metadata" 305 298 <# if ( data.width ) { #>width="{{ data.width }}"<# } #> 306 299 <# if ( data.height ) { #>height="{{ data.height }}"<# } #> -
trunk/src/wp-includes/media.php
r29455 r29456 1875 1875 $html .= '</video>'; 1876 1876 1877 $width_rule = $height_rule ='';1877 $width_rule = ''; 1878 1878 if ( ! empty( $atts['width'] ) ) { 1879 1879 $width_rule = sprintf( ' width: %dpx;', $atts['width'] ); 1880 1880 } 1881 if ( ! empty( $atts['height'] ) ) { 1882 $height_rule = sprintf( ' height: %dpx;', $atts['height'] ); 1883 } else { 1884 $height_rule = ' height: auto;'; 1885 } 1886 $output = sprintf( '<div style="max-width: 100%%;%s%s" class="wp-video">%s</div>', $width_rule, $height_rule, $html ); 1881 $output = sprintf( '<div style="%s" class="wp-video">%s</div>', $width_rule, $html ); 1887 1882 1888 1883 /**
Note: See TracChangeset
for help on using the changeset viewer.