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:
parent
7ae1291c12
commit
546ef3ed15
|
@ -355,17 +355,20 @@ h3.dashboard-widget-title small a:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Because we don't want visited on these links */
|
/* 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;
|
background-color: #fff;
|
||||||
border-color: #c6d9e9;
|
border-color: #c6d9e9;
|
||||||
border-bottom-color: #fff;
|
border-bottom-color: #fff;
|
||||||
color: #d54e21;
|
color: #d54e21;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#adminmenu li.current a, #sidemenu a.current {
|
||||||
|
background-color: #fff;
|
||||||
|
color: #d54e21;
|
||||||
|
}
|
||||||
|
|
||||||
#adminmenu li.current {
|
#adminmenu li.current {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-color: #c6d9e9;
|
|
||||||
border-right-color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu li a #awaiting-mod {
|
#adminmenu li a #awaiting-mod {
|
||||||
|
|
|
@ -21,39 +21,42 @@ input.button, input.button-secondary, input.button-highlighted {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#adminmenu.folded .wp-submenu {
|
||||||
|
margin: -1px 0 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
#adminmenu li.wp-has-submenu {
|
#adminmenu li.wp-has-submenu {
|
||||||
margin-top: 2px;
|
margin: 2px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu.folded li.wp-has-submenu {
|
#adminmenu.folded li.wp-has-submenu {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
* html #wpcontent #adminmenu ul.wp-submenu li {
|
#wpcontent #adminmenu ul.wp-submenu a {
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
* html #wpcontent #adminmenu ul.wp-submenu a {
|
|
||||||
padding: 2px 4px 2px 8px;
|
padding: 2px 4px 2px 8px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
* html #wpcontent #adminmenu ul.wp-submenu li a.current,
|
ul.wp-submenu, ul.wp-submenu li, ul.wp-submenu a {
|
||||||
* html #wpcontent #adminmenu ul.wp-submenu li.current {
|
display: block;
|
||||||
border: 0;
|
zoom: 100%;
|
||||||
background-color: #fff;
|
}
|
||||||
|
|
||||||
|
* html #wpcontent #adminmenu {
|
||||||
|
margin: 8px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wpcontent #adminmenu ul.wp-submenu li {
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul#adminmenu li.wp-menu-separator {
|
ul#adminmenu li.wp-menu-separator {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 5px;
|
height: 3px;
|
||||||
width: 1px;
|
line-height: 3px;
|
||||||
line-height: 5px;
|
font-size: 3px;
|
||||||
font-size: 5px;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 896 B |
|
@ -492,7 +492,7 @@ function uninstall_plugin($plugin) {
|
||||||
// Menu
|
// 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;
|
global $menu, $admin_page_hooks;
|
||||||
|
|
||||||
$file = plugin_basename( $file );
|
$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 ))
|
if (!empty ( $function ) && !empty ( $hookname ))
|
||||||
add_action( $hookname, $function );
|
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;
|
return $hookname;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
adminMenu = {
|
adminMenu = {
|
||||||
|
|
||||||
init : function() {
|
init : function() {
|
||||||
|
$('#adminmenu a').attr('tabindex', '10');
|
||||||
$('#adminmenu a.wp-has-submenu').click( function() { return adminMenu.toggle( $(this).siblings('ul') ); } );
|
$('#adminmenu a.wp-has-submenu').click( function() { return adminMenu.toggle( $(this).siblings('ul') ); } );
|
||||||
|
|
||||||
var li = document.createElement('li'); // temp
|
var li = document.createElement('li'); // temp
|
||||||
|
@ -51,18 +52,18 @@ adminMenu = {
|
||||||
if (off) {
|
if (off) {
|
||||||
$('#wpbody-content').css('marginLeft', '140px');
|
$('#wpbody-content').css('marginLeft', '140px');
|
||||||
$('#adminmenu').removeClass('folded');
|
$('#adminmenu').removeClass('folded');
|
||||||
$('#adminmenu li.wp-has-submenu').unbind().css('width', '125px');
|
$('#adminmenu a.wp-has-submenu').show();
|
||||||
$('#adminmenu a.wp-has-submenu').unbind().click( function() { return adminMenu.toggle( $(this).siblings('ul') ); } );
|
$('#adminmenu li.wp-has-submenu').unbind().css('width', '');
|
||||||
} else {
|
} else {
|
||||||
$('#adminmenu').addClass('folded');
|
$('#adminmenu').addClass('folded');
|
||||||
|
$('#adminmenu a.wp-has-submenu').hide();
|
||||||
$('#adminmenu .wp-submenu').hide();
|
$('#adminmenu .wp-submenu').hide();
|
||||||
$('#wpbody-content').css('marginLeft', '38px');
|
$('#wpbody-content').css('marginLeft', '38px');
|
||||||
$('#adminmenu a.wp-has-submenu').unbind().click(function(){return false;});
|
|
||||||
$('#adminmenu li.wp-has-submenu').css({'width':'24px'}).hoverIntent({
|
$('#adminmenu li.wp-has-submenu').css({'width':'24px'}).hoverIntent({
|
||||||
over: function(){ $(this).find('.wp-submenu').show(100); },
|
over: function(){ $(this).find('.wp-submenu').show(); },
|
||||||
out: function(){ $(this).find('.wp-submenu').hide(100); },
|
out: function(){ $(this).find('.wp-submenu').hide(); },
|
||||||
timeout: 150,
|
timeout: 220,
|
||||||
sensitivity: 6,
|
sensitivity: 8,
|
||||||
interval: 100
|
interval: 100
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
|
||||||
$submenu['options-general.php'][45] = array(__('Miscellaneous'), 'manage_options', 'options-misc.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
|
// Back-compat for old top-levels
|
||||||
$_wp_real_parent_file['post.php'] = 'post-new.php';
|
$_wp_real_parent_file['post.php'] = 'post-new.php';
|
||||||
$_wp_real_parent_file['edit.php'] = 'post-new.php';
|
$_wp_real_parent_file['edit.php'] = 'post-new.php';
|
||||||
|
|
|
@ -488,7 +488,7 @@ div.nav {
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-numbers.current {
|
#tablenav-pages .page-numbers.current {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
|
@ -677,7 +677,6 @@ ul#adminmenu li.write-new-button a {
|
||||||
|
|
||||||
/* side admin menu */
|
/* side admin menu */
|
||||||
#adminmenu {
|
#adminmenu {
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
@ -724,7 +723,7 @@ ul#adminmenu li.write-new-button a {
|
||||||
|
|
||||||
#adminmenu .wp-menu-image {
|
#adminmenu .wp-menu-image {
|
||||||
float: left;
|
float: left;
|
||||||
padding: 4px 6px 0 4px;
|
padding: 4px 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu ul.wp-submenu li.current {
|
#adminmenu ul.wp-submenu li.current {
|
||||||
|
@ -732,32 +731,35 @@ ul#adminmenu li.write-new-button a {
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu a {
|
#adminmenu a {
|
||||||
font-size: 13px !important;
|
|
||||||
padding: 5px 4px 6px 0;
|
|
||||||
line-height: 13px;
|
|
||||||
display: block;
|
display: block;
|
||||||
|
font-size: 13px !important;
|
||||||
|
line-height: 18px;
|
||||||
|
padding: 3px 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu .wp-submenu a {
|
#adminmenu .wp-submenu a {
|
||||||
margin: 0 0 0 12px;
|
margin: 0;
|
||||||
|
padding-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu .wp-menu-separator {
|
#adminmenu .wp-menu-separator {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
height: 8px;
|
height: 6px;
|
||||||
|
width: 1px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu.folded .wp-submenu {
|
#adminmenu.folded .wp-submenu {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin: -25px 0 0 30px;
|
margin: -1px 0 0 30px;
|
||||||
zIndex: 999;
|
z-index: 999;
|
||||||
width: 125px;
|
width: 125px;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
|
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
border-color: #C6D9E9;
|
border-color: #C6D9E9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -766,7 +768,7 @@ ul#adminmenu li.write-new-button a {
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu.folded .wp-submenu a {
|
#adminmenu.folded .wp-submenu a {
|
||||||
margin: 0 0 0 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#adminmenu.folded a.wp-has-submenu {
|
#adminmenu.folded a.wp-has-submenu {
|
||||||
|
|
Loading…
Reference in New Issue