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:
parent
b188bea4c8
commit
053fb714ba
|
@ -358,16 +358,21 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$awaiting_mod = wp_count_comments();
|
$awaiting_mod = wp_count_comments();
|
||||||
$awaiting_mod = number_format_i18n( $awaiting_mod->moderated );
|
$awaiting_mod = $awaiting_mod->moderated;
|
||||||
|
|
||||||
$bubble = "<div class='ab-comments-bubble'>";
|
$icon = "<div class='ab-comments-icon'>";
|
||||||
$bubble .= "<div class='ab-comments-count'>$awaiting_mod</div>";
|
$icon .= "<div class='ab-comments-icon-body'></div>";
|
||||||
$bubble .= "<div class='ab-comments-arrow'></div>";
|
$icon .= "<div class='ab-comments-icon-arrow'></div>";
|
||||||
$bubble .= "</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(
|
$wp_admin_bar->add_menu( array(
|
||||||
'id' => 'comments',
|
'id' => 'comments',
|
||||||
'title' => $bubble,
|
'title' => $icon . $title,
|
||||||
'href' => admin_url('edit-comments.php'),
|
'href' => admin_url('edit-comments.php'),
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -345,42 +345,40 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comments bubble
|
* Comments icon
|
||||||
*/
|
*/
|
||||||
#wpadminbar .ab-comments-bubble {
|
#wpadminbar .ab-comments-icon {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
|
float: left;
|
||||||
}
|
}
|
||||||
#wpadminbar .ab-comments-count {
|
#wpadminbar .ab-comments-icon-body {
|
||||||
background: #ccc;
|
margin: 3px 4px 0 -2px;
|
||||||
color: #555;
|
background: #999;
|
||||||
text-shadow: none;
|
height: 10px;
|
||||||
height: 1.2em;
|
width: 14px;
|
||||||
line-height: 1.2em;
|
|
||||||
padding: 0 8px 0;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
-moz-border-radius: 10px;
|
-moz-border-radius: 10px;
|
||||||
-khtml-border-radius: 10px;
|
-khtml-border-radius: 10px;
|
||||||
-webkit-border-radius: 10px;
|
-webkit-border-radius: 10px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wpadminbar a:hover .ab-comments-count {
|
#wpadminbar a:hover .ab-comments-icon-body {
|
||||||
background: #bbb;
|
background: #bbb;
|
||||||
color: #333;
|
color: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wpadminbar a .ab-comments-arrow {
|
#wpadminbar a .ab-comments-icon-arrow {
|
||||||
height: 0;
|
height: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -4px;
|
bottom: -3px;
|
||||||
left: 6px;
|
left: 1px;
|
||||||
/* Use transparent borders to form a triangle */
|
/* Use transparent borders to form a triangle */
|
||||||
border-left: 5px solid #ccc;
|
border-left: 4px solid #999;
|
||||||
border-bottom: 5px solid transparent;
|
border-bottom: 4px solid transparent;
|
||||||
}
|
}
|
||||||
#wpadminbar a:hover .ab-comments-arrow {
|
#wpadminbar a:hover .ab-comments-icon-arrow {
|
||||||
border-left-color: #bbb;
|
border-left-color: #bbb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -423,7 +423,7 @@ function wp_default_styles( &$styles ) {
|
||||||
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' );
|
$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( '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( '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( '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' );
|
$styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20110802' );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue