Make WordPress Core

Ticket #23992: 23992.6.diff

File 23992.6.diff, 3.1 KB (added by wonderboymusic, 11 years ago)
  • wp-admin/edit-form-advanced.php

    diff --git wp-admin/edit-form-advanced.php wp-admin/edit-form-advanced.php
    index 801072a..30fce33 100644
    if ( post_type_supports($post_type, 'editor') ) { 
    460460?>
    461461<div id="postdivrich" class="postarea edit-form-section">
    462462
    463 <?php wp_editor($post->post_content, 'content', array('dfw' => true, 'tabfocus_elements' => 'insert-media-button,save-post', 'editor_height' => 360) ); ?>
    464 
     463<?php wp_editor( $post->post_content, 'content', array(
     464        'dfw' => true,
     465        'tabfocus_elements' => 'insert-media-button,save-post',
     466        'editor_height' => in_array( $post_format, array( 'status', 'aside' ) ) ? 120 : 360
     467) ); ?>
    465468<table id="post-status-info" cellspacing="0"><tbody><tr>
    466469        <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
    467470        <td class="autosave-info">
  • wp-admin/js/post-formats.js

    diff --git wp-admin/js/post-formats.js wp-admin/js/post-formats.js
    index 33f2e96..f135dc1 100644
     
    11window.wp = window.wp || {};
    22
    33(function($) {
    4         var container, mediaFrame, lastMimeType, mediaPreview, lastHeight, content,
    5                 $container = $( '.post-formats-fields' ),
     4        var container, $container, mediaFrame, lastMimeType, mediaPreview, lastHeight = 360, content,
     5                initialFormat = 'standard',
    66                shortClass = 'short-format',
    77                shortContentFormats = ['status', 'aside'],
    88                noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery'],
    window.wp = window.wp || {}; 
    1616                $screenIcon.addClass('wp-format-' + format);
    1717        }
    1818
    19         function resizeContent( shorter ) {
    20                 content = content || $('#content, #content_ifr');
    21                 if ( shorter ) {
     19        function resizeContent( format, noAnimate ) {
     20                var height;
     21
     22                content = $('#content, #content_ifr');
     23
     24                height = content.height();
     25                if ( 120 < height ) {
     26                        lastHeight = height;
     27                }
     28
     29                if ( -1 < $.inArray( format, shortContentFormats ) ) {
    2230                        if ( ! content.hasClass(shortClass) ) {
    23                                 lastHeight = content.height();
    24                                 content.addClass(shortClass).animate({ height : 120 });
     31                                content.addClass(shortClass);
     32                                if ( noAnimate ) {
     33                                        content.each(function () {
     34                                                $(this).css({ height : 120 });
     35                                        });
     36                                } else {
     37                                        content.each(function () {
     38                                                $(this).animate({ height : 120 });
     39                                        });
     40                                }
    2541                        }
    26                 } else if ( lastHeight ) {
     42                } else {
    2743                        content.removeClass(shortClass).animate({ height : lastHeight });
    2844                }
    2945        }
    window.wp = window.wp || {}; 
    5369                        });
    5470                }
    5571
    56                 resizeContent( -1 < $.inArray( format, shortContentFormats ) );
     72                resizeContent( format );
    5773
    5874                postTitle.focus();
    5975
    window.wp = window.wp || {}; 
    7995                postFormats.currentPostFormat = format;
    8096        }
    8197
    82         $(function(){
     98        $(function() {
     99                $container = $( '.post-formats-fields' );
     100
     101                initialFormat = $( '.post-format-options .active' ).data( 'wp-format' );
     102                if ( -1 < $.inArray( initialFormat, shortContentFormats ) ) {
     103                        resizeContent( initialFormat, true );
     104                }
    83105
    84106                $('.post-format-change a').click(function() {
    85107                        $('.post-formats-fields, .post-format-change').slideUp();