Admin menu: add generic icon, fix hover in IE, speed up response timing

git-svn-id: http://svn.automattic.com/wordpress/trunk@9182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-10-15 06:54:25 +00:00
parent 7ae1291c12
commit 546ef3ed15
7 changed files with 54 additions and 40 deletions

View File

@ -355,17 +355,20 @@ h3.dashboard-widget-title small a:hover {
}
/* Because we don't want visited on these links */
#adminmenu li.current a, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
background-color: #fff;
border-color: #c6d9e9;
border-bottom-color: #fff;
color: #d54e21;
}
#adminmenu li.current a, #sidemenu a.current {
background-color: #fff;
color: #d54e21;
}
#adminmenu li.current {
background-color: #fff;
border-color: #c6d9e9;
border-right-color: #fff;
}
#adminmenu li a #awaiting-mod {

View File

@ -21,39 +21,42 @@ input.button, input.button-secondary, input.button-highlighted {
z-index: 1;
}
#adminmenu.folded .wp-submenu {
margin: -1px 0 0 4px;
}
#adminmenu li.wp-has-submenu {
margin-top: 2px;
margin: 2px 0;
}
#adminmenu.folded li.wp-has-submenu {
height: 24px;
}
* html #wpcontent #adminmenu ul.wp-submenu li {
margin: 0;
padding: 0;
}
* html #wpcontent #adminmenu ul.wp-submenu a {
#wpcontent #adminmenu ul.wp-submenu a {
padding: 2px 4px 2px 8px;
margin: 0;
line-height: 20px;
}
* html #wpcontent #adminmenu ul.wp-submenu li a.current,
* html #wpcontent #adminmenu ul.wp-submenu li.current {
border: 0;
background-color: #fff;
ul.wp-submenu, ul.wp-submenu li, ul.wp-submenu a {
display: block;
zoom: 100%;
}
* html #wpcontent #adminmenu {
margin: 8px 4px;
}
#wpcontent #adminmenu ul.wp-submenu li {
padding: 0;
}
ul#adminmenu li.wp-menu-separator {
background-color: #fff;
height: 5px;
width: 1px;
line-height: 5px;
font-size: 5px;
padding: 0;
margin: 0;
height: 3px;
line-height: 3px;
font-size: 3px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

View File

@ -492,7 +492,7 @@ function uninstall_plugin($plugin) {
// Menu
//
function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) {
global $menu, $admin_page_hooks;
$file = plugin_basename( $file );
@ -503,7 +503,10 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio
if (!empty ( $function ) && !empty ( $hookname ))
add_action( $hookname, $function );
$menu[] = array ( $menu_title, $access_level, $file, $page_title, $hookname, $hookname );
if ( empty($icon_url) )
$icon_url = 'images/menu/generic.png';
$menu[] = array ( $menu_title, $access_level, $file, $page_title, $hookname, $hookname, $icon_url );
return $hookname;
}

View File

@ -3,6 +3,7 @@
adminMenu = {
init : function() {
$('#adminmenu a').attr('tabindex', '10');
$('#adminmenu a.wp-has-submenu').click( function() { return adminMenu.toggle( $(this).siblings('ul') ); } );
var li = document.createElement('li'); // temp
@ -51,18 +52,18 @@ adminMenu = {
if (off) {
$('#wpbody-content').css('marginLeft', '140px');
$('#adminmenu').removeClass('folded');
$('#adminmenu li.wp-has-submenu').unbind().css('width', '125px');
$('#adminmenu a.wp-has-submenu').unbind().click( function() { return adminMenu.toggle( $(this).siblings('ul') ); } );
$('#adminmenu a.wp-has-submenu').show();
$('#adminmenu li.wp-has-submenu').unbind().css('width', '');
} else {
$('#adminmenu').addClass('folded');
$('#adminmenu a.wp-has-submenu').hide();
$('#adminmenu .wp-submenu').hide();
$('#wpbody-content').css('marginLeft', '38px');
$('#adminmenu a.wp-has-submenu').unbind().click(function(){return false;});
$('#adminmenu li.wp-has-submenu').css({'width':'24px'}).hoverIntent({
over: function(){ $(this).find('.wp-submenu').show(100); },
out: function(){ $(this).find('.wp-submenu').hide(100); },
timeout: 150,
sensitivity: 6,
over: function(){ $(this).find('.wp-submenu').show(); },
out: function(){ $(this).find('.wp-submenu').hide(); },
timeout: 220,
sensitivity: 8,
interval: 100
});
}

View File

@ -95,6 +95,8 @@ $menu[50] = array( __('Settings'), 'manage_options', 'options-general.php', '',
$submenu['options-general.php'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$submenu['options-general.php'][45] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
$menu[55] = array( '', 'read', '', '', 'wp-menu-separator' );
// Back-compat for old top-levels
$_wp_real_parent_file['post.php'] = 'post-new.php';
$_wp_real_parent_file['edit.php'] = 'post-new.php';

View File

@ -488,7 +488,7 @@ div.nav {
border-style: solid;
}
.page-numbers.current {
#tablenav-pages .page-numbers.current {
font-weight: bold;
border-width: 1px;
border-style: solid;
@ -677,7 +677,6 @@ ul#adminmenu li.write-new-button a {
/* side admin menu */
#adminmenu {
margin: 0;
padding: 0;
list-style: none;
}
@ -724,7 +723,7 @@ ul#adminmenu li.write-new-button a {
#adminmenu .wp-menu-image {
float: left;
padding: 4px 6px 0 4px;
padding: 4px 4px 0;
}
#adminmenu ul.wp-submenu li.current {
@ -732,32 +731,35 @@ ul#adminmenu li.write-new-button a {
}
#adminmenu a {
font-size: 13px !important;
padding: 5px 4px 6px 0;
line-height: 13px;
display: block;
font-size: 13px !important;
line-height: 18px;
padding: 3px 4px;
}
#adminmenu .wp-submenu a {
margin: 0 0 0 12px;
margin: 0;
padding-left: 12px;
}
#adminmenu .wp-menu-separator {
background-color: transparent;
height: 8px;
height: 6px;
width: 1px;
padding: 0;
margin: 0;
}
#adminmenu.folded .wp-submenu {
position: absolute;
margin: -25px 0 0 30px;
zIndex: 999;
margin: -1px 0 0 30px;
z-index: 999;
width: 125px;
border-width: 1px;
border-style: solid;
background-color: #fff;
border-color: #C6D9E9;
}
@ -766,7 +768,7 @@ ul#adminmenu li.write-new-button a {
}
#adminmenu.folded .wp-submenu a {
margin: 0 0 0 10px;
padding-left: 10px;
}
#adminmenu.folded a.wp-has-submenu {