Ticket #22743: 22743.5.diff
File 22743.5.diff, 7.0 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/image-edit.php
191 191 </td></tr> 192 192 </tbody></table> 193 193 <div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div> 194 <script type="text/javascript"> imageEdit.init(<?php echo $post_id; ?>);</script>194 <script type="text/javascript">jQuery( function() { imageEdit.init(<?php echo $post_id; ?>); });</script> 195 195 <div class="hidden" id="imgedit-leaving-<?php echo $post_id; ?>"><?php _e("There are unsaved changes that will be lost. 'OK' to continue, 'Cancel' to return to the Image Editor."); ?></div> 196 196 </div> 197 197 <?php -
wp-admin/includes/media.php
2270 2270 function edit_form_image_editor() { 2271 2271 $post = get_post(); 2272 2272 2273 $open = isset( $_GET['image-editor'] ); 2274 if ( $open ) 2275 require_once ABSPATH . 'wp-admin/includes/image-edit.php'; 2276 2273 2277 $thumb_url = false; 2274 2278 if ( $attachment_id = intval( $post->ID ) ) 2275 $thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 600 ), true );2279 $thumb_url = wp_get_attachment_image_src( $attachment_id, array( 900, 450 ), true ); 2276 2280 2277 2281 $filename = esc_html( basename( $post->guid ) ); 2278 2282 $title = esc_attr( $post->post_title ); 2279 2283 $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); 2280 2284 2281 $media_dims = '';2282 $meta = wp_get_attachment_metadata( $post->ID );2283 if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) )2284 $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> ";2285 $media_dims = apply_filters( 'media_meta', $media_dims, $post );2286 2287 2285 $att_url = wp_get_attachment_url( $post->ID ); 2288 2286 2289 2287 if ( wp_attachment_is_image( $post->ID ) ) : … … 2296 2294 <div class="wp_attachment_holder"> 2297 2295 <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div> 2298 2296 2299 <div class="wp_attachment_image" id="media-head-<?php echo $attachment_id; ?>">2297 <div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image" id="media-head-<?php echo $attachment_id; ?>"> 2300 2298 <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> 2301 2299 <p><?php echo $image_edit_button; ?></p> 2302 2300 </div> 2303 <div style="display:none" class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"></div> 2301 <div<?php if ( ! $open ) echo ' style="display:none"'; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"> 2302 <?php if ( $open ) wp_image_editor( $attachment_id ); ?> 2303 </div> 2304 2304 </div> 2305 2305 <?php endif; ?> 2306 2306 -
wp-includes/css/media-views.css
1308 1308 float: left; 1309 1309 max-width: 120px; 1310 1310 max-height: 120px; 1311 margin-top: 5px; 1311 1312 margin-right: 10px; 1312 1313 margin-bottom: 5px; 1313 1314 } … … 1347 1348 max-width: 100%; 1348 1349 } 1349 1350 1350 .attachment-info . delete-attachment a {1351 color: red; 1352 padding: 2px 4px; 1353 margin: -2px -4px;1351 .attachment-info .edit-attachment, 1352 .attachment-info .refresh-attachment, 1353 .attachment-info .delete-attachment { 1354 display: block; 1354 1355 text-decoration: none; 1355 1356 white-space: nowrap; 1356 1357 } 1357 1358 1358 .attachment-info . delete-attachment a:hover {1359 color: #fff; 1360 background: red;1359 .attachment-info .refresh-attachment, 1360 .attachment-details.needs-refresh .attachment-info .edit-attachment { 1361 display: none; 1361 1362 } 1362 1363 1364 .attachment-details.needs-refresh .attachment-info .refresh-attachment, 1365 .attachment-info .edit-attachment { 1366 display: block; 1367 } 1368 1369 .attachment-info .delete-attachment { 1370 color: #bc0b0b; 1371 } 1372 1373 .attachment-info .delete-attachment:hover { 1374 color: red; 1375 } 1376 1363 1377 /** 1364 1378 * Attachment Display Settings 1365 1379 */ -
wp-includes/js/media-views.js
4021 4021 'change [data-setting] input': 'updateSetting', 4022 4022 'change [data-setting] select': 'updateSetting', 4023 4023 'change [data-setting] textarea': 'updateSetting', 4024 'click .delete-attachment': 'deleteAttachment' 4024 'click .delete-attachment': 'deleteAttachment', 4025 'click .edit-attachment': 'editAttachment', 4026 'click .refresh-attachment': 'refreshAttachment' 4025 4027 }, 4026 4028 4027 4029 initialize: function() { … … 4038 4040 return this; 4039 4041 }, 4040 4042 4041 deleteAttachment: function( event) {4043 deleteAttachment: function( event ) { 4042 4044 event.preventDefault(); 4043 4045 4044 4046 if ( confirm( l10n.warnDelete ) ) 4045 4047 this.model.destroy(); 4048 }, 4049 4050 editAttachment: function( event ) { 4051 this.$el.addClass('needs-refresh'); 4052 }, 4053 4054 refreshAttachment: function( event ) { 4055 this.$el.removeClass('needs-refresh'); 4056 event.preventDefault(); 4057 this.model.fetch(); 4046 4058 } 4047 4059 }); 4048 4060 -
wp-includes/media.php
1337 1337 'update' => false, 1338 1338 'delete' => false, 1339 1339 ), 1340 'editLink' => false, 1340 1341 ); 1341 1342 1342 if ( current_user_can( 'edit_post', $attachment->ID ) ) 1343 if ( current_user_can( 'edit_post', $attachment->ID ) ) { 1343 1344 $response['nonces']['update'] = wp_create_nonce( 'update-post_' . $attachment->ID ); 1345 $response['editLink'] = get_edit_post_link( $attachment->ID, 'raw' ); 1346 } 1344 1347 1345 1348 if ( current_user_can( 'delete_post', $attachment->ID ) ) 1346 1349 $response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID ); … … 1703 1706 <div class="details"> 1704 1707 <div class="filename">{{ data.filename }}</div> 1705 1708 <div class="uploaded">{{ data.dateFormatted }}</div> 1706 <# if ( 'image' === data.type && ! data.uploading && data.width && data.height ) { #> 1707 <div class="dimensions">{{ data.width }} × {{ data.height }}</div> 1709 1710 <# if ( 'image' === data.type && ! data.uploading ) { #> 1711 <# if ( data.width && data.height ) { #> 1712 <div class="dimensions">{{ data.width }} × {{ data.height }}</div> 1713 <# } #> 1714 1715 <# if ( data.can.save ) { #> 1716 <a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a> 1717 <a class="refresh-attachment" href="#"><?php _e( 'Refresh' ); ?></a> 1718 <# } #> 1708 1719 <# } #> 1720 1709 1721 <# if ( ! data.uploading && data.can.remove ) { #> 1710 <div class="delete-attachment"> 1711 <a href="#"><?php _e( 'Delete Permanently' ); ?></a> 1712 </div> 1722 <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a> 1713 1723 <# } #> 1724 1714 1725 <div class="compat-meta"> 1715 1726 <# if ( data.compat && data.compat.meta ) { #> 1716 1727 {{{ data.compat.meta }}}