CoreFiles by mySites.guru
wp-a11y.js46 lines, 832 bytes, from wordpress-4.2.21.zip
Raw History Compare with 4.2.20
md5
9496a3e87aed4ca075c24a6710fadd6b
sha1
e33ebeb6fe8dc02143d37ed6f12cd7266d0202a0
sha256
6257d9a109eeb84dad57a5a5c23505d623975d968980da1e94928589fbfe0141
window.wp = window.wp || {};

( function ( wp, $ ) {
	'use strict';

	var $container;

	/**
	 * Update the ARIA live notification area text node.
	 *
	 * @since 4.2.0
	 *
	 * @param {String} message
	 */
	function speak( message ) {
		if ( $container ) {
			$container.text( message );
		}
	}

	/**
	 * Initialize wp.a11y and define ARIA live notification area.
	 *
	 * @since 4.2.0
	 */
	$( document ).ready( function() {
		$container = $( '#wp-a11y-speak' );

		if ( ! $container.length ) {
			$container = $( '<div>', {
				id: 'wp-a11y-speak',
				role: 'status',
				'aria-live': 'polite',
				'aria-relevant': 'all',
				'aria-atomic': 'true',
				'class': 'screen-reader-text'
			} );

			$( document.body ).append( $container );
		}
	} );

	wp.a11y = wp.a11y || {};
	wp.a11y.speak = speak;

} )( window.wp, window.jQuery );

The same content is in 49 releases, WordPress 4.2-beta1 to 4.2.39. See them all, or every version of this file.