Changeset 23095
- Timestamp:
- 12/06/2012 05:52:19 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/wp-admin.css
r23083 r23095 4151 4151 } 4152 4152 4153 .post-php .imgedit-wrap table { 4154 width: 100%; 4155 } 4156 4153 4157 .describe .imgedit-wrap table td, 4154 4158 .wp_attachment_holder .imgedit-wrap table td { … … 4157 4161 } 4158 4162 4159 .imgedit-wrap p,4160 .describe .imgedit-wrap table td {4161 font-size: 11px;4162 line-height: 18px;4163 }4164 4165 4163 .describe .imgedit-wrap table td.imgedit-settings { 4166 4164 padding: 0 5px; 4167 4165 } 4168 4166 4167 .wp_attachment_holder .imgedit-wrap table td.imgedit-settings { 4168 width: 250px; 4169 } 4170 4169 4171 td.imgedit-settings input { 4172 margin-top: 0; 4170 4173 vertical-align: middle; 4171 4174 } … … 4350 4353 } 4351 4354 4352 .imgedit-help ul li {4353 font-size: 11px;4354 }4355 4356 4355 a.imgedit-help-toggle { 4357 4356 text-decoration: none; 4358 }4359 4360 #wpbody-content .imgedit-response div {4361 width: 600px;4362 margin: 8px;4363 4357 } 4364 4358 … … 4390 4384 border-width: 1px; 4391 4385 border-style: solid; 4392 -webkit-border-radius: 8px;4393 border-radius: 8px;4386 -webkit-border-radius: 3px; 4387 border-radius: 3px; 4394 4388 margin-bottom: 8px; 4395 4389 padding: 2px 10px; -
trunk/wp-admin/includes/image-edit.php
r22863 r23095 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> -
trunk/wp-admin/includes/media.php
r23086 r23095 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 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 2284 2287 2285 $att_url = wp_get_attachment_url( $post->ID ); … … 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; ?> -
trunk/wp-includes/css/media-views.css
r23077 r23095 1309 1309 max-width: 120px; 1310 1310 max-height: 120px; 1311 margin-top: 5px; 1311 1312 margin-right: 10px; 1312 1313 margin-bottom: 5px; … … 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; 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; 1361 1375 } 1362 1376 -
trunk/wp-includes/js/media-views.js
r23089 r23095 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 … … 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 }); -
trunk/wp-includes/media.php
r23087 r23095 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 ) ) … … 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 ) { #>
Note: See TracChangeset
for help on using the changeset viewer.