Make WordPress Core


Ignore:
Timestamp:
03/22/2014 11:25:08 PM (11 years ago)
Author:
wonderboymusic
Message:

General code cleanup and improving video sizing in the admin:

  • Abstract the setting of a primary button and its callback in wp.media.view.MediaFrame.MediaDetails
  • Account for the existence or non-existence of $content_width in the TinyMCE views for video
  • Make sure video models always have dimensions, even if they are the defaults
  • For browsers that are not Firefox, don't use a timeout when setting the MediaElementPlayer instance in TinyMCE views

See #27320.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r27640 r27655  
    11981198    $default_height = 360;
    11991199
    1200     $theme_width = $content_width - $outer;
    1201     $theme_height = round( ( $default_height * $theme_width ) / $default_width );
     1200    $theme_width = empty( $content_width ) ? $default_width : ( $content_width - $outer );
     1201    $theme_height = empty( $content_width ) ? $default_height : round( ( $default_height * $theme_width ) / $default_width );
    12021202
    12031203    $data = compact( 'type', 'style' );
     
    15861586    } else {
    15871587        // if the video is bigger than the theme
    1588         if ( $width > $content_width ) {
     1588        if ( ! empty( $content_width ) && $width > $content_width ) {
    15891589            $height = round( ( $height * $content_width ) / $width );
    15901590            $width = $content_width;
     
    23822382        return;
    23832383
     2384    global $content_width;
     2385
    23842386    $defaults = array(
    23852387        'post' => null,
     
    24322434        'attachmentCounts' => wp_count_attachments(),
    24332435        'embedExts'    => $exts,
    2434         'embedMimes'   => $ext_mimes
     2436        'embedMimes'   => $ext_mimes,
     2437        'contentWidth' => $content_width,
    24352438    );
    24362439
Note: See TracChangeset for help on using the changeset viewer.