From 79c35059cefaa663c8bcba1f70e13d10ac4712b9 Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 14 Dec 2010 13:42:56 +0000 Subject: [PATCH] Fix admin bar styling when no avatars are in use. props ocean90, see #15611. git-svn-id: http://svn.automattic.com/wordpress/trunk@16913 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 10 ++++++---- wp-includes/css/admin-bar-rtl.css | 2 +- wp-includes/css/admin-bar-rtl.dev.css | 4 ++-- wp-includes/css/admin-bar.css | 2 +- wp-includes/css/admin-bar.dev.css | 8 +++++--- wp-includes/script-loader.php | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 6631f3dd1b..359a1296b6 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -79,14 +79,16 @@ function wp_admin_bar_my_account_menu() { if ( 0 != $user_id ) { /* Add the 'My Account' menu */ $avatar = get_avatar( get_current_user_id(), 16 ); - $wp_admin_bar->add_menu( array( 'id' => 'my-account', 'title' => $avatar . $user_identity, 'href' => get_edit_profile_url( $user_id ) ) ); + $id = ( ! empty( $avatar ) ) ? 'my-account-with-avatar' : 'my-account'; + + $wp_admin_bar->add_menu( array( 'id' => $id, 'title' => $avatar . $user_identity, 'href' => get_edit_profile_url( $user_id ) ) ); /* Add the "My Account" sub menus */ - $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) ); + $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) ); if ( is_multisite() ) - $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ), ) ); + $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ), ) ); else - $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Dashboard' ), 'href' => admin_url(), ) ); + $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Dashboard' ), 'href' => admin_url(), ) ); $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'title' => __( 'Log Out' ), 'href' => wp_logout_url(), ) ); } } diff --git a/wp-includes/css/admin-bar-rtl.css b/wp-includes/css/admin-bar-rtl.css index a1a21c57db..bf3013d11a 100644 --- a/wp-includes/css/admin-bar-rtl.css +++ b/wp-includes/css/admin-bar-rtl.css @@ -1 +1 @@ -#wpadminbar{background:#666 url(../images/admin-bar-sprite-rtl.png?d=08102010) 0 -222px repeat-x;direction:rtl;font-family:Tahoma,Arial,sans-serif;right:0;left:auto;}#wpadminbar .quicklinks ul{text-align:right;}#wpadminbar .quicklinks ul li{float:right;}#wpadminbar .quicklinks>ul>li>a{border-left:1px solid #686868;border-right:1px solid #808080;}#wpadminbar .quicklinks>ul>li:last-child>a{border-left:none;border-right:1px solid #808080;}#wpadminbar .quicklinks>ul>li:hover>a{border-right-color:#707070;border-left-color:#686868;}#wpadminbar .quicklinks li.ab-my-account a img.avatar{margin:-2px -5px 0 23px;}#wpadminbar .quicklinks li.ab-my-account ul{left:auto;right:30px;}#wpadminbar .quicklinks .menupop li:hover>ul,#wpadminbar .quicklinks .menupop li.hover>ul{margin-right:100%;margin-left:0;}#wpadminbar .quicklinks .menupop a>span{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) left -58px no-repeat;padding-right:0;padding-left:.8em;}#wpadminbar .quicklinks .menupop ul li a>span{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) left -29px no-repeat;padding-right:0;padding-left:1.5em;}#wpadminbar .quicklinks a{font-family:Tahoma,Arial,Helvetica,sans-serif;}#wpadminbar .quicklinks .menupop li a img.blavatar{margin-right:0;margin-left:8px;}#wpadminbar .quicklinks li.ab-my-account>a{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) top right no-repeat;}#wpadminbar .quicklinks li.ab-my-account>a{border-right:none;border-left:1px solid #686868;}#wpadminbar #adminbarsearch{float:left;}#wpadminbar #adminbarsearch .adminbar-input{float:right;font-family:Tahoma,Arial,Helvetica,sans-serif;margin-right:0;margin-left:3px;-moz-box-shadow:inset 2px -2px 1px #cdcdcd;-webkit-box-shadow:inset -2px 2px 1px #cdcdcd;box-shadow:inset 2px -2px 1px #cdcdcd;}#wpadminbar #adminbarsearch .adminbar-button{float:right;font-family:Tahoma,Arial,Helvetica,sans-serif;} \ No newline at end of file +#wpadminbar{background:#666 url(../images/admin-bar-sprite-rtl.png?d=08102010) 0 -222px repeat-x;direction:rtl;font-family:Tahoma,Arial,sans-serif;right:0;left:auto;}#wpadminbar .quicklinks ul{text-align:right;}#wpadminbar .quicklinks ul li{float:right;}#wpadminbar .quicklinks>ul>li>a{border-left:1px solid #686868;border-right:1px solid #808080;}#wpadminbar .quicklinks>ul>li:last-child>a{border-left:none;border-right:1px solid #808080;}#wpadminbar .quicklinks>ul>li:hover>a{border-right-color:#707070;border-left-color:#686868;}#wpadminbar .quicklinks li.ab-my-account-with-avatar a img{margin:-2px -5px 0 23px;}#wpadminbar .quicklinks li.ab-my-account-with-avatar ul{left:auto;right:30px;}#wpadminbar .quicklinks .menupop li:hover>ul,#wpadminbar .quicklinks .menupop li.hover>ul{margin-right:100%;margin-left:0;}#wpadminbar .quicklinks .menupop a>span{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) left -58px no-repeat;padding-right:0;padding-left:.8em;}#wpadminbar .quicklinks .menupop ul li a>span{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) left -29px no-repeat;padding-right:0;padding-left:1.5em;}#wpadminbar .quicklinks a{font-family:Tahoma,Arial,Helvetica,sans-serif;}#wpadminbar .quicklinks .menupop li a img.blavatar{margin-right:0;margin-left:8px;}#wpadminbar .quicklinks li.ab-my-account>a{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) top right no-repeat;}#wpadminbar .quicklinks li.ab-my-account>a{border-right:none;border-left:1px solid #686868;}#wpadminbar #adminbarsearch{float:left;}#wpadminbar #adminbarsearch .adminbar-input{float:right;font-family:Tahoma,Arial,Helvetica,sans-serif;margin-right:0;margin-left:3px;-moz-box-shadow:inset 2px -2px 1px #cdcdcd;-webkit-box-shadow:inset -2px 2px 1px #cdcdcd;box-shadow:inset 2px -2px 1px #cdcdcd;}#wpadminbar #adminbarsearch .adminbar-button{float:right;font-family:Tahoma,Arial,Helvetica,sans-serif;} \ No newline at end of file diff --git a/wp-includes/css/admin-bar-rtl.dev.css b/wp-includes/css/admin-bar-rtl.dev.css index ed95b7212a..9bb2903cd7 100644 --- a/wp-includes/css/admin-bar-rtl.dev.css +++ b/wp-includes/css/admin-bar-rtl.dev.css @@ -29,11 +29,11 @@ border-left-color: #686868; } -#wpadminbar .quicklinks li.ab-my-account a img.avatar { +#wpadminbar .quicklinks li.ab-my-account-with-avatar a img { margin: -2px -5px 0 23px; } -#wpadminbar .quicklinks li.ab-my-account ul { +#wpadminbar .quicklinks li.ab-my-account-with-avatar ul { left: auto; right: 30px; } diff --git a/wp-includes/css/admin-bar.css b/wp-includes/css/admin-bar.css index 466dd98f76..a665183747 100644 --- a/wp-includes/css/admin-bar.css +++ b/wp-includes/css/admin-bar.css @@ -1 +1 @@ -#wpadminbar{direction:ltr;background:#666;background:-moz-linear-gradient(bottom,#666,#7f7f7f);background:-webkit-gradient(linear,left bottom,left top,from(#666),to(#7f7f7f));color:#ddd;font:12px Arial,Helvetica,sans-serif;height:28px;margin:0;padding:0;position:fixed;top:0;left:0;width:100%;z-index:99999;min-width:960px;}#wpadminbar a,#wpadminbar a:hover{outline:none;border:none;text-decoration:none;}#wpadminbar ul,#wpadminbar ul li{background:none;list-style:none;margin:0;padding:0;position:relative;z-index:99999;}#wpadminbar .quicklinks ul{text-align:left;}#wpadminbar .quicklinks ul li{float:left;}#wpadminbar .quicklinks>ul>li>a{border-right:1px solid #686868;border-left:1px solid #808080;}#wpadminbar .quicklinks>ul>li:last-child>a{border-right:none;}#wpadminbar .quicklinks>ul>li:hover>a{border-left-color:#707070;}#wpadminbar .quicklinks a{color:#ddd;height:28px;text-shadow:#555 0 -1px 0;display:block;font:13px Arial,Helvetica,sans-serif;font-weight:normal;letter-spacing:normal;padding:0 .85em;line-height:28px;}#wpadminbar .quicklinks .menupop ul{-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);box-shadow:0 4px 8px rgba(0,0,0,0.1);background:#fff;background:rgba(255,255,255,0.97);display:none;position:absolute;border:1px solid #dfdfdf;border-top:none;float:none;}#wpadminbar .quicklinks .menupop ul li{float:none;}#wpadminbar .quicklinks .menupop ul li a{color:#555;text-shadow:none;font-weight:normal;white-space:nowrap;overflow:hidden;width:160px;}#wpadminbar .quicklinks .menupop ul li:hover>a{color:#fff;text-shadow:#666 0 -1px 0;}#wpadminbar .quicklinks li:hover>ul,#wpadminbar .quicklinks li.hover>ul{display:block;}#wpadminbar .quicklinks .menupop li:hover>ul,#wpadminbar .quicklinks .menupop li.hover>ul{margin-left:100%;margin-top:-28px;}#wpadminbar .quicklinks li:hover{background:#555;background:-moz-linear-gradient(bottom,#555,#3e3e3e);background:-webkit-gradient(linear,left bottom,left top,from(#555),to(#3e3e3e));}#wpadminbar .quicklinks .menupop li:hover{background:#888;background:-moz-linear-gradient(bottom,#888,#9d9d9d);background:-webkit-gradient(linear,left bottom,left top,from(#888),to(#9d9d9d));}#wpadminbar .quicklinks .menupop a>span{background:url(../images/admin-bar-sprite.png?d=11122010) right -58px no-repeat;padding-right:.8em;}#wpadminbar .quicklinks .menupop ul li a>span{display:block;background:url(../images/admin-bar-sprite.png?d=11122010) right -29px no-repeat;padding-right:1.5em;}#wpadminbar .quicklinks a span#ab-awaiting-mod,#wpadminbar .quicklinks a span#ab-updates{background:#eee;color:#333;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;}#wpadminbar .quicklinks a:hover span#ab-awaiting-mod,#wpadminbar .quicklinks a:hover span#ab-updates{background:#fff;color:#000;}#wpadminbar .quicklinks li.ab-my-account>a{border-left:none;background:url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;}#wpadminbar .quicklinks li.ab-my-account a img.avatar{border:1px solid #999;vertical-align:middle;margin:-2px 23px 0 -5px;background:#eee;}#wpadminbar .quicklinks li.ab-my-account ul{left:30px;}#wpadminbar .quicklinks .menupop li a img.blavatar{vertical-align:middle;margin-right:8px;}#wpadminbar #adminbarsearch{float:right;height:18px;padding:3px;}#wpadminbar #adminbarsearch .adminbar-input{width:140px;float:left;font:12px Arial,Helvetica,sans-serif;color:#555;text-shadow:0 1px 0 #fff;border:1px solid #626262;padding:2px 3px;margin:0 3px 0 0;background-color:#ddd;-moz-box-shadow:inset 2px 2px 1px #cdcdcd;-webkit-box-shadow:inset 2px 2px 1px #cdcdcd;box-shadow:inset 2px 2px 1px #cdcdcd;-webkit-border-radius:0;-khtml-border-radius:0;-moz-border-radius:0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;outline:none;}#wpadminbar #adminbarsearch .adminbar-button{font:bold 12px Arial,Helvetica,sans-serif;color:#444;text-shadow:0 1px 0 #eee;cursor:pointer;float:left;background:#aaa;background:-moz-linear-gradient(bottom,#aaa,#cecece);background:-webkit-gradient(linear,left bottom,left top,from(#aaa),to(#cecece));-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;border-radius:10px;border:1px solid #626262;padding:2px 13px;margin:0;}#wpadminbar #adminbarsearch .adminbar-button:active{background:#a0a0a0;background:-moz-linear-gradient(bottom,#a0a0a0,#c1c1c1);background:-webkit-gradient(linear,left bottom,left top,from(#a0a0a0),to(#c1c1c1));-moz-box-shadow:inset 1px 1px 1px #9b9b9b;-webkit-box-shadow:inset 1px 1px 1px #9b9b9b;box-shadow:inset 1px 1px 1px #9b9b9b;}#wpadminbar #adminbarsearch .adminbar-button:hover{color:#000;}#wpadminbar #adminbarsearch .adminbar-button::-moz-focus-inner{border:none;}* html #wpadminbar{overflow:hidden;position:absolute;}* html #wpadminbar .quicklinks ul li a{float:left;}* html #wpadminbar,* html #wpadminbar .menupop a span,* html #wpadminbar .quicklinks li,* html #wpadminbar .quicklinks li:hover{background-image:none;} \ No newline at end of file +#wpadminbar{direction:ltr;background:#666;background:-moz-linear-gradient(bottom,#666,#7f7f7f);background:-webkit-gradient(linear,left bottom,left top,from(#666),to(#7f7f7f));color:#ddd;font:12px Arial,Helvetica,sans-serif;height:28px;margin:0;padding:0;position:fixed;top:0;left:0;width:100%;z-index:99999;min-width:960px;}#wpadminbar a,#wpadminbar a:hover{outline:none;border:none;text-decoration:none;}#wpadminbar ul,#wpadminbar ul li{background:none;list-style:none;margin:0;padding:0;position:relative;z-index:99999;}#wpadminbar .quicklinks ul{text-align:left;}#wpadminbar .quicklinks ul li{float:left;}#wpadminbar .quicklinks>ul>li>a{border-right:1px solid #686868;border-left:1px solid #808080;}#wpadminbar .quicklinks>ul>li:last-child>a{border-right:none;}#wpadminbar .quicklinks>ul>li:hover>a{border-left-color:#707070;}#wpadminbar .quicklinks a{color:#ddd;height:28px;text-shadow:#555 0 -1px 0;display:block;font:13px Arial,Helvetica,sans-serif;font-weight:normal;letter-spacing:normal;padding:0 .85em;line-height:28px;}#wpadminbar .quicklinks .menupop ul{-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);box-shadow:0 4px 8px rgba(0,0,0,0.1);background:#fff;background:rgba(255,255,255,0.97);display:none;position:absolute;border:1px solid #dfdfdf;border-top:none;float:none;}#wpadminbar .quicklinks .menupop ul li{float:none;}#wpadminbar .quicklinks .menupop ul li a{color:#555;text-shadow:none;font-weight:normal;white-space:nowrap;overflow:hidden;width:160px;}#wpadminbar .quicklinks .menupop ul li:hover>a{color:#fff;text-shadow:#666 0 -1px 0;}#wpadminbar .quicklinks li:hover>ul,#wpadminbar .quicklinks li.hover>ul{display:block;}#wpadminbar .quicklinks .menupop li:hover>ul,#wpadminbar .quicklinks .menupop li.hover>ul{margin-left:100%;margin-top:-28px;}#wpadminbar .quicklinks li:hover{background:#555;background:-moz-linear-gradient(bottom,#555,#3e3e3e);background:-webkit-gradient(linear,left bottom,left top,from(#555),to(#3e3e3e));}#wpadminbar .quicklinks .menupop li:hover{background:#888;background:-moz-linear-gradient(bottom,#888,#9d9d9d);background:-webkit-gradient(linear,left bottom,left top,from(#888),to(#9d9d9d));}#wpadminbar .quicklinks .menupop a>span{background:url(../images/admin-bar-sprite.png?d=11122010) right -58px no-repeat;padding-right:.8em;}#wpadminbar .quicklinks .menupop ul li a>span{display:block;background:url(../images/admin-bar-sprite.png?d=11122010) right -29px no-repeat;padding-right:1.5em;}#wpadminbar .quicklinks a span#ab-awaiting-mod,#wpadminbar .quicklinks a span#ab-updates{background:#eee;color:#333;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;}#wpadminbar .quicklinks a:hover span#ab-awaiting-mod,#wpadminbar .quicklinks a:hover span#ab-updates{background:#fff;color:#000;}#wpadminbar .quicklinks li.ab-my-account-with-avatar>a{border-left:none;background:url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;}#wpadminbar .quicklinks li.ab-my-account-with-avatar>a img{display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 23px 0 -5px;padding:0;background:#eee;}#wpadminbar .quicklinks li.ab-my-account-with-avatar ul{left:30px;}#wpadminbar .quicklinks .menupop li a img.blavatar{vertical-align:middle;margin-right:8px;}#wpadminbar #adminbarsearch{float:right;height:18px;padding:3px;}#wpadminbar #adminbarsearch .adminbar-input{width:140px;float:left;font:12px Arial,Helvetica,sans-serif;color:#555;text-shadow:0 1px 0 #fff;border:1px solid #626262;padding:2px 3px;margin:0 3px 0 0;background-color:#ddd;-moz-box-shadow:inset 2px 2px 1px #cdcdcd;-webkit-box-shadow:inset 2px 2px 1px #cdcdcd;box-shadow:inset 2px 2px 1px #cdcdcd;-webkit-border-radius:0;-khtml-border-radius:0;-moz-border-radius:0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;outline:none;}#wpadminbar #adminbarsearch .adminbar-button{font:bold 12px Arial,Helvetica,sans-serif;color:#444;text-shadow:0 1px 0 #eee;cursor:pointer;float:left;background:#aaa;background:-moz-linear-gradient(bottom,#aaa,#cecece);background:-webkit-gradient(linear,left bottom,left top,from(#aaa),to(#cecece));-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;border-radius:10px;border:1px solid #626262;padding:2px 13px;margin:0;}#wpadminbar #adminbarsearch .adminbar-button:active{background:#a0a0a0;background:-moz-linear-gradient(bottom,#a0a0a0,#c1c1c1);background:-webkit-gradient(linear,left bottom,left top,from(#a0a0a0),to(#c1c1c1));-moz-box-shadow:inset 1px 1px 1px #9b9b9b;-webkit-box-shadow:inset 1px 1px 1px #9b9b9b;box-shadow:inset 1px 1px 1px #9b9b9b;}#wpadminbar #adminbarsearch .adminbar-button:hover{color:#000;}#wpadminbar #adminbarsearch .adminbar-button::-moz-focus-inner{border:none;}* html #wpadminbar{overflow:hidden;position:absolute;}* html #wpadminbar .quicklinks ul li a{float:left;}* html #wpadminbar,* html #wpadminbar .menupop a span,* html #wpadminbar .quicklinks li,* html #wpadminbar .quicklinks li:hover{background-image:none;} \ No newline at end of file diff --git a/wp-includes/css/admin-bar.dev.css b/wp-includes/css/admin-bar.dev.css index be6f1d5e46..bd769f3ffe 100644 --- a/wp-includes/css/admin-bar.dev.css +++ b/wp-includes/css/admin-bar.dev.css @@ -152,19 +152,21 @@ color: #000; } -#wpadminbar .quicklinks li.ab-my-account > a { +#wpadminbar .quicklinks li.ab-my-account-with-avatar > a { border-left: none; background: url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat; } -#wpadminbar .quicklinks li.ab-my-account a img.avatar { +#wpadminbar .quicklinks li.ab-my-account-with-avatar > a img { + display: inline; border: 1px solid #999; vertical-align: middle; margin: -2px 23px 0 -5px; + padding: 0; background: #eee; } -#wpadminbar .quicklinks li.ab-my-account ul { +#wpadminbar .quicklinks li.ab-my-account-with-avatar ul { left: 30px; } diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 76894cccc7..ddfcaebf31 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -516,7 +516,7 @@ function wp_default_styles( &$styles ) { $styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' ); $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' ); $styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100907' ); - $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20101213' ); + $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20101214' ); $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101119' ); $styles->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/css/wplink$suffix.css", array(), '20101206' );