Changeset 56670
- Timestamp:
- 09/24/2023 08:11:59 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/site-health.js
r54165 r56670 226 226 227 227 $progressLabel.text( __( 'Good' ) ); 228 wp.a11y.speak( __( 'All site health tests have finished running. Your site is looking good, and the results are now available on the page.' ));228 announceTestsProgression( 'good' ); 229 229 } else { 230 230 $wrapper.addClass( 'orange' ).removeClass( 'green' ); 231 231 232 232 $progressLabel.text( __( 'Should be improved' ) ); 233 wp.a11y.speak( __( 'All site health tests have finished running. There are items that should be addressed, and the results are now available on the page.' ));233 announceTestsProgression( 'improvable' ); 234 234 } 235 235 … … 380 380 // After 3 seconds announce that we're still waiting for directory sizes. 381 381 var timeout = window.setTimeout( function() { 382 wp.a11y.speak( __( 'Please wait...' ));382 announceTestsProgression( 'waiting-for-directory-sizes' ); 383 383 }, 3000 ); 384 384 … … 391 391 392 392 $( '.health-check-wp-paths-sizes.spinner' ).css( 'visibility', 'hidden' ); 393 recalculateProgression();394 393 395 394 if ( delay > 3000 ) { … … 406 405 407 406 window.setTimeout( function() { 408 wp.a11y.speak( __( 'All site health tests have finished running.' ));407 recalculateProgression(); 409 408 }, delay ); 410 409 } else { … … 453 452 $( this ).toggleClass( 'visible' ); 454 453 } ); 454 455 /** 456 * Announces to assistive technologies the tests progression status. 457 * 458 * @since 6.4.0 459 * 460 * @param {string} type The type of message to be announced. 461 * 462 * @return {void} 463 */ 464 function announceTestsProgression( type ) { 465 // Only announce the messages in the Site Health pages. 466 if ( 'site-health' !== SiteHealth.screen ) { 467 return; 468 } 469 470 switch ( type ) { 471 case 'good': 472 wp.a11y.speak( __( 'All site health tests have finished running. Your site is looking good.' ) ); 473 break; 474 case 'improvable': 475 wp.a11y.speak( __( 'All site health tests have finished running. There are items that should be addressed.' ) ); 476 break; 477 case 'waiting-for-directory-sizes': 478 wp.a11y.speak( __( 'Running additional tests... please wait.' ) ); 479 break; 480 default: 481 return; 482 } 483 } 455 484 } );
Note: See TracChangeset
for help on using the changeset viewer.