Support for "tabbing" through the admin bar and admin menu, fixes #19088
git-svn-id: http://svn.automattic.com/wordpress/trunk@19162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
27b7255c6c
commit
94ef5dd13f
File diff suppressed because one or more lines are too long
|
@ -421,6 +421,7 @@ a:focus {
|
|||
}
|
||||
|
||||
#adminmenu a:hover,
|
||||
#adminmenu li.menu-top > a:focus,
|
||||
#adminmenu ul.wp-submenu a:hover,
|
||||
#the-comment-list .comment a:hover,
|
||||
#rightnow a:hover,
|
||||
|
@ -1279,7 +1280,8 @@ table.widefat .spam a:hover,
|
|||
border-color: #d1e5ee;
|
||||
}
|
||||
|
||||
#adminmenu li.menu-top:hover > a {
|
||||
#adminmenu li.menu-top:hover > a,
|
||||
#adminmenu li.menu-top > a:focus {
|
||||
background-color: #e0f1ff;
|
||||
text-shadow: 0 1px 0 rgba( 255, 255, 255, 0.4 );
|
||||
}
|
||||
|
@ -1339,7 +1341,8 @@ table.widefat .spam a:hover,
|
|||
border-bottom-color: #5589AA;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu a:hover {
|
||||
#adminmenu .wp-submenu a:hover,
|
||||
#adminmenu .wp-submenu a:focus {
|
||||
background-color: #EFF8FF;
|
||||
color: #333;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -429,6 +429,7 @@ a:focus {
|
|||
}
|
||||
|
||||
#adminmenu a:hover,
|
||||
#adminmenu li.menu-top > a:focus,
|
||||
#adminmenu ul.wp-submenu a:hover,
|
||||
#the-comment-list .comment a:hover,
|
||||
#rightnow a:hover,
|
||||
|
@ -980,7 +981,8 @@ table.widefat .spam a:hover,
|
|||
border-color: #dfdfdf;
|
||||
}
|
||||
|
||||
#adminmenu li.menu-top:hover > a {
|
||||
#adminmenu li.menu-top:hover > a,
|
||||
#adminmenu li.menu-top > a:focus {
|
||||
background-color: #e4e4e4;
|
||||
text-shadow: 0 1px 0 rgba( 255, 255, 255, 0.4 );
|
||||
}
|
||||
|
@ -1040,7 +1042,8 @@ table.widefat .spam a:hover,
|
|||
border-bottom-color: #6d6d6d;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu a:hover {
|
||||
#adminmenu .wp-submenu a:hover,
|
||||
#adminmenu .wp-submenu a:focus {
|
||||
background-color: #EAF2FA;
|
||||
color: #333;
|
||||
}
|
||||
|
|
|
@ -620,7 +620,7 @@ function wp_admin_bar_updates_menu( $wp_admin_bar ) {
|
|||
function wp_admin_bar_search_menu( $wp_admin_bar ) {
|
||||
$form = '<div id="adminbarsearch-wrap">';
|
||||
$form .= '<form action="' . home_url() . '" method="get" id="adminbarsearch">';
|
||||
$form .= '<input class="adminbar-input" name="s" id="adminbar-search"';
|
||||
$form .= '<input class="adminbar-input" name="s" id="adminbar-search" tabindex="1"';
|
||||
$form .= 'type="text" value="" maxlength="150" placeholder="' . esc_attr__( 'Search' ) . '" onclick="return false;" />';
|
||||
$form .= '<input type="submit" class="adminbar-button" value="' . __('Search') . '"/>';
|
||||
$form .= '</form>';
|
||||
|
|
|
@ -146,7 +146,7 @@ class WP_Admin_Bar {
|
|||
?>
|
||||
|
||||
<li id="<?php echo esc_attr( "wp-admin-bar-{$node->id}" ); ?>" class="<?php echo esc_attr( $menuclass ); ?>">
|
||||
<a href="<?php echo esc_url( $node->href ) ?>"<?php
|
||||
<a tabindex="1" href="<?php echo esc_url( $node->href ) ?>"<?php
|
||||
if ( ! empty( $node->meta['onclick'] ) ) :
|
||||
?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php
|
||||
endif;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -188,20 +188,24 @@
|
|||
}
|
||||
|
||||
#wpadminbar.nojs .ab-top-menu > li.menupop:hover,
|
||||
#wpadminbar .ab-top-menu li.menupop.hover {
|
||||
#wpadminbar .ab-top-menu li.menupop.hover,
|
||||
#wpadminbar .quicklinks .menupop > a:focus {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#wpadminbar.nojs .quicklinks .menupop:hover a,
|
||||
#wpadminbar.nojs .quicklinks .menupop:hover span,
|
||||
#wpadminbar .quicklinks .menupop.hover a,
|
||||
#wpadminbar .quicklinks .menupop.hover span {
|
||||
#wpadminbar .quicklinks .menupop.hover span,
|
||||
#wpadminbar .quicklinks .menupop a:focus,
|
||||
#wpadminbar .quicklinks .menupop a:focus span {
|
||||
color: #333;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
#wpadminbar .quicklinks .menupop li:hover,
|
||||
#wpadminbar .quicklinks .menupop li.hover {
|
||||
#wpadminbar .quicklinks .menupop li.hover,
|
||||
#wpadminbar .quicklinks .menupop a:focus {
|
||||
background-color: #eaf2fa;
|
||||
}
|
||||
|
||||
|
@ -256,7 +260,8 @@
|
|||
}
|
||||
|
||||
#wpadminbar .quicklinks .menupop li.secondary > ul > li:hover,
|
||||
#wpadminbar .quicklinks .menupop li.secondary > ul > li.hover {
|
||||
#wpadminbar .quicklinks .menupop li.secondary > ul > li.hover,
|
||||
#wpadminbar .quicklinks .menupop li.secondary > ul > li a:focus {
|
||||
background: #dfdfdf;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,19 @@ if ( typeof(jQuery) != 'undefined' ) {
|
|||
$(this).parents('#wp-admin-bar-get-shortlink').removeClass('selected');
|
||||
}).focus().select();
|
||||
});
|
||||
|
||||
$('.ab-top-menu > li > a').bind('focus.adminbar', function(){
|
||||
$(this).parent().addClass('hover').find('a').attr('tabindex', '-1').attr('tabindex', '1');
|
||||
});
|
||||
|
||||
$('.ab-top-menu li ul li a').bind('blur.adminbar', function(){
|
||||
var t = $(this);
|
||||
|
||||
setTimeout(function(){
|
||||
if ( !t.parent().parent().find('a:focus').length )
|
||||
t.parents('li.menupop').removeClass('hover');
|
||||
}, 200);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
(function(d, w) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
if(typeof(jQuery)!="undefined"){if(typeof(jQuery.fn.hoverIntent)=="undefined"){(function(b){b.fn.hoverIntent=function(p,r){var g={sensitivity:7,interval:100,timeout:0};g=b.extend(g,r?{over:p,out:r}:p);var a,f,t,v;var u=function(c){a=c.pageX;f=c.pageY};var w=function(c,d){d.hoverIntent_t=clearTimeout(d.hoverIntent_t);if((Math.abs(t-a)+Math.abs(v-f))<g.sensitivity){b(d).unbind("mousemove",u);d.hoverIntent_s=1;return g.over.apply(d,[c])}else{t=a;v=f;d.hoverIntent_t=setTimeout(function(){w(c,d)},g.interval)}};var s=function(c,d){d.hoverIntent_t=clearTimeout(d.hoverIntent_t);d.hoverIntent_s=0;return g.out.apply(d,[c])};var x=function(e){var d=this;var c=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(e){c=this}}if(c==this){if(b.browser.mozilla){if(e.type=="mouseout"){d.mtout=setTimeout(function(){q(e,d)},30)}else{if(d.mtout){d.mtout=clearTimeout(d.mtout)}}}return}else{if(d.mtout){d.mtout=clearTimeout(d.mtout)}q(e,d)}};var q=function(e,d){var c=jQuery.extend({},e);if(d.hoverIntent_t){d.hoverIntent_t=clearTimeout(d.hoverIntent_t)}if(e.type=="mouseover"){t=c.pageX;v=c.pageY;b(d).bind("mousemove",u);if(d.hoverIntent_s!=1){d.hoverIntent_t=setTimeout(function(){w(c,d)},g.interval)}}else{b(d).unbind("mousemove",u);if(d.hoverIntent_s==1){d.hoverIntent_t=setTimeout(function(){s(c,d)},g.timeout)}}};return this.mouseover(x).mouseout(x)}})(jQuery)}jQuery(document).ready(function(a){a("#wpadminbar").removeClass("nojq").removeClass("nojs").find("li.menupop").hoverIntent({over:function(b){a(this).addClass("hover")},out:function(b){a(this).removeClass("hover")},timeout:180,sensitivity:7,interval:100});a("#wp-admin-bar-get-shortlink").click(function(b){b.preventDefault();a(this).addClass("selected").children(".shortlink-input").blur(function(){a(this).parents("#wp-admin-bar-get-shortlink").removeClass("selected")}).focus().select()})})}else{(function(i,k){var c=function(n,m,d){if(n.addEventListener){n.addEventListener(m,d,false)}else{if(n.attachEvent){n.attachEvent("on"+m,function(){return d.call(n,window.event)})}}},e,f=new RegExp("\\bhover\\b","g"),a=[],j=new RegExp("\\bselected\\b","g"),g=function(m){var d=a.length;while(d--){if(a[d]&&m==a[d][1]){return a[d][0]}}return false},h=function(s){var n,d,q,m,p,r,u=[],o=0;while(s&&s!=e&&s!=i){if("LI"==s.nodeName.toUpperCase()){u[u.length]=s;d=g(s);if(d){clearTimeout(d)}s.className=s.className?(s.className.replace(f,"")+" hover"):"hover";m=s}s=s.parentNode}if(m&&m.parentNode){p=m.parentNode;if(p&&"UL"==p.nodeName.toUpperCase()){n=p.childNodes.length;while(n--){r=p.childNodes[n];if(r!=m){r.className=r.className?r.className.replace(j,""):""}}}}n=a.length;while(n--){q=false;o=u.length;while(o--){if(u[o]==a[n][1]){q=true}}if(!q){a[n][1].className=a[n][1].className?a[n][1].className.replace(f,""):""}}},l=function(d){while(d&&d!=e&&d!=i){if("LI"==d.nodeName.toUpperCase()){(function(m){var n=setTimeout(function(){m.className=m.className?m.className.replace(f,""):""},500);a[a.length]=[n,m]})(d)}d=d.parentNode}},b=function(p){var n,d,o,m=p.target||p.srcElement;while(true){if(!m||m==i||m==e){return}if(m.id&&m.id=="wp-admin-bar-get-shortlink"){break}m=m.parentNode}if(p.preventDefault){p.preventDefault()}p.returnValue=false;if(-1==m.className.indexOf("selected")){m.className+=" selected"}for(n=0,d=m.childNodes.length;n<d;n++){o=m.childNodes[n];if(o.className&&-1!=o.className.indexOf("shortlink-input")){o.focus();o.select();o.onblur=function(){m.className=m.className?m.className.replace(j,""):""};break}}return false};c(k,"load",function(){e=i.getElementById("wpadminbar");if(i.body&&e){i.body.appendChild(e);if(e.className){e.className=e.className.replace(/nojs/,"")}c(e,"mouseover",function(d){h(d.target||d.srcElement)});c(e,"mouseout",function(d){l(d.target||d.srcElement)});c(e,"click",b)}if(k.location.hash){k.scrollBy(0,-32)}})})(document,window)};
|
||||
if(typeof(jQuery)!="undefined"){if(typeof(jQuery.fn.hoverIntent)=="undefined"){(function(b){b.fn.hoverIntent=function(p,r){var g={sensitivity:7,interval:100,timeout:0};g=b.extend(g,r?{over:p,out:r}:p);var a,f,t,v;var u=function(c){a=c.pageX;f=c.pageY};var w=function(c,d){d.hoverIntent_t=clearTimeout(d.hoverIntent_t);if((Math.abs(t-a)+Math.abs(v-f))<g.sensitivity){b(d).unbind("mousemove",u);d.hoverIntent_s=1;return g.over.apply(d,[c])}else{t=a;v=f;d.hoverIntent_t=setTimeout(function(){w(c,d)},g.interval)}};var s=function(c,d){d.hoverIntent_t=clearTimeout(d.hoverIntent_t);d.hoverIntent_s=0;return g.out.apply(d,[c])};var x=function(e){var d=this;var c=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(e){c=this}}if(c==this){if(b.browser.mozilla){if(e.type=="mouseout"){d.mtout=setTimeout(function(){q(e,d)},30)}else{if(d.mtout){d.mtout=clearTimeout(d.mtout)}}}return}else{if(d.mtout){d.mtout=clearTimeout(d.mtout)}q(e,d)}};var q=function(e,d){var c=jQuery.extend({},e);if(d.hoverIntent_t){d.hoverIntent_t=clearTimeout(d.hoverIntent_t)}if(e.type=="mouseover"){t=c.pageX;v=c.pageY;b(d).bind("mousemove",u);if(d.hoverIntent_s!=1){d.hoverIntent_t=setTimeout(function(){w(c,d)},g.interval)}}else{b(d).unbind("mousemove",u);if(d.hoverIntent_s==1){d.hoverIntent_t=setTimeout(function(){s(c,d)},g.timeout)}}};return this.mouseover(x).mouseout(x)}})(jQuery)}jQuery(document).ready(function(a){a("#wpadminbar").removeClass("nojq").removeClass("nojs").find("li.menupop").hoverIntent({over:function(b){a(this).addClass("hover")},out:function(b){a(this).removeClass("hover")},timeout:180,sensitivity:7,interval:100});a("#wp-admin-bar-get-shortlink").click(function(b){b.preventDefault();a(this).addClass("selected").children(".shortlink-input").blur(function(){a(this).parents("#wp-admin-bar-get-shortlink").removeClass("selected")}).focus().select()});a(".ab-top-menu > li > a").bind("focus.adminbar",function(){a(this).parent().addClass("hover").find("a").attr("tabindex","-1").attr("tabindex","1")});a(".ab-top-menu li ul li a").bind("blur.adminbar",function(){var b=a(this);setTimeout(function(){if(!b.parent().parent().find("a:focus").length){b.parents("li.menupop").removeClass("hover")}},200)})})}else{(function(i,k){var c=function(n,m,d){if(n.addEventListener){n.addEventListener(m,d,false)}else{if(n.attachEvent){n.attachEvent("on"+m,function(){return d.call(n,window.event)})}}},e,f=new RegExp("\\bhover\\b","g"),a=[],j=new RegExp("\\bselected\\b","g"),g=function(m){var d=a.length;while(d--){if(a[d]&&m==a[d][1]){return a[d][0]}}return false},h=function(s){var n,d,q,m,p,r,u=[],o=0;while(s&&s!=e&&s!=i){if("LI"==s.nodeName.toUpperCase()){u[u.length]=s;d=g(s);if(d){clearTimeout(d)}s.className=s.className?(s.className.replace(f,"")+" hover"):"hover";m=s}s=s.parentNode}if(m&&m.parentNode){p=m.parentNode;if(p&&"UL"==p.nodeName.toUpperCase()){n=p.childNodes.length;while(n--){r=p.childNodes[n];if(r!=m){r.className=r.className?r.className.replace(j,""):""}}}}n=a.length;while(n--){q=false;o=u.length;while(o--){if(u[o]==a[n][1]){q=true}}if(!q){a[n][1].className=a[n][1].className?a[n][1].className.replace(f,""):""}}},l=function(d){while(d&&d!=e&&d!=i){if("LI"==d.nodeName.toUpperCase()){(function(m){var n=setTimeout(function(){m.className=m.className?m.className.replace(f,""):""},500);a[a.length]=[n,m]})(d)}d=d.parentNode}},b=function(p){var n,d,o,m=p.target||p.srcElement;while(true){if(!m||m==i||m==e){return}if(m.id&&m.id=="wp-admin-bar-get-shortlink"){break}m=m.parentNode}if(p.preventDefault){p.preventDefault()}p.returnValue=false;if(-1==m.className.indexOf("selected")){m.className+=" selected"}for(n=0,d=m.childNodes.length;n<d;n++){o=m.childNodes[n];if(o.className&&-1!=o.className.indexOf("shortlink-input")){o.focus();o.select();o.onblur=function(){m.className=m.className?m.className.replace(j,""):""};break}}return false};c(k,"load",function(){e=i.getElementById("wpadminbar");if(i.body&&e){i.body.appendChild(e);if(e.className){e.className=e.className.replace(/nojs/,"")}c(e,"mouseover",function(d){h(d.target||d.srcElement)});c(e,"mouseout",function(d){l(d.target||d.srcElement)});c(e,"click",b)}if(k.location.hash){k.scrollBy(0,-32)}})})(document,window)};
|
|
@ -258,7 +258,7 @@ function wp_default_scripts( &$scripts ) {
|
|||
|
||||
$scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110628', 1 );
|
||||
|
||||
$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", false, '20110930', 1 );
|
||||
$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", false, '20111104', 1 );
|
||||
|
||||
$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wpdialogs' ), '20110929', 1 );
|
||||
$scripts->add_script_data( 'wplink', 'wpLinkL10n', array(
|
||||
|
@ -431,13 +431,13 @@ function wp_default_styles( &$styles ) {
|
|||
// Any rtl stylesheets that don't have a .dev version for ltr
|
||||
$no_suffix = array( 'farbtastic' );
|
||||
|
||||
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20111104' );
|
||||
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20111104a' );
|
||||
|
||||
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20111015' );
|
||||
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );
|
||||
|
||||
// all colors stylesheets need to have the same query strings (cache manifest compat)
|
||||
$colors_version = '20111103d';
|
||||
$colors_version = '20111104';
|
||||
|
||||
// Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string.
|
||||
$styles->add( 'colors', true, array('wp-admin'), $colors_version );
|
||||
|
@ -454,7 +454,7 @@ function wp_default_styles( &$styles ) {
|
|||
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
|
||||
$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20111104' );
|
||||
$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101224' );
|
||||
$styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20111102' );
|
||||
$styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20111104' );
|
||||
$styles->add( 'wp-pointer', "/wp-includes/css/wp-pointer$suffix.css", array(), '20111017' );
|
||||
|
||||
foreach ( $rtl_styles as $rtl_style ) {
|
||||
|
|
Loading…
Reference in New Issue