Improve comments item in admin bar. see #18197.

git-svn-id: http://svn.automattic.com/wordpress/trunk@18696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
koopersmith 2011-09-17 01:11:52 +00:00
parent b188bea4c8
commit 053fb714ba
4 changed files with 36 additions and 33 deletions

View File

@ -358,16 +358,21 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
return;
$awaiting_mod = wp_count_comments();
$awaiting_mod = number_format_i18n( $awaiting_mod->moderated );
$awaiting_mod = $awaiting_mod->moderated;
$bubble = "<div class='ab-comments-bubble'>";
$bubble .= "<div class='ab-comments-count'>$awaiting_mod</div>";
$bubble .= "<div class='ab-comments-arrow'></div>";
$bubble .= "</div>";
$icon = "<div class='ab-comments-icon'>";
$icon .= "<div class='ab-comments-icon-body'></div>";
$icon .= "<div class='ab-comments-icon-arrow'></div>";
$icon .= "</div>";
if ( $awaiting_mod )
$title = sprintf( _n('%d Comment', '%d Comments', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
else
$title = __('Comments');
$wp_admin_bar->add_menu( array(
'id' => 'comments',
'title' => $bubble,
'title' => $icon . $title,
'href' => admin_url('edit-comments.php'),
) );
}

File diff suppressed because one or more lines are too long

View File

@ -345,42 +345,40 @@
}
/**
* Comments bubble
* Comments icon
*/
#wpadminbar .ab-comments-bubble {
#wpadminbar .ab-comments-icon {
position: relative;
padding-top: 5px;
float: left;
}
#wpadminbar .ab-comments-count {
background: #ccc;
color: #555;
text-shadow: none;
height: 1.2em;
line-height: 1.2em;
padding: 0 8px 0;
font-size: 12px;
font-weight: bold;
#wpadminbar .ab-comments-icon-body {
margin: 3px 4px 0 -2px;
background: #999;
height: 10px;
width: 14px;
-moz-border-radius: 10px;
-khtml-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
#wpadminbar a:hover .ab-comments-count {
#wpadminbar a:hover .ab-comments-icon-body {
background: #bbb;
color: #333;
color: #555;
}
#wpadminbar a .ab-comments-arrow {
#wpadminbar a .ab-comments-icon-arrow {
height: 0;
position: absolute;
bottom: -4px;
left: 6px;
bottom: -3px;
left: 1px;
/* Use transparent borders to form a triangle */
border-left: 5px solid #ccc;
border-bottom: 5px solid transparent;
border-left: 4px solid #999;
border-bottom: 4px solid transparent;
}
#wpadminbar a:hover .ab-comments-arrow {
#wpadminbar a:hover .ab-comments-icon-arrow {
border-left-color: #bbb;
}

View File

@ -423,7 +423,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' );
$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( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20110916' );
$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20110916b' );
$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(), '20110802' );