Changeset 27842
- Timestamp:
- 03/29/2014 08:50:57 AM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/media.css
r27577 r27842 458 458 459 459 .imgedit-settings p { 460 margin: 8px 0; 461 } 462 463 .post-php .imgedit-wrap table { 464 width: 100%; 465 } 466 467 .describe .imgedit-wrap table td, 468 .wp_attachment_holder .imgedit-wrap table td { 469 vertical-align: top; 470 padding-top: 0; 471 } 472 473 .describe .imgedit-wrap table td.imgedit-settings { 460 margin: 8px 0 0; 461 } 462 463 .describe .imgedit-wrap .imgedit-settings { 474 464 padding: 0 5px; 475 465 } 476 466 477 .wp_attachment_holder .imgedit-wrap table td.imgedit-settings { 467 .wp_attachment_holder div.updated { 468 margin-top: 0; 469 } 470 471 .wp_attachment_holder .imgedit-wrap > div { 472 height: auto; 473 overflow: hidden; 474 } 475 476 .wp_attachment_holder .imgedit-wrap .imgedit-panel-content { 477 padding-right: 16px; 478 width: auto; 479 overflow: hidden; 480 } 481 482 .wp_attachment_holder .imgedit-wrap .imgedit-settings { 483 float: right; 478 484 width: 250px; 479 485 } 480 486 481 td.imgedit-settings input {487 .imgedit-settings input { 482 488 margin-top: 0; 483 489 vertical-align: middle; … … 487 493 position: absolute; 488 494 top: 0; 489 background: #fff url(../images/spinner.gif) no-repeat scroll 22px 10px;495 background: #fff url(../images/spinner.gif) no-repeat center; 490 496 -webkit-background-size: 20px 20px; 491 497 background-size: 20px 20px; … … 562 568 border-color: #ccc; 563 569 background-color: #ddd; 570 color: #777; 564 571 filter: alpha(opacity=50); 565 572 opacity: 0.5; … … 635 642 } 636 643 644 #poststuff .imgedit-group-top h3 { 645 padding: 0; 646 } 647 648 .imgedit-group-top h3 a { 649 text-decoration: none; 650 } 651 637 652 .imgedit-applyto .imgedit-label { 638 653 padding: 2px 0 0; … … 643 658 display: none; 644 659 font-style: italic; 645 margin-bottom: 8px;646 660 } 647 661 -
trunk/src/wp-admin/includes/image-edit.php
r27712 r27842 35 35 ?> 36 36 <div class="imgedit-wrap"> 37 <?php echo $note; ?> 38 <table id="imgedit-panel-<?php echo $post_id; ?>"><tbody> 39 <tr><td> 40 <div class="imgedit-menu"> 41 <div onclick="imageEdit.crop(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-crop disabled" title="<?php esc_attr_e( 'Crop' ); ?>"></div><?php 42 43 // On some setups GD library does not provide imagerotate() - Ticket #11536 44 if ( wp_image_editor_supports( array( 'mime_type' => get_post_mime_type( $post_id ), 'methods' => array( 'rotate' ) ) ) ) { ?> 45 <div class="imgedit-rleft" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate counter-clockwise' ); ?>"></div> 46 <div class="imgedit-rright" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div> 47 <?php } else { 48 $note_no_rotate = esc_attr__('Image rotation is not supported by your web host.'); 49 ?> 50 <div class="imgedit-rleft disabled" title="<?php echo $note_no_rotate; ?>"></div> 51 <div class="imgedit-rright disabled" title="<?php echo $note_no_rotate; ?>"></div> 52 <?php } ?> 53 54 <div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv" title="<?php esc_attr_e( 'Flip vertically' ); ?>"></div> 55 <div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph" title="<?php esc_attr_e( 'Flip horizontally' ); ?>"></div> 56 57 <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> 58 <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> 59 <br class="clear" /> 60 </div> 61 62 <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" /> 63 <input type="hidden" id="imgedit-minthumb-<?php echo $post_id; ?>" value="<?php echo ( get_option('thumbnail_size_w') . ':' . get_option('thumbnail_size_h') ); ?>" /> 64 <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" /> 65 <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" /> 66 <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" /> 67 <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> 68 <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> 69 70 <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> 71 <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); ?>" /> 72 </div> 73 74 <div class="imgedit-submit"> 75 <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button" value="<?php esc_attr_e( 'Cancel' ); ?>" /> 76 <input type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button-primary imgedit-submit-btn" value="<?php esc_attr_e( 'Save' ); ?>" /> 77 </div> 78 </td> 79 80 <td class="imgedit-settings"> 37 <div id="imgedit-panel-<?php echo $post_id; ?>"> 38 39 <div class="imgedit-settings"> 81 40 <div class="imgedit-group"> 82 41 <div class="imgedit-group-top"> 83 < a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><strong><?php _e('Scale Image'); ?></strong></a>42 <h3><?php _e( 'Scale Image' ); ?> <a href="#" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;"></a></h3> 84 43 <div class="imgedit-help"> 85 44 <p><?php _e('You can proportionally scale the original image. For best results the scaling should be done before performing any other operations on it like crop, rotate, etc. Note that images can only be scaled down, not up.'); ?></p> 45 </div> 86 46 <?php if ( isset( $meta['width'], $meta['height'] ) ): ?> 87 <p><?php printf( __('Original dimensions %s'), $meta['width'] . ' ×' . $meta['height'] ); ?></p>47 <p><?php printf( __('Original dimensions %s'), $meta['width'] . ' × ' . $meta['height'] ); ?></p> 88 48 <?php endif ?> 89 49 <div class="imgedit-submit"> 90 <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; ?>" />50 <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; ?>" /> 91 51 <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span></span> 92 <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" /> 52 <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" /> 53 </div> 54 </div> 55 </div> 56 57 <?php if ( $can_restore ) { ?> 58 59 <div class="imgedit-group"> 60 <div class="imgedit-group-top"> 61 <h3><a onclick="imageEdit.toggleHelp(this);return false;" href="#"><?php _e('Restore Original Image'); ?> <span class="dashicons dashicons-arrow-down imgedit-help-toggle"></span></a></h3> 62 <div class="imgedit-help"> 63 <p><?php _e('Discard any changes and restore the original image.'); 64 65 if ( !defined('IMAGE_EDIT_OVERWRITE') || !IMAGE_EDIT_OVERWRITE ) 66 echo ' '.__('Previously edited copies of the image will not be deleted.'); 67 68 ?></p> 69 <div class="imgedit-submit"> 70 <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'restore')" class="button button-primary" value="<?php esc_attr_e( 'Restore image' ); ?>" <?php echo $can_restore; ?> /> 93 71 </div> 94 72 </div> 95 73 </div> 96 97 <?php if ( $can_restore ) { ?>98 99 <div class="imgedit-group-top">100 <a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><strong><?php _e('Restore Original Image'); ?></strong></a>101 <div class="imgedit-help">102 <p><?php _e('Discard any changes and restore the original image.');103 104 if ( !defined('IMAGE_EDIT_OVERWRITE') || !IMAGE_EDIT_OVERWRITE )105 echo ' '.__('Previously edited copies of the image will not be deleted.');106 107 ?></p>108 <div class="imgedit-submit">109 <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'restore')" class="button-primary" value="<?php esc_attr_e( 'Restore image' ); ?>" <?php echo $can_restore; ?> />110 </div>111 </div>112 74 </div> 113 75 114 76 <?php } ?> 115 116 </div>117 77 118 78 <div class="imgedit-group"> 119 79 <div class="imgedit-group-top"> 120 < strong><?php _e('Image Crop'); ?></strong>121 <a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><?php _e('(help)'); ?></a> 80 <h3><?php _e('Image Crop'); ?> <a href="#" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;"></a></h3> 81 122 82 <div class="imgedit-help"> 123 83 <p><?php _e('The image can be cropped by clicking on it and dragging to select the desired part. While dragging the dimensions of the selection are displayed below.'); ?></p> … … 156 116 <div class="imgedit-group imgedit-applyto"> 157 117 <div class="imgedit-group-top"> 158 <strong><?php _e('Thumbnail Settings'); ?></strong> 159 <a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><?php _e('(help)'); ?></a> 118 <h3><?php _e('Thumbnail Settings'); ?> <a href="#" class="dashicons dashicons-editor-help imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;"></a></h3> 160 119 <p class="imgedit-help"><?php _e('The thumbnail image can be cropped differently. For example it can be square or contain only a portion of the original image to showcase it better. Here you can select whether to apply changes to all image sizes or make the thumbnail different.'); ?></p> 161 120 </div> … … 185 144 <?php } ?> 186 145 187 </td></tr> 188 </tbody></table> 146 </div> 147 148 <div class="imgedit-panel-content"> 149 <?php echo $note; ?> 150 <div class="imgedit-menu"> 151 <div onclick="imageEdit.crop(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-crop disabled" title="<?php esc_attr_e( 'Crop' ); ?>"></div><?php 152 153 // On some setups GD library does not provide imagerotate() - Ticket #11536 154 if ( wp_image_editor_supports( array( 'mime_type' => get_post_mime_type( $post_id ), 'methods' => array( 'rotate' ) ) ) ) { ?> 155 <div class="imgedit-rleft" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate counter-clockwise' ); ?>"></div> 156 <div class="imgedit-rright" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div> 157 <?php } else { 158 $note_no_rotate = esc_attr__('Image rotation is not supported by your web host.'); 159 ?> 160 <div class="imgedit-rleft disabled" title="<?php echo $note_no_rotate; ?>"></div> 161 <div class="imgedit-rright disabled" title="<?php echo $note_no_rotate; ?>"></div> 162 <?php } ?> 163 164 <div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv" title="<?php esc_attr_e( 'Flip vertically' ); ?>"></div> 165 <div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph" title="<?php esc_attr_e( 'Flip horizontally' ); ?>"></div> 166 167 <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> 168 <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> 169 <br class="clear" /> 170 </div> 171 172 <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" /> 173 <input type="hidden" id="imgedit-minthumb-<?php echo $post_id; ?>" value="<?php echo ( get_option('thumbnail_size_w') . ':' . get_option('thumbnail_size_h') ); ?>" /> 174 <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" /> 175 <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" /> 176 <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" /> 177 <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" /> 178 <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" /> 179 180 <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> 181 <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); ?>" /> 182 </div> 183 184 <div class="imgedit-submit"> 185 <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button" value="<?php esc_attr_e( 'Cancel' ); ?>" /> 186 <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' ); ?>" /> 187 </div> 188 </div> 189 190 </div> 189 191 <div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div> 190 192 <script type="text/javascript">jQuery( function() { imageEdit.init(<?php echo $post_id; ?>); });</script> -
trunk/src/wp-admin/js/image-edit.js
r27644 r27842 64 64 65 65 toggleHelp : function(el) { 66 $( el).siblings('.imgedit-help').slideToggle('fast');66 $( el ).parents( '.imgedit-group-top' ).toggleClass( 'imgedit-help-toggled' ).find( '.imgedit-help' ).slideToggle( 'fast' ); 67 67 return false; 68 68 }, -
trunk/src/wp-includes/css/media-views.css
r27840 r27842 1459 1459 */ 1460 1460 1461 .media-frame .image-editor { 1461 .media-frame .imgedit-wrap { 1462 position: static; 1463 } 1464 1465 .media-frame .imgedit-wait { 1466 height: auto !important; 1467 right: 0; 1468 bottom: 0; 1469 left: 0; 1470 } 1471 1472 .media-frame .imgedit-wrap .imgedit-panel-content { 1462 1473 padding: 16px; 1463 } 1464 1465 .media-frame .imgedit-wrap table { 1466 width: 100%; 1467 } 1468 1469 .media-frame .imgedit-wrap table td { 1470 vertical-align: top; 1471 padding-top: 0; 1472 } 1473 1474 .media-frame .imgedit-wrap table td.imgedit-settings { 1474 position: absolute; 1475 top: 0; 1476 right: 282px; 1477 bottom: 0; 1478 left: 0; 1479 overflow: auto; 1480 } 1481 1482 .media-frame .imgedit-wrap .imgedit-settings { 1483 background: #f3f3f3; 1484 border-left: 1px solid #ddd; 1485 padding: 0 16px 16px; 1486 position: absolute; 1487 top: 0; 1488 right: 0; 1489 bottom: 0; 1475 1490 width: 250px; 1476 } 1491 overflow: auto; 1492 } 1493 1494 .media-frame .imgedit-group { 1495 background: none; 1496 border: none; 1497 border-bottom: 1px solid #ddd; 1498 -webkit-box-shadow: none; 1499 box-shadow: none; 1500 margin: 0; 1501 margin-bottom: 16px; 1502 padding: 0; 1503 padding-bottom: 16px; 1504 } 1505 1506 .media-frame .imgedit-group:last-of-type { 1507 border: none; 1508 margin: 0; 1509 padding: 0; 1510 } 1511 1512 .media-frame .imgedit-group-top h3 { 1513 text-transform: uppercase; 1514 font-size: 12px; 1515 color: #666; 1516 margin: 0; 1517 margin-top: 24px; 1518 } 1519 1520 .media-frame .imgedit-group-top h3 a { 1521 text-decoration: none; 1522 color: #666; 1523 } 1524 1525 .media-frame .imgedit-help-toggle { 1526 margin-top: -2px; 1527 cursor: pointer; 1528 color: #666; 1529 } 1530 1531 .media-frame .imgedit-help-toggled span.dashicons:before { 1532 content: '\f142'; 1533 } 1534 1535 .media-frame .imgedit-group img { 1536 margin-top: 5px; 1537 } 1538 1539 .media-frame .imgedit-wrap div.updated { 1540 margin: 0; 1541 margin-bottom: 16px; 1542 } 1543 1544 1477 1545 /** 1478 1546 * Embed from URL and Image Details
Note: See TracChangeset
for help on using the changeset viewer.