Changeset 3826946 for altification/trunk/includes/bulk.php
- Timestamp:
- 11/26/2026 12:41:24 PM (less than one hour ago)
- File:
-
- 1 edited
-
altification/trunk/includes/bulk.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
altification/trunk/includes/bulk.php
r3826858 r3826946 130 130 $missing_alt = count( array_filter( $all_images, fn( $i ) => ! $i['has_alt'] && ! $i['is_svg'] && ! $i['is_decorative'] ) ); 131 131 $decorative_count = count( array_filter( $all_images, fn( $i ) => $i['is_decorative'] ) ); 132 $missing_cap = $enable_caption ? count( array_filter( $all_images, fn( $i ) => ! $i['has_caption'] ) ) : 0; 133 $missing_desc = $enable_description ? count( array_filter( $all_images, fn( $i ) => ! $i['has_desc'] ) ) : 0; 132 // Same exclusions as $missing_alt, and as altification_summarise_site_images() and the JS 133 // recounts below. These used to count decorative images and SVGs, so the cards and tabs 134 // dropped to a different number the first time the JS recounted them. 135 $missing_cap = $enable_caption ? count( array_filter( $all_images, fn( $i ) => ! $i['has_caption'] && ! $i['is_svg'] && ! $i['is_decorative'] ) ) : 0; 136 $missing_desc = $enable_description ? count( array_filter( $all_images, fn( $i ) => ! $i['has_desc'] && ! $i['is_svg'] && ! $i['is_decorative'] ) ) : 0; 134 137 // Same exclusions as $missing_alt above, and as the JS recount in 135 138 // altificationUpdateFilterCredits(): an SVG can't be generated and a decorative image is … … 913 916 914 917 var isDecorative = $row.attr('data-decorative') === '1'; 918 // The missing filters list what the counts count: decorative images and SVGs 919 // are never missing anything (see altificationUpdateFilterCredits()). 920 var countable = ! isDecorative && $row.attr('data-svg') !== '1'; 915 921 if ( filter === 'all' ) show = true; 916 else if ( filter === 'missing_any' ) show = ( ! hasAlt && ! isDecorative ) || ( altificationEnableCaption && ! hasCap ) || ( altificationEnableDescription && ! hasDesc);917 else if ( filter === 'missing_alt' ) show = ! hasAlt && ! isDecorative;922 else if ( filter === 'missing_any' ) show = countable && ( ! hasAlt || ( altificationEnableCaption && ! hasCap ) || ( altificationEnableDescription && ! hasDesc ) ); 923 else if ( filter === 'missing_alt' ) show = countable && ! hasAlt; 918 924 else if ( filter === 'decorative' ) show = isDecorative; 919 else if ( filter === 'missing_cap' ) show = ! hasCap;920 else if ( filter === 'missing_desc' ) show = ! hasDesc;925 else if ( filter === 'missing_cap' ) show = countable && ! hasCap; 926 else if ( filter === 'missing_desc' ) show = countable && ! hasDesc; 921 927 else if ( filter === 'improvable' ) show = $row.attr('data-improvable') === '1'; 922 928 else if ( filter === 'keyword_mismatch' ) show = $row.attr('data-keyword-mismatch') === '1';
Note:
See TracChangeset
for help on using the changeset viewer.