Make WordPress Core

Ticket #50523: moving_buttons_to_sidebar_3.diff

File moving_buttons_to_sidebar_3.diff, 6.1 KB (added by joedolson, 4 years ago)

Design patch from @nrqsnchz migrated from #47116

  • wp-admin/css/media.css

     
    914914}
    915915
    916916.imgedit-menu {
    917         min-width: 300px;
    918         margin: 0 0 12px;
    919917}
    920918
    921919.imgedit-menu .note-no-rotate {
     
    925923}
    926924
    927925.image-editor .imgedit-menu .button {
    928         float: left;
    929         width: 32px;
    930         height: 32px;
    931         margin: 0 8px 0 0;
    932         padding: 0;
    933         background: #f1f1f1;
     926        display: block;
     927        width: auto;
     928        height: 28px;
     929        line-height: 2;
     930        margin: 0 8px 8px 0;
     931        padding: 0 10px;
     932        background: #f7f7f7;
    934933        -webkit-font-smoothing: antialiased;
    935934        -moz-osx-font-smoothing: grayscale;
    936         line-height: 1.23076923;
    937         color: #72777c;
     935        color: #555;
    938936}
    939937
     938.imgedit-menu .button:first-of-type {
     939        margin-top: 10px;
     940}
     941
    940942.imgedit-menu .button:before {
    941         font: normal 20px/1 dashicons;
     943        font: normal 16px/1 dashicons;
     944        margin-right: 8px;
    942945        speak: none;
    943946        vertical-align: middle;
     947        position: relative;
     948        top: -2px;
    944949}
    945950
    946951.imgedit-menu .button.disabled {
  • wp-admin/includes/image-edit.php

     
    4949        <div id="imgedit-panel-<?php echo $post_id; ?>">
    5050
    5151        <div class="imgedit-settings">
     52                <div class="imgedit-group">
     53                        <div class="imgedit-group-top imgedit-menu">
     54                                <h2><?php _e( 'Editing Tools' ); ?></h2>
     55                                <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button>
     56                                <?php
     57
     58                                // On some setups GD library does not provide imagerotate() - Ticket #11536
     59                                if ( wp_image_editor_supports(
     60                                        array(
     61                                                'mime_type' => get_post_mime_type( $post_id ),
     62                                                'methods'   => array( 'rotate' ),
     63                                        )
     64                                ) ) {
     65                                        $note_no_rotate = '';
     66                                        ?>
     67                                        <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate counter-clockwise' ); ?></button>
     68                                        <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><?php esc_html_e( 'Rotate clockwise' ); ?></button>
     69                                        <?php
     70                                } else {
     71                                        $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>';
     72                                        ?>
     73                                        <button type="button" class="imgedit-rleft button disabled" disabled></button>
     74                                        <button type="button" class="imgedit-rright button disabled" disabled></button>
     75                                <?php } ?>
     76
     77                                <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><?php esc_html_e( 'Flip vertically' ); ?></button>
     78                                <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><?php esc_html_e( 'Flip horizontally' ); ?></button>
     79
     80                                <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><?php esc_html_e( 'Undo' ); ?></button>
     81                                <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><?php esc_html_e( 'Redo' ); ?></button>
     82                                <?php echo $note_no_rotate; ?>
     83
     84                        </div>
     85                </div>
    5286        <div class="imgedit-group">
    5387        <div class="imgedit-group-top">
    5488                <h2><?php _e( 'Scale Image' ); ?></h2>
     
    196230        <div class="imgedit-panel-content wp-clearfix">
    197231                <?php echo $note; ?>
    198232                <div class="imgedit-menu wp-clearfix">
    199                         <button type="button" onclick="imageEdit.handleCropToolClick( <?php echo "$post_id, '$nonce'"; ?>, this )" class="imgedit-crop button disabled" disabled><span class="screen-reader-text"><?php esc_html_e( 'Crop' ); ?></span></button>
    200                         <?php
    201 
    202                         // On some setups GD library does not provide imagerotate() - Ticket #11536
    203                         if ( wp_image_editor_supports(
    204                                 array(
    205                                         'mime_type' => get_post_mime_type( $post_id ),
    206                                         'methods'   => array( 'rotate' ),
    207                                 )
    208                         ) ) {
    209                                 $note_no_rotate = '';
    210                                 ?>
    211                                 <button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><span class="screen-reader-text"><?php esc_html_e( 'Rotate counter-clockwise' ); ?></span></button>
    212                                 <button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><span class="screen-reader-text"><?php esc_html_e( 'Rotate clockwise' ); ?></span></button>
    213                                 <?php
    214                         } else {
    215                                 $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>';
    216                                 ?>
    217                                 <button type="button" class="imgedit-rleft button disabled" disabled></button>
    218                                 <button type="button" class="imgedit-rright button disabled" disabled></button>
    219                         <?php } ?>
    220 
    221                         <button type="button" onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv button"><span class="screen-reader-text"><?php esc_html_e( 'Flip vertically' ); ?></span></button>
    222                         <button type="button" onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph button"><span class="screen-reader-text"><?php esc_html_e( 'Flip horizontally' ); ?></span></button>
    223 
    224                         <button type="button" id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo button disabled" disabled><span class="screen-reader-text"><?php esc_html_e( 'Undo' ); ?></span></button>
    225                         <button type="button" id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo button disabled" disabled><span class="screen-reader-text"><?php esc_html_e( 'Redo' ); ?></span></button>
    226                         <?php echo $note_no_rotate; ?>
     233                        test
    227234                </div>
    228235
    229236                <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" />