WordPress/wp-includes/js/wp-a11y.min.js
Andrew Ozz 3a2741ca52 Add assertive capability to wp.a11y.speak().
Props afercia. See #32600.
Built from https://develop.svn.wordpress.org/trunk@33000


git-svn-id: http://core.svn.wordpress.org/trunk@32971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-30 04:35:24 +00:00

1 line
643 B
JavaScript

window.wp=window.wp||{},function(a,b){"use strict";function c(a,b){e(),g&&"assertive"===b?g.text(a):f&&f.text(a)}function d(a){a=a||"polite",h="assertive"===a?"alert":"status";var c=b("<div>",{id:"wp-a11y-speak-"+a,role:h,"aria-live":a,"aria-relevant":"additions text","aria-atomic":"true","class":"screen-reader-text wp-a11y-speak-region"});return b(document.body).append(c),c}function e(){b(".wp-a11y-speak-region").text("")}var f,g,h;b(document).ready(function(){f=b("#wp-a11y-speak-polite"),g=b("#wp-a11y-speak-assertive"),f.length||(f=d("polite")),g.length||(g=d("assertive"))}),a.a11y=a.a11y||{},a.a11y.speak=c}(window.wp,window.jQuery);