Changeset 51030
- Timestamp:
- 05/26/2021 02:23:11 PM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/vendor/plupload/handlers.js
r51023 r51030 373 373 function copyAttachmentUploadURLClipboard() { 374 374 var clipboard = new ClipboardJS( '.copy-attachment-url' ), 375 successTimeout; 375 successTimeout; 376 376 377 clipboard.on( 'success', function( event ) { 377 378 var triggerElement = jQuery( event.trigger ), 378 379 successElement = jQuery( '.success', triggerElement.closest( '.copy-to-clipboard-container' ) ); 380 379 381 // Clear the selection and move focus back to the trigger. 380 382 event.clearSelection(); -
trunk/src/wp-admin/async-upload.php
r51023 r51030 49 49 switch ( $_REQUEST['fetch'] ) { 50 50 case 3: 51 echo '<div class="attachment-details">'; 52 $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ); 53 if ( $thumb_url ) { 54 echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; 55 } 56 // Title shouldn't ever be empty, but use filename just in case. 57 $file = get_attached_file( $post->ID ); 58 $fileurl = wp_get_attachment_url( $post->ID ); 59 $title = $post->post_title ? $post->post_title : wp_basename( $file ); 51 ?> 52 <div class="attachment-details"> 53 <?php 54 $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ); 55 if ( $thumb_url ) { 56 echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; 57 } 60 58 61 echo '<div class="filename new"><span class="media-list-title"><strong>' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . '</strong></span> <span class="media-list-subtitle">' . basename( $file ) . '</span></div>'; 62 echo '</div>'; 63 ?> 59 // Title shouldn't ever be empty, but use filename just in case. 60 $file = get_attached_file( $post->ID ); 61 $file_url = wp_get_attachment_url( $post->ID ); 62 $title = $post->post_title ? $post->post_title : wp_basename( $file ); 63 ?> 64 <div class="filename new"> 65 <span class="media-list-title"><strong><?php echo esc_html( wp_html_excerpt( $title, 60, '…' ) ); ?></strong></span> 66 <span class="media-list-subtitle"><?php echo wp_basename( $file ); ?></span> 67 </div> 68 </div> 64 69 <div class="attachment-tools"> 65 70 <span class="media-item-copy-container copy-to-clipboard-container edit-attachment"> 66 <button type="button" class="button button-small copy-attachment-url" data-clipboard-text="<?php echo $file url; ?>"><?php _e( 'Copy URL to clipboard' ); ?></button>71 <button type="button" class="button button-small copy-attachment-url" data-clipboard-text="<?php echo $file_url; ?>"><?php _e( 'Copy URL to clipboard' ); ?></button> 67 72 <span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> 68 73 </span> -
trunk/src/wp-admin/css/media.css
r51023 r51030 139 139 140 140 .media-item button .copy-attachment-url { 141 margin-top: 14px;141 margin-top: 14px; 142 142 } 143 143 144 144 .media-item .copy-to-clipboard-container { 145 margin-top: 7px;145 margin-top: 7px; 146 146 } 147 147
Note: See TracChangeset
for help on using the changeset viewer.