Make post meta box toggles accessible.
props joedolson. fixes #33544. Built from https://develop.svn.wordpress.org/trunk@33762 git-svn-id: http://core.svn.wordpress.org/trunk@33730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b6c01b80fa
commit
fc9961ca22
|
@ -1788,8 +1788,8 @@ html.wp-toolbar {
|
||||||
|
|
||||||
.postbox .handlediv {
|
.postbox .handlediv {
|
||||||
float: left;
|
float: left;
|
||||||
width: 27px;
|
width: 33px;
|
||||||
height: 30px;
|
height: 36px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.js .postbox .handlediv {
|
.js .postbox .handlediv {
|
||||||
|
|
|
@ -1788,8 +1788,8 @@ html.wp-toolbar {
|
||||||
|
|
||||||
.postbox .handlediv {
|
.postbox .handlediv {
|
||||||
float: right;
|
float: right;
|
||||||
width: 27px;
|
width: 33px;
|
||||||
height: 30px;
|
height: 36px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.js .postbox .handlediv {
|
.js .postbox .handlediv {
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1083,8 +1083,11 @@ function do_meta_boxes( $screen, $context, $object ) {
|
||||||
$i++;
|
$i++;
|
||||||
$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
|
$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
|
||||||
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
|
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
|
||||||
if ( 'dashboard_browser_nag' != $box['id'] )
|
if ( 'dashboard_browser_nag' != $box['id'] ) {
|
||||||
echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>';
|
echo '<button class="handlediv button-link" title="' . esc_attr__( 'Click to toggle' ) . '" aria-expanded="true">';
|
||||||
|
echo '<span class="screen-reader-text">' . sprintf( __( 'Click to toggle %s panel' ), $box['title'] ) . '</span><br />';
|
||||||
|
echo '</button>';
|
||||||
|
}
|
||||||
echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
|
echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
|
||||||
echo '<div class="inside">' . "\n";
|
echo '<div class="inside">' . "\n";
|
||||||
call_user_func($box['callback'], $object, $box);
|
call_user_func($box['callback'], $object, $box);
|
||||||
|
|
|
@ -11,13 +11,16 @@ var postboxes;
|
||||||
|
|
||||||
self.init(page, args);
|
self.init(page, args);
|
||||||
|
|
||||||
$('.postbox .hndle, .postbox .handlediv').bind('click.postboxes', function() {
|
$('.postbox .hndle, .postbox .handlediv').bind('click.postboxes', function( e ) {
|
||||||
var p = $(this).parent('.postbox'), id = p.attr('id');
|
var p = $(this).parent('.postbox'), id = p.attr('id');
|
||||||
|
|
||||||
if ( 'dashboard_browser_nag' == id )
|
if ( 'dashboard_browser_nag' == id )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p.toggleClass('closed');
|
e.preventDefault();
|
||||||
|
|
||||||
|
p.toggleClass( 'closed' );
|
||||||
|
$(this).attr( 'aria-expanded', ! p.hasClass( 'closed' ) );
|
||||||
|
|
||||||
if ( page != 'press-this' )
|
if ( page != 'press-this' )
|
||||||
self.save_state(page);
|
self.save_state(page);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
var postboxes;!function(a){var b=a(document);postboxes={add_postbox_toggles:function(c,d){var e=this;e.init(c,d),a(".postbox .hndle, .postbox .handlediv").bind("click.postboxes",function(){var d=a(this).parent(".postbox"),f=d.attr("id");"dashboard_browser_nag"!=f&&(d.toggleClass("closed"),"press-this"!=c&&e.save_state(c),f&&(!d.hasClass("closed")&&a.isFunction(postboxes.pbshow)?e.pbshow(f):d.hasClass("closed")&&a.isFunction(postboxes.pbhide)&&e.pbhide(f)),b.trigger("postbox-toggled",d))}),a(".postbox .hndle a").click(function(a){a.stopPropagation()}),a(".postbox a.dismiss").bind("click.postboxes",function(){var b=a(this).parents(".postbox").attr("id")+"-hide";return a("#"+b).prop("checked",!1).triggerHandler("click"),!1}),a(".hide-postbox-tog").bind("click.postboxes",function(){var d=a(this).val(),f=a("#"+d);a(this).prop("checked")?(f.show(),a.isFunction(postboxes.pbshow)&&e.pbshow(d)):(f.hide(),a.isFunction(postboxes.pbhide)&&e.pbhide(d)),e.save_state(c),e._mark_area(),b.trigger("postbox-toggled",f)}),a('.columns-prefs input[type="radio"]').bind("click.postboxes",function(){var b=parseInt(a(this).val(),10);b&&(e._pb_edit(b),e.save_order(c))})},init:function(b,c){var d=a(document.body).hasClass("mobile");a.extend(this,c||{}),a("#wpbody-content").css("overflow","hidden"),a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",delay:d?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,helper:"clone",opacity:.65,stop:function(){return a(this).find("#dashboard_browser_nag").is(":visible")&&"dashboard_browser_nag"!=this.firstChild.id?void a(this).sortable("cancel"):void postboxes.save_order(b)},receive:function(b,c){"dashboard_browser_nag"==c.item[0].id&&a(c.sender).sortable("cancel"),postboxes._mark_area()}}),d&&(a(document.body).bind("orientationchange.postboxes",function(){postboxes._pb_change()}),this._pb_change()),this._mark_area()},save_state:function(b){var c=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),d=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"closed-postboxes",closed:c,hidden:d,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:b})},save_order:function(b){var c,d=a(".columns-prefs input:checked").val()||0;c={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:b},a(".meta-box-sortables").each(function(){c["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")}),a.post(ajaxurl,c)},_mark_area:function(){var b=a("div.postbox:visible").length,c=a("#post-body #side-sortables");a("#dashboard-widgets .meta-box-sortables:visible").each(function(){var c=a(this);1==b||c.children(".postbox:visible").length?c.removeClass("empty-container"):c.addClass("empty-container")}),c.length&&(c.children(".postbox:visible").length?c.removeClass("empty-container"):"280px"==a("#postbox-container-1").css("width")&&c.addClass("empty-container"))},_pb_edit:function(b){var c=a(".metabox-holder").get(0);c&&(c.className=c.className.replace(/columns-\d+/,"columns-"+b)),a(document).trigger("postboxes-columnchange")},_pb_change:function(){var b=a('label.columns-prefs-1 input[type="radio"]');switch(window.orientation){case 90:case-90:b.length&&b.is(":checked")||this._pb_edit(2);break;case 0:case 180:a("#poststuff").length?this._pb_edit(1):b.length&&b.is(":checked")||this._pb_edit(2)}},pbshow:!1,pbhide:!1}}(jQuery);
|
var postboxes;!function(a){var b=a(document);postboxes={add_postbox_toggles:function(c,d){var e=this;e.init(c,d),a(".postbox .hndle, .postbox .handlediv").bind("click.postboxes",function(d){var f=a(this).parent(".postbox"),g=f.attr("id");"dashboard_browser_nag"!=g&&(d.preventDefault(),f.toggleClass("closed"),a(this).attr("aria-expanded",!f.hasClass("closed")),"press-this"!=c&&e.save_state(c),g&&(!f.hasClass("closed")&&a.isFunction(postboxes.pbshow)?e.pbshow(g):f.hasClass("closed")&&a.isFunction(postboxes.pbhide)&&e.pbhide(g)),b.trigger("postbox-toggled",f))}),a(".postbox .hndle a").click(function(a){a.stopPropagation()}),a(".postbox a.dismiss").bind("click.postboxes",function(){var b=a(this).parents(".postbox").attr("id")+"-hide";return a("#"+b).prop("checked",!1).triggerHandler("click"),!1}),a(".hide-postbox-tog").bind("click.postboxes",function(){var d=a(this).val(),f=a("#"+d);a(this).prop("checked")?(f.show(),a.isFunction(postboxes.pbshow)&&e.pbshow(d)):(f.hide(),a.isFunction(postboxes.pbhide)&&e.pbhide(d)),e.save_state(c),e._mark_area(),b.trigger("postbox-toggled",f)}),a('.columns-prefs input[type="radio"]').bind("click.postboxes",function(){var b=parseInt(a(this).val(),10);b&&(e._pb_edit(b),e.save_order(c))})},init:function(b,c){var d=a(document.body).hasClass("mobile");a.extend(this,c||{}),a("#wpbody-content").css("overflow","hidden"),a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",delay:d?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,helper:"clone",opacity:.65,stop:function(){return a(this).find("#dashboard_browser_nag").is(":visible")&&"dashboard_browser_nag"!=this.firstChild.id?void a(this).sortable("cancel"):void postboxes.save_order(b)},receive:function(b,c){"dashboard_browser_nag"==c.item[0].id&&a(c.sender).sortable("cancel"),postboxes._mark_area()}}),d&&(a(document.body).bind("orientationchange.postboxes",function(){postboxes._pb_change()}),this._pb_change()),this._mark_area()},save_state:function(b){var c=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),d=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"closed-postboxes",closed:c,hidden:d,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:b})},save_order:function(b){var c,d=a(".columns-prefs input:checked").val()||0;c={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:b},a(".meta-box-sortables").each(function(){c["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")}),a.post(ajaxurl,c)},_mark_area:function(){var b=a("div.postbox:visible").length,c=a("#post-body #side-sortables");a("#dashboard-widgets .meta-box-sortables:visible").each(function(){var c=a(this);1==b||c.children(".postbox:visible").length?c.removeClass("empty-container"):c.addClass("empty-container")}),c.length&&(c.children(".postbox:visible").length?c.removeClass("empty-container"):"280px"==a("#postbox-container-1").css("width")&&c.addClass("empty-container"))},_pb_edit:function(b){var c=a(".metabox-holder").get(0);c&&(c.className=c.className.replace(/columns-\d+/,"columns-"+b)),a(document).trigger("postboxes-columnchange")},_pb_change:function(){var b=a('label.columns-prefs-1 input[type="radio"]');switch(window.orientation){case 90:case-90:b.length&&b.is(":checked")||this._pb_edit(2);break;case 0:case 180:a("#poststuff").length?this._pb_edit(1):b.length&&b.is(":checked")||this._pb_edit(2)}},pbshow:!1,pbhide:!1}}(jQuery);
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-33761';
|
$wp_version = '4.4-alpha-33762';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue