Improved no-js styles

git-svn-id: http://svn.automattic.com/wordpress/trunk@10869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-04-04 17:07:31 +00:00
parent a4c45667e1
commit 7160187ec2
8 changed files with 35 additions and 42 deletions

View File

@ -59,28 +59,24 @@ do_action("admin_head-$hook_suffix");
do_action('admin_head'); do_action('admin_head');
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
?>
<noscript> if ( $is_iphone ) { ?>
<style type="text/css">
.hide-if-no-js{display:none}
.hide-if-js,.closed .inside{display:block}
</style>
</noscript>
<script type="text/javascript">
//<![CDATA[
(function(){
var ns = document.getElementsByTagName('noscript');
if ( ns && (ns = ns[0]) ) ns.parentNode.removeChild(ns);
})();
//]]>
</script>
<?php if ( $is_iphone ) { ?>
<style type="text/css">.row-actions{visibility:visible;}</style> <style type="text/css">.row-actions{visibility:visible;}</style>
<?php } ?> <?php } ?>
</head> </head>
<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>"> <body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
<script type="text/javascript">
//<![CDATA[
(function(){
var c = document.body.className;
c = c.replace(/no-js/, 'js');
<?php if ( get_user_setting('mfold') == 'f' ) { ?>
c += ' folded';
<?php } ?>
document.body.className = c;
})();
//]]>
</script>
<div id="wpwrap"> <div id="wpwrap">
<div id="wpcontent"> <div id="wpcontent">
@ -118,10 +114,6 @@ if ( function_exists('mb_strlen') ) {
</div> </div>
</div> </div>
<?php if ( get_user_setting('mfold') == 'f' ) { ?>
<script type="text/javascript">jQuery('#wpcontent').addClass('folded');</script>
<?php } ?>
<div id="wpbody"> <div id="wpbody">
<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?> <?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>

View File

@ -185,8 +185,9 @@ table {
} }
.hidden, .hidden,
.closed .inside, .js .closed .inside,
.hide-if-js { .js .hide-if-js,
.no-js .hide-if-no-js {
display: none; display: none;
} }

View File

@ -42,7 +42,7 @@ input.button-highlighted {
margin-left: -80px; margin-left: -80px;
} }
* html div.folded #adminmenu { * html .folded #adminmenu {
margin-left: -22px; margin-left: -22px;
} }
@ -56,8 +56,9 @@ input.button-highlighted {
margin: 0; margin: 0;
} }
#wpcontent.folded #adminmenu li.menu-top { .folded #adminmenu li.menu-top {
display: block; display: block;
zoom: 100%;
} }
ul#adminmenu { ul#adminmenu {
@ -100,7 +101,7 @@ ul#adminmenu {
zoom: 100%; zoom: 100%;
} }
#wpcontent.folded #adminmenu li.wp-menu-separator { .folded #adminmenu li.wp-menu-separator {
width: 28px; width: 28px;
} }
@ -109,7 +110,7 @@ ul#adminmenu {
zoom: 100%; zoom: 100%;
} }
#wpcontent.folded #adminmenu .menu-top { .folded #adminmenu .menu-top {
height: 30px; height: 30px;
} }

View File

@ -14,7 +14,7 @@ adminMenu = {
this.favorites(); this.favorites();
$('.wp-menu-separator').click(function(){ $('.wp-menu-separator').click(function(){
if ( $('#wpcontent').hasClass('folded') ) { if ( $('body').hasClass('folded') ) {
adminMenu.fold(1); adminMenu.fold(1);
setUserSetting( 'mfold', 'o' ); setUserSetting( 'mfold', 'o' );
} else { } else {
@ -54,10 +54,10 @@ adminMenu = {
fold : function(off) { fold : function(off) {
if (off) { if (off) {
$('#wpcontent').removeClass('folded'); $('body').removeClass('folded');
$('#adminmenu li.wp-has-submenu').unbind(); $('#adminmenu li.wp-has-submenu').unbind();
} else { } else {
$('#wpcontent').addClass('folded'); $('body').addClass('folded');
$('#adminmenu li.wp-has-submenu').hoverIntent({ $('#adminmenu li.wp-has-submenu').hoverIntent({
over: function(e){ over: function(e){
var m = $(this).find('.wp-submenu'), t = e.clientY, H = $(window).height(), h = m.height(), o; var m = $(this).find('.wp-submenu'), t = e.clientY, H = $(window).height(), h = m.height(), o;
@ -119,13 +119,11 @@ $(document).ready(function(){columns.init();});
screenOptions = { screenOptions = {
init : function() { init : function() {
$('.screen-option').change(function() { $('.screen-option').change(function() {
var option = $(this).map(function() { return this.id; }).get(); var option = $(this).map(function() { return this.id; }).get(), value = $(this).val();
var value = $(this).val();
screenOptions.save_screen_option(option, value); screenOptions.save_screen_option(option, value);
}); });
$('.screen-option').submit(function() { $('.screen-option').submit(function() {
var option = $(this).map(function() { return this.id; }).get(); var option = $(this).map(function() { return this.id; }).get(), value = $(this).val();
var value = $(this).val();
screenOptions.save_screen_option(option, value); screenOptions.save_screen_option(option, value);
}); });
}, },

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@ $menu[0] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top', 'menu-da
$menu[4] = array( '', 'read', '', '', 'wp-menu-separator' ); $menu[4] = array( '', 'read', '', '', 'wp-menu-separator' );
$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'wp-menu-open menu-top', 'menu-posts', 'div' ); $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top', 'menu-posts', 'div' );
$submenu['edit.php'][5] = array( __('Edit'), 'edit_posts', 'edit.php' ); $submenu['edit.php'][5] = array( __('Edit'), 'edit_posts', 'edit.php' );
/* translators: add new post */ /* translators: add new post */
$submenu['edit.php'][10] = array( _x('Add New', 'post'), 'edit_posts', 'post-new.php' ); $submenu['edit.php'][10] = array( _x('Add New', 'post'), 'edit_posts', 'post-new.php' );

View File

@ -871,7 +871,8 @@ div.comment-item:hover .row-actions {
display: none; display: none;
} }
#adminmenu li.wp-menu-open .wp-submenu { #adminmenu li.wp-menu-open .wp-submenu,
.no-js #adminmenu .open-if-no-js .wp-submenu {
display: block; display: block;
} }

View File

@ -60,7 +60,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' ); $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090327' ); $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090404' );
$scripts->add_data( 'common', 'group', 1 ); $scripts->add_data( 'common', 'group', 1 );
$scripts->localize( 'common', 'commonL10n', array( $scripts->localize( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete."), 'warnDelete' => __("You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),
@ -425,10 +425,10 @@ function wp_default_styles( &$styles ) {
$rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' ); $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' );
$styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090403' ); $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090404' );
$styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' );
$styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20081210' ); $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20090404' );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' ); $styles->add_data( 'ie', 'conditional', 'lte IE 7' );
$styles->add( 'colors', true, array(), '20081210' ); // Register "meta" stylesheet for admin colors $styles->add( 'colors', true, array(), '20081210' ); // Register "meta" stylesheet for admin colors
@ -437,7 +437,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'colors-classic', '/wp-admin/css/colors-classic.css', array(), '20081210'); $styles->add( 'colors-classic', '/wp-admin/css/colors-classic.css', array(), '20081210');
$styles->add_data( 'colors-classic', 'rtl', true ); $styles->add_data( 'colors-classic', 'rtl', true );
$styles->add( 'global', '/wp-admin/css/global.css', array(), '20090403' ); $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090404' );
$styles->add( 'media', '/wp-admin/css/media.css', array(), '20090325' ); $styles->add( 'media', '/wp-admin/css/media.css', array(), '20090325' );
$styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20081210' ); $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20081210' );
$styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20090305' ); $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20090305' );