Ticket #28864: 28864.7.patch
File 28864.7.patch, 28.7 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/common.css
267 267 a:focus, 268 268 a:focus .media-icon img { 269 269 color: #124964; 270 271 270 -webkit-box-shadow: 271 0 0 0 1px #5b9dd9, 272 272 0 0 2px 1px rgba(30, 140, 190, .8); 273 274 273 box-shadow: 274 0 0 0 1px #5b9dd9, 275 275 0 0 2px 1px rgba(30, 140, 190, .8); 276 276 } 277 277 … … 1659 1659 } 1660 1660 1661 1661 .screen-options + .screen-options { 1662 1662 margin-top: 10px; 1663 1663 } 1664 1664 1665 1665 .metabox-prefs .submit { … … 2061 2061 } 2062 2062 2063 2063 /* contain floats */ 2064 .wp-clearfix:after, 2064 2065 .nav-tab-wrapper:after { 2065 2066 content: ""; 2066 2067 display: table; … … 2934 2935 2935 2936 .js .postbox .handlediv:focus .toggle-indicator:before { 2936 2937 -webkit-box-shadow: 2937 2938 0 0 0 1px #5b9dd9, 2938 2939 0 0 2px 1px rgba(30, 140, 190, .8); 2939 2940 2940 box-shadow: 2941 0 0 0 1px #5b9dd9, 2941 2942 0 0 2px 1px rgba(30, 140, 190, .8); 2942 2943 } 2943 2944 -
src/wp-admin/css/media.css
640 640 .edit-attachment-frame .edit-media-header .left, 641 641 .edit-attachment-frame .edit-media-header .right { 642 642 cursor: pointer; 643 color: #7 77;643 color: #72777c; 644 644 background-color: transparent; 645 645 height: 50px; 646 646 width: 50px; … … 650 650 border: 0; 651 651 border-left: 1px solid #ddd; 652 652 -webkit-transition: color .1s ease-in-out, background .1s ease-in-out; 653 653 transition: color .1s ease-in-out, background .1s ease-in-out; 654 654 } 655 655 656 656 .upload-php .media-modal-close { … … 837 837 838 838 .imgedit-wrap { 839 839 position: relative; 840 padding-top: 10px; 840 841 } 841 842 842 843 .imgedit-settings p { 843 margin: 8px 0 0;844 margin: 8px 0; 844 845 } 845 846 847 .imgedit-settings fieldset { 848 margin: 8px 0; 849 } 850 851 .imgedit-settings legend { 852 margin-bottom: 5px; 853 } 854 846 855 .describe .imgedit-wrap .imgedit-settings { 847 856 padding: 0 5px; 848 857 } … … 853 862 854 863 .wp_attachment_holder .imgedit-wrap > div { 855 864 height: auto; 856 overflow: hidden;857 865 } 858 866 859 867 .wp_attachment_holder .imgedit-wrap .imgedit-panel-content { 860 padding-right: 16px; 861 width: auto; 862 overflow: hidden; 868 padding: 3px 16px 0 0; 869 float: left; 863 870 } 864 871 865 872 .wp_attachment_holder .imgedit-wrap .imgedit-settings { … … 874 881 875 882 .imgedit-wait { 876 883 position: absolute; 877 top: 0;884 top: 10px; 878 885 background: #fff url(../images/spinner.gif) no-repeat center; 879 886 -webkit-background-size: 20px 20px; 880 887 background-size: 20px 20px; … … 899 906 overflow: hidden; 900 907 } 901 908 909 .imgedit-response + .wp_attachment_image { 910 overflow: visible; 911 } 912 902 913 .wp_attachment_image .button, 903 914 .A1B1 .button { 904 915 float: left; … … 914 925 } 915 926 916 927 .imgedit-menu { 928 min-width: 300px; 917 929 margin: 0 0 12px; 918 min-width: 300px;930 padding-left: 3px; 919 931 } 920 932 921 .imgedit-menu div { 933 .imgedit-menu .note-no-rotate { 934 clear: both; 935 margin: 0; 936 padding: 1em 0 0; 937 } 938 939 .image-editor .imgedit-menu .button { 922 940 float: left; 923 941 width: 32px; 924 border: 1px solid #d5d5d5; 942 height: 32px; 943 margin: 0 8px 0 0; 944 padding: 0; 925 945 background: #f1f1f1; 926 margin: 0 8px 0 0;927 height: 32px;928 946 -webkit-font-smoothing: antialiased; 929 947 -moz-osx-font-smoothing: grayscale; 930 text-align: center; 931 line-height: 28px; 932 color: #777; 933 cursor: pointer; 948 line-height: 16px; 949 color: #72777c; 934 950 } 935 951 936 .imgedit-menu div:before {952 .imgedit-menu .button:before { 937 953 font: normal 20px/1 dashicons; 938 954 speak: none; 939 955 vertical-align: middle; 940 956 } 941 957 942 .imgedit-menu div:hover { 943 border-color: #c1c1c1; 944 background-color: #eaeaea; 945 color: #32373c; 946 } 947 948 .imgedit-menu div.disabled { 958 .imgedit-menu .button.disabled { 949 959 border-color: #ccc; 950 960 background-color: #ddd; 951 color: #7 77;961 color: #72777c; 952 962 filter: alpha(opacity=50); 953 963 opacity: 0.5; 954 964 cursor: default; … … 1020 1030 1021 1031 #poststuff .imgedit-group-top h3, /* Back-compat for pre-4.4 */ 1022 1032 #poststuff .imgedit-group-top h2 { 1033 display: inline-block; 1023 1034 margin: 0; 1024 1035 padding: 0; 1025 1036 font-size: 14px; … … 1032 1043 } 1033 1044 1034 1045 .imgedit-applyto .imgedit-label { 1035 padding: 2px 0 0;1036 1046 display: block; 1047 padding: .5em 0 0; 1037 1048 } 1038 1049 1039 1050 .imgedit-help { … … 1041 1052 font-style: italic; 1042 1053 } 1043 1054 1044 a.imgedit-help-toggle { 1045 text-decoration: none; 1055 /* higher specificity than buttons */ 1056 .image-editor .imgedit-settings .imgedit-help-toggle, 1057 .image-editor .imgedit-settings .imgedit-help-toggle:hover, 1058 .image-editor .imgedit-settings .imgedit-help-toggle:active { 1059 border: 1px solid transparent; 1060 margin: -1px 0 0 -1px; 1061 padding: 0; 1062 background: transparent; 1063 color: #0074a2; 1064 font-size: 20px; 1065 line-height: 1; 1066 cursor: pointer; 1067 -webkit-box-sizing: content-box; 1068 -moz-box-sizing: content-box; 1069 box-sizing: content-box; 1070 -webkit-box-shadow: none; 1071 box-shadow: none; 1046 1072 } 1047 1073 1074 .image-editor .imgedit-settings .imgedit-help-toggle:focus { 1075 color: #0074a2; 1076 border-color: #5b9dd9; 1077 outline: none; 1078 -webkit-box-shadow: 0 0 3px rgba( 0, 115, 170, .8 ); 1079 box-shadow: 0 0 3px rgba( 0, 115, 170, .8 ); 1080 } 1081 1048 1082 .form-table td.imgedit-response { 1049 1083 padding: 0; 1050 1084 } … … 1059 1093 1060 1094 .imgedit-wrap .nowrap { 1061 1095 white-space: nowrap; 1096 font-size: 12px; 1097 line-height: inherit; 1062 1098 } 1063 1099 1064 1100 span.imgedit-scale-warn { … … 1069 1105 vertical-align: middle; 1070 1106 } 1071 1107 1108 .imgedit-save-target { 1109 margin: 8px 0; 1110 } 1111 1072 1112 .imgedit-group { 1073 1113 margin-bottom: 8px; 1074 1114 padding: 10px; 1075 1115 } 1076 1116 1117 .imgedit-settings .imgedit-scale input[type="text"], 1118 .imgedit-settings .imgedit-crop-ratio input[type="text"], 1119 .imgedit-settings .imgedit-crop-sel input[type="text"] { 1120 width: 3.57142857em; 1121 font-size: 14px; 1122 padding: 3px 5px; 1123 } 1124 1125 .imgedit-separator { 1126 display: inline-block; 1127 width: 0.53846153em; 1128 text-align: center; 1129 vertical-align: middle; 1130 font-size: 13px; 1131 color: #444; 1132 } 1133 1134 .imgedit-settings .imgedit-scale .button { 1135 margin-bottom: 0; 1136 } 1137 1077 1138 audio, video { 1078 1139 display: inline-block; 1079 1140 max-width: 100%; … … 1117 1178 .media-upload-form .media-item .error { 1118 1179 padding: 10px 0 10px 12px; 1119 1180 } 1181 1182 .imgedit-settings .imgedit-scale input[type="text"], 1183 .imgedit-settings .imgedit-crop-ratio input[type="text"], 1184 .imgedit-settings .imgedit-crop-sel input[type="text"] { 1185 width: 3.75em; 1186 font-size: 16px; 1187 padding: 6px 10px; 1188 } 1189 1190 .imgedit-applyto .imgedit-label { 1191 vertical-align: middle; 1192 } 1120 1193 } 1121 1194 1122 1195 /** -
src/wp-admin/includes/image-edit.php
40 40 } 41 41 42 42 ?> 43 <div class="imgedit-wrap" >43 <div class="imgedit-wrap" class="wp-clearfix"> 44 44 <div id="imgedit-panel-<?php echo $post_id; ?>"> 45 45 46 46 <div class="imgedit-settings"> 47 47 <div class="imgedit-group"> 48 48 <div class="imgedit-group-top"> 49 <h2><?php _e( 'Scale Image' ); ?> <a href="#" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;"></a></h2> 49 <h2><?php _e( 'Scale Image' ); ?></h2> 50 <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Scale Image Help' ); ?></span></button> 50 51 <div class="imgedit-help"> 51 52 <p><?php _e('You can proportionally scale the original image. For best results, scaling should be done before you crop, flip, or rotate. Images can only be scaled down, not up.'); ?></p> 52 53 </div> … … 54 55 <p><?php printf( __('Original dimensions %s'), $meta['width'] . ' × ' . $meta['height'] ); ?></p> 55 56 <?php endif ?> 56 57 <div class="imgedit-submit"> 57 <span class="nowrap"><input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" style="width:4em;" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> × <input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" style="width:4em;" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> 58 <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span></span> 59 <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" /> 58 59 <fieldset class="imgedit-scale"> 60 <legend><?php _e( 'New dimensions:' ); ?></legend> 61 <div class="nowrap"> 62 <label><span class="screen-reader-text"><?php _e( 'scale width' ); ?></span> 63 <input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> 64 </label> 65 <span class="imgedit-separator">×</span> 66 <label><span class="screen-reader-text"><?php _e( 'scale height' ); ?></span> 67 <input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> 68 </label> 69 <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span> 70 <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' ); ?>" /> 71 </div> 72 </fieldset> 73 60 74 </div> 61 75 </div> 62 76 </div> … … 65 79 66 80 <div class="imgedit-group"> 67 81 <div class="imgedit-group-top"> 68 <h2>< a onclick="imageEdit.toggleHelp(this);return false;" href="#"><?php _e('Restore Original Image'); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></a></h2>82 <h2><button type="button" onclick="imageEdit.toggleHelp(this);" class="button-link"><?php _e( 'Restore Original Image' ); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></button></h2> 69 83 <div class="imgedit-help"> 70 84 <p><?php _e('Discard any changes and restore the original image.'); 71 85 … … 84 98 85 99 <div class="imgedit-group"> 86 100 <div class="imgedit-group-top"> 87 <h2><?php _e( 'Image Crop' ); ?> <a href="#" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;"></a></h2> 101 <h2><?php _e( 'Image Crop' ); ?></h2> 102 <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Image Crop Help' ); ?></span></button> 88 103 89 104 <div class="imgedit-help"> 90 105 <p><?php _e('To crop the image, click on it and drag to make your selection.'); ?></p> … … 97 112 </div> 98 113 </div> 99 114 100 <p> 101 <?php _e('Aspect ratio:'); ?> 102 <span class="nowrap"> 103 <input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" style="width:3em;" /> 104 : 105 <input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" style="width:3em;" /> 106 </span> 107 </p> 115 <fieldset class="imgedit-crop-ratio"> 116 <legend><?php _e( 'Aspect ratio:' ); ?></legend> 117 <div class="nowrap"> 118 <label><span class="screen-reader-text"><?php _e( 'crop ratio width' ); ?></span> 119 <input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" /> 120 </label> 121 <span class="imgedit-separator">:</span> 122 <label><span class="screen-reader-text"><?php _e( 'crop ratio height' ); ?></span> 123 <input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" /> 124 </label> 125 </div> 126 </fieldset> 108 127 109 <p id="imgedit-crop-sel-<?php echo $post_id; ?>"> 110 <?php _e('Selection:'); ?> 111 <span class="nowrap"> 112 <input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>)" style="width:4em;" /> 113 × 114 <input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>)" style="width:4em;" /> 115 </span> 116 </p> 128 <fieldset id="imgedit-crop-sel-<?php echo $post_id; ?>" class="imgedit-crop-sel"> 129 <legend><?php _e( 'Selection:' ); ?></legend> 130 <div class="nowrap"> 131 <label><span class="screen-reader-text"><?php _e( 'selection width' ); ?></span> 132 <input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>)" /> 133 </label> 134 <span class="imgedit-separator">×</span> 135 <label><span class="screen-reader-text"><?php _e( 'selection height' ); ?></span> 136 <input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>)" /> 137 </label> 138 </div> 139 </fieldset> 140 117 141 </div> 118 142 119 143 <?php if ( $thumb && $sub_sizes ) { … … 122 146 123 147 <div class="imgedit-group imgedit-applyto"> 124 148 <div class="imgedit-group-top"> 125 <h2><?php _e( 'Thumbnail Settings' ); ?> <a href="#" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;"></a></h2> 149 <h2><?php _e( 'Thumbnail Settings' ); ?></h2> 150 <button type="button" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" aria-expanded="false"><span class="screen-reader-text"><?php esc_html_e( 'Thumbnail Settings Help' ); ?></span></button> 126 151 <p class="imgedit-help"><?php _e('You can edit the image while preserving the thumbnail. For example, you may wish to have a square thumbnail that displays just a section of the image.'); ?></p> 127 152 </div> 128 153 … … 131 156 <br /><?php _e('Current thumbnail'); ?> 132 157 </p> 133 158 134 <p id="imgedit-save-target-<?php echo $post_id; ?>"> 135 <strong><?php _e('Apply changes to:'); ?></strong><br /> 159 <div id="imgedit-save-target-<?php echo $post_id; ?>" class="imgedit-save-target"> 160 <fieldset> 161 <legend><strong><?php _e( 'Apply changes to:' ); ?></strong></legend> 136 162 137 163 <label class="imgedit-label"> 138 164 <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="all" checked="checked" /> … … 145 171 <label class="imgedit-label"> 146 172 <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" /> 147 173 <?php _e('All sizes except thumbnail'); ?></label> 148 </ p>174 </fieldset> 149 175 </div> 176 </div> 150 177 151 178 <?php } ?> 152 179 153 180 </div> 154 181 155 <div class="imgedit-panel-content ">182 <div class="imgedit-panel-content wp-clearfix"> 156 183 <?php echo $note; ?> 157 <div class="imgedit-menu ">158 < div onclick="imageEdit.crop(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-crop disabled" title="<?php esc_attr_e( 'Crop' ); ?>"></div><?php184 <div class="imgedit-menu wp-clearfix"> 185 <button type="button" onclick="imageEdit.crop(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-crop button disabled" disabled><span class="screen-reader-text"><?php esc_html_e( 'Crop' ); ?></span></button><?php 159 186 160 187 // On some setups GD library does not provide imagerotate() - Ticket #11536 161 if ( wp_image_editor_supports( array( 'mime_type' => get_post_mime_type( $post_id ), 'methods' => array( 'rotate' ) ) ) ) { ?> 162 <div class="imgedit-rleft" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate counter-clockwise' ); ?>"></div> 163 <div class="imgedit-rright" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div> 188 if ( wp_image_editor_supports( array( 'mime_type' => get_post_mime_type( $post_id ), 'methods' => array( 'rotate' ) ) ) ) { 189 $note_no_rotate = ''; 190 ?> 191 <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> 192 <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> 164 193 <?php } else { 165 $note_no_rotate = esc_attr__('Image rotation is not supported by your web host.');194 $note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>'; 166 195 ?> 167 <div class="imgedit-rleft disabled" title="<?php echo $note_no_rotate; ?>"></div>168 <div class="imgedit-rright disabled" title="<?php echo $note_no_rotate; ?>"></div>196 <button type="button" class="imgedit-rleft button disabled" disabled></button> 197 <button type="button" class="imgedit-rright button disabled" disabled></button> 169 198 <?php } ?> 170 199 171 < div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv" title="<?php esc_attr_e( 'Flip vertically' ); ?>"></div>172 < div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph" title="<?php esc_attr_e( 'Flip horizontally' ); ?>"></div>200 <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> 201 <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> 173 202 174 < div id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo disabled" title="<?php esc_attr_e( 'Undo' ); ?>"></div>175 < div id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo disabled" title="<?php esc_attr_e( 'Redo' ); ?>"></div>176 < br class="clear" />203 <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> 204 <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> 205 <?php echo $note_no_rotate; ?> 177 206 </div> 178 207 179 208 <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" /> … … 184 213 <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> 185 214 186 215 <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> 187 <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&_ajax_nonce=<?php echo $nonce; ?>&postid=<?php echo $post_id; ?>&rand=<?php echo rand(1, 99999); ?>" alt=" <?php esc_attr_e( 'Image preview' ); ?>" />216 <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&_ajax_nonce=<?php echo $nonce; ?>&postid=<?php echo $post_id; ?>&rand=<?php echo rand(1, 99999); ?>" alt="" /> 188 217 </div> 189 218 190 219 <div class="imgedit-submit"> 191 <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button " value="<?php esc_attr_e( 'Cancel' ); ?>" />220 <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button imgedit-cancel-btn" value="<?php esc_attr_e( 'Cancel' ); ?>" /> 192 221 <input type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button button-primary imgedit-submit-btn" value="<?php esc_attr_e( 'Save' ); ?>" /> 193 222 </div> 194 223 </div> … … 562 591 563 592 $img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) ); 564 593 565 if ( is_wp_error( $img ) ) 566 return false; 594 if ( is_wp_error( $img ) ) { 595 return false; 596 } 567 597 568 598 $changes = !empty($_REQUEST['history']) ? json_decode( wp_unslash($_REQUEST['history']) ) : null; 569 599 if ( $changes ) -
src/wp-admin/includes/media.php
2701 2701 $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); 2702 2702 2703 2703 $att_url = wp_get_attachment_url( $post->ID ); ?> 2704 <div class="wp_attachment_holder ">2704 <div class="wp_attachment_holder wp-clearfix"> 2705 2705 <?php 2706 2706 if ( wp_attachment_is_image( $post->ID ) ) : 2707 2707 $image_edit_button = ''; … … 2713 2713 2714 2714 <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div> 2715 2715 2716 <div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image " id="media-head-<?php echo $attachment_id; ?>">2716 <div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>"> 2717 2717 <p id="thumbnail-head-<?php echo $attachment_id; ?>"><img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" /></p> 2718 2718 <p><?php echo $image_edit_button; ?></p> 2719 2719 </div> -
src/wp-admin/js/image-edit.js
11 11 return f | 0; 12 12 }, 13 13 14 setDisabled : function(el, s) { 14 setDisabled : function( el, s ) { 15 /* 16 * Disabled state on inputs #imgedit-sel-width-' + postid and #imgedit-sel-height-' + postid 17 * was done targeting $('input', el). After #28864 we need to handle disabled state on buttons 18 * too and all inputs can be handled by the disabled state on their fieldset $( el ). 19 */ 15 20 if ( s ) { 16 el.removeClass( 'disabled');17 $( 'input', el).removeAttr('disabled');21 el.removeClass( 'disabled' ); 22 $( el ).prop( 'disabled', false ); 18 23 } else { 19 el.addClass( 'disabled');20 $( 'input', el).prop('disabled', true);24 el.addClass( 'disabled' ); 25 $( el ).prop( 'disabled', true ); 21 26 } 22 27 }, 23 28 … … 56 61 var wait = $('#imgedit-wait-' + postid); 57 62 58 63 if ( toggle ) { 59 wait. height( $('#imgedit-panel-' + postid).height() ).fadeIn('fast');64 wait.innerHeight( $( '#imgedit-panel-' + postid ).height() ).fadeIn( 'fast' ); 60 65 } else { 61 66 wait.fadeOut('fast'); 62 67 } … … 63 68 }, 64 69 65 70 toggleHelp : function(el) { 66 $( el ).parents( '.imgedit-group-top' ).toggleClass( 'imgedit-help-toggled' ).find( '.imgedit-help' ).slideToggle( 'fast' ); 71 var $el = $( el ); 72 $el.parents( '.imgedit-group-top' ).toggleClass( 'imgedit-help-toggled' ).find( '.imgedit-help' ).slideToggle( 'fast' ); 73 $el.attr( 'aria-expanded', 'false' === $el.attr( 'aria-expanded' ) ? 'true' : 'false' ); 67 74 return false; 68 75 }, 69 76 … … 166 173 }; 167 174 168 175 img = $( '<img id="image-preview-' + postid + '" alt="" />' ) 169 .on( 'load', function() {170 var max1, max2, parent = $( '#imgedit-crop-' + postid), t = imageEdit;176 .on( 'load', { history: data.history }, function( event ) { 177 var max1, max2, parent = $( '#imgedit-crop-' + postid ), t = imageEdit, historyObj; 171 178 179 if ( '' !== event.data.history ) { 180 historyObj = JSON.parse( event.data.history ); 181 // If last executed action in history is a crop action. 182 if ( historyObj[historyObj.length - 1].hasOwnProperty( 'c' ) ) { 183 /* 184 * A crop action has completed and the crop button gets disabled 185 * ensure the undo button is enabled. 186 */ 187 t.setDisabled( $( '#image-undo-' + postid) , true ); 188 // Move focus to the undo button to avoid a focus loss. 189 $( '#image-undo-' + postid ).focus(); 190 } 191 } 192 172 193 parent.empty().append(img); 173 194 174 195 // w, h are the new full size dims … … 337 358 this.initCrop(postid, img, parent); 338 359 this.setCropSelection(postid, 0); 339 360 this.toggleEditor(postid, 0); 361 // Editor is ready, move focus to the first focusable element. 362 $( '.imgedit-wrap .imgedit-help-toggle' ).eq( 0 ).focus(); 340 363 }, 341 364 342 365 initCrop : function(postid, image, parent) { … … 453 476 454 477 addStep : function(op, postid, nonce) { 455 478 var t = this, elem = $('#imgedit-history-' + postid), 456 history = ( elem.val() !== '' ) ? JSON.parse( elem.val() ) : [],457 undone = $('#imgedit-undone-' + postid),458 pop = t.intval(undone.val());479 history = ( elem.val() !== '' ) ? JSON.parse( elem.val() ) : [], 480 undone = $( '#imgedit-undone-' + postid ), 481 pop = t.intval( undone.val() ); 459 482 460 483 while ( pop > 0 ) { 461 484 history.pop(); … … 516 539 elem.val(pop); 517 540 t.refreshEditor(postid, nonce, function() { 518 541 var elem = $('#imgedit-history-' + postid), 519 history = ( elem.val() !== '' ) ? JSON.parse( elem.val() ) : [];542 history = ( elem.val() !== '' ) ? JSON.parse( elem.val() ) : []; 520 543 521 544 t.setDisabled($('#image-redo-' + postid), true); 522 545 t.setDisabled(button, pop < history.length); 546 // When undo gets disabled, move focus to the redo button to avoid a focus loss. 547 if ( pop === history.length ) { 548 $( '#image-redo-' + postid ).focus(); 549 } 523 550 }); 524 551 }, 525 552 … … 535 562 t.refreshEditor(postid, nonce, function() { 536 563 t.setDisabled($('#image-undo-' + postid), true); 537 564 t.setDisabled(button, pop > 0); 565 // When redo gets disabled, move focus to the undo button to avoid a focus loss. 566 if ( 0 === pop ) { 567 $( '#image-undo-' + postid ).focus(); 568 } 538 569 }); 539 570 }, 540 571 -
src/wp-includes/css/media-views.css
22 22 -webkit-overflow-scrolling: touch; 23 23 } 24 24 25 .media-modal legend, 26 .media-modal label { 27 font-size: 13px; 28 } 29 25 30 .media-frame input, 26 31 .media-frame textarea { 27 32 padding: 6px 8px; … … 110 115 } 111 116 112 117 .media-frame :-moz-placeholder { 113 118 color: #a9a9a9; 114 119 } 115 120 116 121 .media-frame .hidden { … … 394 399 color: #666; 395 400 } 396 401 397 .compat-item label span 402 .compat-item label span { 398 403 text-align: right; 399 404 } 400 405 … … 422 427 margin: 1px; 423 428 width: 65%; 424 429 float: right; 430 line-height: 1.35714285; 425 431 } 426 432 427 433 .media-sidebar .setting .value, … … 1741 1747 .media-modal .imgedit-wrap .imgedit-settings { 1742 1748 background: #f3f3f3; 1743 1749 border-left: 1px solid #ddd; 1744 padding: 016px 16px;1750 padding: 20px 16px 16px; 1745 1751 position: absolute; 1746 1752 top: 0; 1747 1753 right: 0; … … 1769 1775 padding: 0; 1770 1776 } 1771 1777 1778 .media-modal .imgedit-group-top { 1779 margin: 0; 1780 } 1781 1772 1782 .media-modal .imgedit-group-top h3, /* Back-compat for pre-4.4 */ 1773 .media-modal .imgedit-group-top h2 { 1783 .media-modal .imgedit-group-top h2, 1784 .media-modal .imgedit-group-top h2 .button-link { 1785 display: inline-block; 1774 1786 text-transform: uppercase; 1775 1787 font-size: 12px; 1776 1788 color: #666; 1777 1789 margin: 0; 1778 margin-top: 24px;1790 margin-top: 3px; 1779 1791 } 1780 1792 1781 1793 .media-modal .imgedit-group-top h3 a, /* Back-compat for pre-4.4 */ 1782 .media-modal .imgedit-group-top h2 a { 1794 .media-modal .imgedit-group-top h2 a, 1795 .media-modal .imgedit-group-top h2 .button-link { 1783 1796 text-decoration: none; 1784 1797 color: #666; 1785 1798 } 1786 1799 1787 .media-modal .imgedit-help-toggle { 1788 margin-top: -2px; 1800 /* higher specificity than media.css */ 1801 .wp-core-ui.media-modal .image-editor .imgedit-help-toggle, 1802 .wp-core-ui.media-modal .image-editor .imgedit-help-toggle:hover, 1803 .wp-core-ui.media-modal .image-editor .imgedit-help-toggle:active { 1804 border: 1px solid transparent; 1805 margin: 0; 1806 padding: 0; 1807 background: transparent; 1808 color: #0074a2; 1809 font-size: 20px; 1810 line-height: 1; 1789 1811 cursor: pointer; 1790 color: #666; 1812 -webkit-box-sizing: content-box; 1813 -moz-box-sizing: content-box; 1814 box-sizing: content-box; 1815 -webkit-box-shadow: none; 1816 box-shadow: none; 1791 1817 } 1792 1818 1819 .wp-core-ui.media-modal .image-editor .imgedit-help-toggle:focus { 1820 color: #0074a2; 1821 border-color: #5b9dd9; 1822 outline: none; 1823 -webkit-box-shadow: 0 0 3px rgba( 0, 115, 170, .8 ); 1824 box-shadow: 0 0 3px rgba( 0, 115, 170, .8 ); 1825 } 1826 1827 .wp-core-ui.media-modal .imgedit-group-top .dashicons-arrow-down.imgedit-help-toggle { 1828 margin-top: -3px; 1829 } 1830 1831 .wp-core-ui.media-modal .image-editor h3 .imgedit-help-toggle { 1832 margin-top: -2px; 1833 } 1834 1793 1835 .media-modal .imgedit-help-toggled span.dashicons:before { 1794 1836 content: "\f142"; 1795 1837 }