Plugin details: Accessibility improvements

* Focus the close link to transfer focus into the plugin modal.
* Set title attribute on iframe for screereaders.

props jwenerd for initial patch and a11y team for testing.
fixes #28823.
Built from https://develop.svn.wordpress.org/trunk@29534


git-svn-id: http://core.svn.wordpress.org/trunk@29310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-08-18 20:02:19 +00:00
parent c0fef55a47
commit f5ec2a211b
6 changed files with 17 additions and 4 deletions

View File

@ -2533,6 +2533,11 @@ body.index-php .tb-close-icon {
transition: color .1s ease-in-out, background .1s ease-in-out;
}
body.plugin-install-php #TB_closeWindowButton:focus .tb-close-icon,
body.import-php #TB_closeWindowButton:focus .tb-close-icon,
body.plugins-php #TB_closeWindowButton:focus .tb-close-icon,
body.update-core-php #TB_closeWindowButton:focus .tb-close-icon,
body.index-php #TB_closeWindowButton:focus .tb-close-icon,
body.plugin-install-php .tb-close-icon:focus,
body.plugin-install-php .tb-close-icon:hover,
body.import-php .tb-close-icon:focus,

View File

@ -2533,6 +2533,11 @@ body.index-php .tb-close-icon {
transition: color .1s ease-in-out, background .1s ease-in-out;
}
body.plugin-install-php #TB_closeWindowButton:focus .tb-close-icon,
body.import-php #TB_closeWindowButton:focus .tb-close-icon,
body.plugins-php #TB_closeWindowButton:focus .tb-close-icon,
body.update-core-php #TB_closeWindowButton:focus .tb-close-icon,
body.index-php #TB_closeWindowButton:focus .tb-close-icon,
body.plugin-install-php .tb-close-icon:focus,
body.plugin-install-php .tb-close-icon:hover,
body.import-php .tb-close-icon:focus,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -42,7 +42,10 @@ jQuery( document ).ready( function( $ ) {
tb_click.call(this);
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
$('#TB_ajaxWindowTitle').html('<strong>' + plugininstallL10n.plugin_information + '</strong>&nbsp;' + $(this).data( 'title' ) );
$('#TB_ajaxWindowTitle').html( '<strong>' + plugininstallL10n.plugin_information + '</strong>&nbsp;' + $(this).data( 'title' ) );
$('#TB_iframeContent').attr( 'title', plugininstallL10n.plugin_information + ' ' + $(this).data( 'title' ) );
$('#TB_closeWindowButton').focus();
return false;
});

View File

@ -1 +1 @@
var tb_position;jQuery(document).ready(function(a){tb_position=function(){var b=a("#TB_window"),c=a(window).width(),d=a(window).height()-(c>792?60:20),e=c>792?772:c-20;return b.size()&&(b.width(e).height(d),a("#TB_iframeContent").width(e).height(d),b.css({"margin-left":"-"+parseInt(e/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&b.css({top:"30px","margin-top":"0"})),a("a.thickbox").each(function(){var b=a(this).attr("href");b&&(b=b.replace(/&width=[0-9]+/g,""),b=b.replace(/&height=[0-9]+/g,""),a(this).attr("href",b+"&width="+e+"&height="+d))})},a(window).resize(function(){tb_position()}),a(".plugin-card").on("click","a.thickbox",function(){return tb_click.call(this),a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"}),a("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong>&nbsp;"+a(this).data("title")),!1}),a("#plugin-information-tabs a").click(function(b){var c=a(this).attr("name");b.preventDefault(),a("#plugin-information-tabs a.current").removeClass("current"),a(this).addClass("current"),"description"!==c&&a(window).width()<772?a("#plugin-information-content").find(".fyi").hide():a("#plugin-information-content").find(".fyi").show(),a("#section-holder div.section").hide(),a("#section-"+c).show()}),a("a.install-now").click(function(){return confirm(plugininstallL10n.ays)})});
var tb_position;jQuery(document).ready(function(a){tb_position=function(){var b=a("#TB_window"),c=a(window).width(),d=a(window).height()-(c>792?60:20),e=c>792?772:c-20;return b.size()&&(b.width(e).height(d),a("#TB_iframeContent").width(e).height(d),b.css({"margin-left":"-"+parseInt(e/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&b.css({top:"30px","margin-top":"0"})),a("a.thickbox").each(function(){var b=a(this).attr("href");b&&(b=b.replace(/&width=[0-9]+/g,""),b=b.replace(/&height=[0-9]+/g,""),a(this).attr("href",b+"&width="+e+"&height="+d))})},a(window).resize(function(){tb_position()}),a(".plugin-card").on("click","a.thickbox",function(){return tb_click.call(this),a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"}),a("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong>&nbsp;"+a(this).data("title")),a("#TB_iframeContent").attr("title",plugininstallL10n.plugin_information+" "+a(this).data("title")),a("#TB_closeWindowButton").focus(),!1}),a("#plugin-information-tabs a").click(function(b){var c=a(this).attr("name");b.preventDefault(),a("#plugin-information-tabs a.current").removeClass("current"),a(this).addClass("current"),"description"!==c&&a(window).width()<772?a("#plugin-information-content").find(".fyi").hide():a("#plugin-information-content").find(".fyi").show(),a("#section-holder div.section").hide(),a("#section-"+c).show()}),a("a.install-now").click(function(){return confirm(plugininstallL10n.ays)})});