Changeset 11715
- Timestamp:
- 03/28/2022 11:29:52 PM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/assets/css/admin.css
r11689 r11715 40 40 max-height: initial; 41 41 } 42 43 .photos-photo-link { 44 display: inline-block; 45 overflow: hidden; 46 } 47 .photos-photo-link img.blurred { 48 filter: blur(4rem); 49 } 50 .column-wporg-photo .photos-photo-link img.blurred { 51 filter: blur( 0.7rem ); 52 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/assets/js/admin.js
r11712 r11715 2 2 // Convert Orientations taxonomy checkboxes to radio buttons. 3 3 document.querySelectorAll('#photo_orientationchecklist input[type="checkbox"]').forEach((item) => {item.setAttribute('type', 'radio');}); 4 5 // Unblur blurred photo on photo edit page when clicked. 6 function unblurPhoto(event) { 7 event.target.classList.remove('blurred'); 8 event.target.removeEventListener('click', unblurPhoto, true); 9 event.preventDefault(); 10 } 11 document.querySelector('#photos_photo .photos-photo-link img.blurred').addEventListener('click', unblurPhoto, true); 12 4 13 }, false); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/admin.php
r11714 r11715 191 191 192 192 $image_id = get_post_thumbnail_id( $post ); 193 $image = wp_get_attachment_image( $image_id ); 193 $classes = ''; 194 if ( Photo::is_controversial( $post ) ) { 195 $classes .= ' blurred'; 196 } 197 $image = wp_get_attachment_image( $image_id, 'thumbnail', false, [ 'class' => trim( $classes ) ] ); 194 198 195 199 $can_edit_post = current_user_can( 'edit_post', $post->ID ); … … 199 203 $prefixed_format, 200 204 sprintf( 201 '<div><a class=" row-title" href="%s" aria-label="%s">%s</a></div>',205 '<div><a class="photos-photo-link row-title" href="%s" aria-label="%s">%s</a></div>', 202 206 get_edit_post_link( $post_id ), 203 207 /* translators: %s: Post title. */ … … 487 491 $thumb_url = wp_get_attachment_image_src( $image_id, [ 900, 450 ], true ); 488 492 493 $classes = 'photo-thumbnail'; 494 495 if ( Photo::is_controversial( $image_id ) ) { 496 $classes .= ' blurred'; 497 } 498 489 499 printf( 490 '<a class=" row-title" href="%s" target="_blank" aria-label="%s"><img class="photo-thumbnail" src="%s" style="max-width:100%%" alt="" /></a>',500 '<a class="photos-photo-link row-title" href="%s" target="_blank" aria-label="%s"><img class="%s" src="%s" style="max-width:100%%" alt="" /></a>', 491 501 wp_get_attachment_url( $image_id ), 492 502 /* translators: %s: Post title. */ 493 503 esc_attr( sprintf( __( 'Edit photo associated with post “%s”', 'wporg-photos' ), $post->post_title ) ), 504 esc_attr( $classes ), 494 505 set_url_scheme( $thumb_url[0] ) 495 506 );
Note: See TracChangeset
for help on using the changeset viewer.