Make WordPress Core

Changeset 46354


Ignore:
Timestamp:
09/30/2019 04:33:39 PM (5 years ago)
Author:
antpb
Message:

Media: Prevents clipping of text when scaling image edit screen.

Props sabernhardt, audrasjb, afercia.
See #47115.

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/image-edit.js

    r43347 r46354  
    504504            // If a response is returned, close the editor and show an error.
    505505            if ( ret.error ) {
    506                 $('#imgedit-response-' + postid).html('<div class="error"><p>' + ret.error + '</p></div>');
     506                $('#imgedit-response-' + postid).html('<div class="error" role="alert"><p>' + ret.error + '</p></div>');
    507507                imageEdit.close(postid);
    508508                return;
     
    518518
    519519            if ( ret.msg ) {
    520                 $('#imgedit-response-' + postid).html('<div class="updated"><p>' + ret.msg + '</p></div>');
     520                $('#imgedit-response-' + postid).html('<div class="updated" role="alert"><p>' + ret.msg + '</p></div>');
    521521            }
    522522
  • trunk/src/js/media/views/frame/select.js

    r43309 r46354  
    6363     */
    6464    createStates: function() {
     65        console.log("test");
     66        this.on( 'content:render:edit-image', this.editState, this );
    6567        var options = this.options;
    6668
     
    7779                title:     options.title,
    7880                priority:  20
    79             })
     81            }),
     82                new wp.media.controller.EditImage( { model: this.options.editImage } ),
    8083        ]);
    8184    },
  • trunk/src/wp-admin/css/edit.css

    r46344 r46354  
    654654.edit-form-section {
    655655    margin-bottom: 20px;
     656}
     657
     658.wp_attachment_details .attachment-content-description {
     659    margin-top: 0.5385em;
     660    display: inline-block;
     661    min-height: 1.6923em;
    656662}
    657663
  • trunk/src/wp-admin/css/media.css

    r46344 r46354  
    801801}
    802802
     803.attachment-details .setting + .description a:focus {
     804        /* Only visible in Windows High Contrast mode */
     805        outline: 1px solid transparent;
     806}
     807
    803808.wp_attachment_details .attachment-alt-text-description {
    804809    margin-top: 5px;
     
    11151120}
    11161121
     1122.imgedit-settings .imgedit-original-dimensions {
     1123    display: inline-block;
     1124}
     1125
    11171126.imgedit-settings .imgedit-scale input[type="text"],
    11181127.imgedit-settings .imgedit-crop-ratio input[type="text"],
    11191128.imgedit-settings .imgedit-crop-sel input[type="text"] {
    1120     width: 50px;
     1129    width: 80px;
    11211130    font-size: 14px;
    11221131    padding: 5px 8px;
     
    11291138    font-size: 13px;
    11301139    color: #444;
     1140}
     1141
     1142.imgedit-settings .imgedit-scale-button-wrapper {
     1143    margin-top: 0.3077em;
     1144    display: block;
    11311145}
    11321146
  • trunk/src/wp-admin/includes/image-edit.php

    r46326 r46354  
    3939    if ( $msg ) {
    4040        if ( isset( $msg->error ) ) {
    41             $note = "<div class='error'><p>$msg->error</p></div>";
     41            $note = "<div class='error' tabindex='-1' role='alert'><p>$msg->error</p></div>";
    4242        } elseif ( isset( $msg->msg ) ) {
    43             $note = "<div class='updated'><p>$msg->msg</p></div>";
     43            $note = "<div class='updated' tabindex='-1' role='alert'><p>$msg->msg</p></div>";
    4444        }
    4545    }
     
    6363                /* translators: %s: Image width and height in pixels. */
    6464                __( 'Original dimensions %s' ),
    65                 $meta['width'] . ' &times; ' . $meta['height']
     65                '<span class="imgedit-original-dimensions">' . $meta['width'] . ' &times; ' . $meta['height'] . '</span>'
    6666            );
    6767            ?>
     
    7979        <input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
    8080        <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span>
    81         <input id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" />
     81        <div class="imgedit-scale-button-wrapper"><input id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" /></div>
    8282        </div>
    8383        </fieldset>
     
    236236
    237237        <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap">
    238         <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand( 1, 99999 ); ?>" alt="" />
     238        <img id="image-preview-<?php echo $post_id; ?>" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand( 1, 99999 ); ?>" alt="" />
    239239        </div>
    240240
  • trunk/src/wp-admin/includes/media.php

    r46288 r46354  
    32083208    ?>
    32093209
    3210     <label for="attachment_content"><strong><?php _e( 'Description' ); ?></strong>
     3210    <label for="attachment_content" class="attachment-content-description"><strong><?php _e( 'Description' ); ?></strong>
    32113211    <?php
    32123212
  • trunk/src/wp-includes/css/editor.css

    r45931 r46354  
    13231323        /* .button-small is normally 11px, but a bit too small for these buttons. */
    13241324        font-size: 12px;
    1325         height: 26px;
     1325        min-height: 26px;
    13261326        line-height: 2;
    13271327    }
Note: See TracChangeset for help on using the changeset viewer.