From 4de1815c6759adec512428cc7c4a080d9d2266d8 Mon Sep 17 00:00:00 2001 From: koopersmith Date: Wed, 9 Nov 2011 19:12:48 +0000 Subject: [PATCH] Add secondary flag to admin bar. fixes #19136. git-svn-id: http://svn.automattic.com/wordpress/trunk@19230 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 135 +++++++++++------------------ wp-includes/class-wp-admin-bar.php | 81 +++++++++++------ wp-includes/css/admin-bar.css | 2 +- wp-includes/css/admin-bar.dev.css | 38 ++++---- wp-includes/script-loader.php | 2 +- 5 files changed, 123 insertions(+), 135 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index b5b0d6a59f..c97529e8f2 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -91,46 +91,40 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) { ) ); } - // Add secondary menu. - $wp_admin_bar->add_menu( array( - 'parent' => 'wp-logo', - 'id' => 'wp-logo-secondary', - 'title' => ' ', - 'meta' => array( - 'class' => 'secondary', - ), - ) ); - // Add WordPress.org link $wp_admin_bar->add_menu( array( - 'parent' => 'wp-logo-secondary', - 'id' => 'wporg', - 'title' => __('WordPress.org'), - 'href' => __('http://wordpress.org'), + 'parent' => 'wp-logo', + 'secondary' => true, + 'id' => 'wporg', + 'title' => __('WordPress.org'), + 'href' => __('http://wordpress.org'), ) ); // Add codex link $wp_admin_bar->add_menu( array( - 'parent' => 'wp-logo-secondary', - 'id' => 'documentation', - 'title' => __('Documentation'), - 'href' => __('http://codex.wordpress.org'), + 'parent' => 'wp-logo', + 'secondary' => true, + 'id' => 'documentation', + 'title' => __('Documentation'), + 'href' => __('http://codex.wordpress.org'), ) ); // Add forums link $wp_admin_bar->add_menu( array( - 'parent' => 'wp-logo-secondary', - 'id' => 'support-forums', - 'title' => __('Support Forums'), - 'href' => __('http://wordpress.org/support/'), + 'parent' => 'wp-logo', + 'secondary' => true, + 'id' => 'support-forums', + 'title' => __('Support Forums'), + 'href' => __('http://wordpress.org/support/'), ) ); // Add feedback link $wp_admin_bar->add_menu( array( - 'parent' => 'wp-logo-secondary', - 'id' => 'feedback', - 'title' => __('Feedback'), - 'href' => __('http://wordpress.org/support/forum/requests-and-feedback'), + 'parent' => 'wp-logo', + 'secondary' => true, + 'id' => 'feedback', + 'title' => __('Feedback'), + 'href' => __('http://wordpress.org/support/forum/requests-and-feedback'), ) ); } @@ -150,17 +144,15 @@ function wp_admin_bar_my_account_menu( $wp_admin_bar ) { /* Add the 'My Account' menu */ $avatar = get_avatar( $user_id, 28 ); $howdy = sprintf( __('Howdy, %1$s'), $user_identity ); - $class = 'opposite'; - - if ( ! empty( $avatar ) ) - $class .= ' with-avatar'; + $class = empty( $avatar ) ? '' : 'with-avatar'; $wp_admin_bar->add_menu( array( - 'id' => 'my-account', - 'title' => $howdy . $avatar, - 'href' => $profile_url, - 'meta' => array( - 'class' => $class, + 'id' => 'my-account', + 'secondary' => true, + 'title' => $howdy . $avatar, + 'href' => $profile_url, + 'meta' => array( + 'class' => $class, ), ) ); @@ -322,17 +314,6 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) { ) ); } - if ( $wp_admin_bar->user->blogs ) { - $wp_admin_bar->add_menu( array( - 'parent' => 'my-sites', - 'id' => 'my-sites-secondary', - 'title' => ' ', - 'meta' => array( - 'class' => 'secondary', - ), - ) ); - } - // Add blog links $blue_wp_logo_url = includes_url('images/wpmini-blue.png'); @@ -345,10 +326,11 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) { $menu_id = 'blog-' . $blog->userblog_id; $wp_admin_bar->add_menu( array( - 'parent' => 'my-sites-secondary', - 'id' => $menu_id, - 'title' => $blavatar . $blogname, - 'href' => get_admin_url( $blog->userblog_id ), + 'parent' => 'my-sites', + 'secondary' => true, + 'id' => $menu_id, + 'title' => $blavatar . $blogname, + 'href' => get_admin_url( $blog->userblog_id ), ) ); $wp_admin_bar->add_menu( array( @@ -473,23 +455,23 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { * @since 3.1.0 */ function wp_admin_bar_new_content_menu( $wp_admin_bar ) { - $primary = $secondary = array(); + $actions = array(); $cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' ); if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->edit_posts ) ) { - $primary[ 'post-new.php' ] = array( $cpts['post']->labels->name_admin_bar, 'new-post' ); + $actions[ 'post-new.php' ] = array( $cpts['post']->labels->name_admin_bar, 'new-post' ); unset( $cpts['post'] ); } if ( current_user_can( 'upload_files' ) ) - $primary[ 'media-new.php' ] = array( _x( 'Media', 'add new from admin bar' ), 'new-media' ); + $actions[ 'media-new.php' ] = array( _x( 'Media', 'add new from admin bar' ), 'new-media' ); if ( current_user_can( 'manage_links' ) ) - $primary[ 'link-add.php' ] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' ); + $actions[ 'link-add.php' ] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' ); if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->edit_posts ) ) { - $primary[ 'post-new.php?post_type=page' ] = array( $cpts['page']->labels->name_admin_bar, 'new-page' ); + $actions[ 'post-new.php?post_type=page' ] = array( $cpts['page']->labels->name_admin_bar, 'new-page' ); unset( $cpts['page'] ); } @@ -499,47 +481,32 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) { continue; $key = 'post-new.php?post_type=' . $cpt->name; - $primary[ $key ] = array( $cpt->labels->name_admin_bar, 'new-' . $cpt->name ); + $actions[ $key ] = array( $cpt->labels->name_admin_bar, 'new-' . $cpt->name ); } if ( current_user_can( 'create_users' ) || current_user_can( 'promote_users' ) ) - $secondary[ 'user-new.php' ] = array( _x( 'User', 'add new from admin bar' ), 'new-user' ); + $actions[ 'user-new.php' ] = array( _x( 'User', 'add new from admin bar' ), 'new-user', true ); - if ( ! $primary && ! $secondary ) + if ( ! $actions ) return; $wp_admin_bar->add_menu( array( 'id' => 'new-content', 'title' => _x( 'Add New', 'admin bar menu group label' ), - 'href' => admin_url( current( array_keys( $primary ) ) ), + 'href' => admin_url( current( array_keys( $actions ) ) ), ) ); - $items = array( - 'new-content' => $primary, - 'new-content-secondary' => $secondary, - ); + foreach ( $actions as $link => $action ) { + list( $title, $id ) = $action; + $secondary = ! empty( $action[2] ); - foreach ( $items as $parent => $actions ) { - - if ( ! empty( $actions ) && $parent == 'new-content-secondary' ) { - $wp_admin_bar->add_menu( array( - 'parent' => 'new-content', - 'id' => 'new-content-secondary', - 'title' => ' ', - 'meta' => array( - 'class' => 'secondary', - ), - ) ); - } - - foreach ( $actions as $link => $action ) { - $wp_admin_bar->add_menu( array( - 'parent' => $parent, - 'id' => $action[1], - 'title' => $action[0], - 'href' => admin_url( $link ) - ) ); - } + $wp_admin_bar->add_menu( array( + 'parent' => 'new-content', + 'secondary' => $secondary, + 'id' => $id, + 'title' => $title, + 'href' => admin_url( $link ) + ) ); } } diff --git a/wp-includes/class-wp-admin-bar.php b/wp-includes/class-wp-admin-bar.php index 04612e2fa3..4de3c27257 100644 --- a/wp-includes/class-wp-admin-bar.php +++ b/wp-includes/class-wp-admin-bar.php @@ -12,6 +12,11 @@ class WP_Admin_Bar { $this->proto = 'https://'; $this->user = new stdClass; + $this->root = new stdClass; + $this->root->children = (object) array( + 'primary' => array(), + 'secondary' => array(), + ); if ( is_user_logged_in() ) { /* Populate settings we need for the menu based on the current user. */ @@ -59,11 +64,12 @@ class WP_Admin_Bar { * Add a node to the menu. * * @param array $args - The arguments for each node. - * - id - string - The ID of the item. - * - title - string - The title of the node. - * - parent - string - The ID of the parent node. Optional. - * - href - string - The link for the item. Optional. - * - meta - array - Meta data including the following keys: html, class, onclick, target, title. + * - id - string - The ID of the item. + * - title - string - The title of the node. + * - parent - string - The ID of the parent node. Optional. + * - href - string - The link for the item. Optional. + * - secondary - boolean - If the item should be part of a secondary menu. Optional. Default false. + * - meta - array - Meta data including the following keys: html, class, onclick, target, title. */ public function add_node( $args ) { // Shim for old method signature: add_node( $parent_id, $menu_obj, $args ) @@ -80,11 +86,12 @@ class WP_Admin_Bar { } $defaults = array( - 'id' => false, - 'title' => false, - 'parent' => false, - 'href' => false, - 'meta' => array(), + 'id' => false, + 'title' => false, + 'parent' => false, + 'href' => false, + 'secondary' => false, + 'meta' => array(), ); // If the node already exists, keep any data that isn't provided. @@ -92,6 +99,10 @@ class WP_Admin_Bar { $defaults = (array) $this->nodes[ $args['id'] ]; $args = wp_parse_args( $args, $defaults ); + $args['children'] = (object) array( + 'primary' => array(), + 'secondary' => array(), + ); $this->nodes[ $args['id'] ] = (object) $args; } @@ -106,19 +117,20 @@ class WP_Admin_Bar { // Handle root menu items if ( empty( $node->parent ) ) { - $this->root[] = $node; - continue; - } + $parent = $this->root; // If the parent node isn't registered, ignore the node. - if ( ! isset( $this->nodes[ $node->parent ] ) ) + } elseif ( ! isset( $this->nodes[ $node->parent ] ) ) { continue; - $parent = $this->nodes[ $node->parent ]; - if ( ! isset( $parent->children ) ) - $parent->children = array(); + } else { + $parent = $this->nodes[ $node->parent ]; + } - $parent->children[] = $node; + if ( $node->secondary ) + $parent->children->secondary[] = $node; + else + $parent->children->primary[] = $node; } ?> @@ -126,10 +138,19 @@ class WP_Admin_Bar { @@ -138,7 +159,7 @@ class WP_Admin_Bar { } function recursive_render( $node ) { - $is_parent = ! empty( $node->children ); + $is_parent = ! empty( $node->children->primary ); $menuclass = $is_parent ? 'menupop' : ''; if ( ! empty( $node->meta['class'] ) ) @@ -173,16 +194,22 @@ class WP_Admin_Bar { ?> - - meta['html'] ) ) echo $node->meta['html']; diff --git a/wp-includes/css/admin-bar.css b/wp-includes/css/admin-bar.css index feadac93ff..746ec63c1d 100644 --- a/wp-includes/css/admin-bar.css +++ b/wp-includes/css/admin-bar.css @@ -1 +1 @@ -#wpadminbar *{height:auto;width:auto;margin:0;padding:0;position:static;text-transform:none;letter-spacing:normal;line-height:1;font:normal 13px/28px sans-serif;color:#ccc;text-shadow:#444 0 -1px 0;}#wpadminbar ul li:before,#wpadminbar ul li:after{content:normal;}#wpadminbar a,#wpadminbar a:hover,#wpadminbar a img,#wpadminbar a img:hover{outline:none;border:none;text-decoration:none;background:none;}#wpadminbar{direction:ltr;color:#ccc;font:normal 13px/28px sans-serif;height:28px;position:fixed;top:0;left:0;width:100%;z-index:99999;min-width:960px;background-color:#464646;background-image:-ms-linear-gradient(bottom,#373737,#464646 5px);background-image:-moz-linear-gradient(bottom,#373737,#464646 5px);background-image:-o-linear-gradient(bottom,#373737,#464646 5px);background-image:-webkit-gradient(linear,left bottom,left top,from(#373737),to(#464646));background-image:-webkit-linear-gradient(bottom,#373737,#464646 5px);background-image:linear-gradient(bottom,#373737,#464646 5px);}#wpadminbar ul,#wpadminbar ul li{background:none;list-style:none;margin:0;padding:0;position:relative;z-index:99999;}#wpadminbar .quicklinks{border-left:1px solid transparent;}#wpadminbar .quicklinks ul{text-align:left;}#wpadminbar li{float:left;}#wpadminbar .quicklinks>ul>li{border-right:1px solid #555;}#wpadminbar .quicklinks>ul>li>a{border-right:1px solid #333;}#wpadminbar .quicklinks>ul>li.opposite{border-left:1px solid #333;border-right:0;}#wpadminbar .quicklinks>ul>li.opposite>a{border-left:1px solid #555;border-right:0;}#wpadminbar .quicklinks a,#wpadminbar .shortlink-input{height:28px;display:block;padding:0 1em;margin:0;}#wpadminbar .quicklinks a>span{line-height:28px;}#wpadminbar .quicklinks .menupop ul,#wpadminbar .shortlink-input{margin:0 0 0 -1px;padding-top:6px;padding-bottom:6px;-moz-box-shadow:0 4px 6px rgba(0,0,0,0.2);-webkit-box-shadow:0 4px 6px rgba(0,0,0,0.2);box-shadow:0 4px 6px rgba(0,0,0,0.2);background:#fff;display:none;position:absolute;float:none;border-width:0 1px 1px 1px;border-style:solid;border-color:#dfdfdf;}#wpadminbar .quicklinks .opposite.menupop ul{right:0;margin:0 -1px 0 0;}#wpadminbar .selected .shortlink-input{display:block;}#wpadminbar .quicklinks .menupop ul li{float:none;}#wpadminbar .quicklinks .menupop ul li a strong{font-weight:bold;}#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop ul li a span,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar .quicklinks .menupop.hover ul li a span,#wpadminbar.nojs .quicklinks .menupop:hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a span,#wpadminbar .shortlink-input{line-height:26px;height:26px;color:#21759B;text-shadow:none;white-space:nowrap;min-width:140px;}#wpadminbar .shortlink-input{width:200px;}#wpadminbar.nojs .quicklinks li:hover>ul,#wpadminbar .quicklinks li.hover>ul{display:block;}#wpadminbar .quicklinks .menupop li:hover>ul,#wpadminbar .quicklinks .menupop li.hover>ul{margin-left:100%;margin-top:-33px;border-width:1px;}#wpadminbar .quicklinks .opposite.menupop li:hover>ul,#wpadminbar .quicklinks .opposite.menupop li.hover>ul{margin-left:0;left:inherit;right:100%;}#wpadminbar .ab-top-menu>li:hover,#wpadminbar .ab-top-menu>li>a:focus{background:#3a3a3a;background-image:-ms-linear-gradient(bottom,#3a3a3a,#222);background-image:-moz-linear-gradient(bottom,#3a3a3a,#222);background-image:-o-linear-gradient(bottom,#3a3a3a,#222);background-image:-webkit-gradient(linear,left bottom,left top,from(#3a3a3a),to(#222));background-image:-webkit-linear-gradient(bottom,#3a3a3a,#222);background-image:linear-gradient(bottom,#3a3a3a,#222);}#wpadminbar.nojs .ab-top-menu>li.menupop:hover,#wpadminbar .ab-top-menu li.menupop.hover,#wpadminbar .quicklinks .menupop>a:focus{background:#fff;}#wpadminbar.nojs .quicklinks .menupop:hover a,#wpadminbar.nojs .quicklinks .menupop:hover span,#wpadminbar .quicklinks .menupop.hover a,#wpadminbar .quicklinks .menupop.hover span,#wpadminbar .quicklinks .menupop a:focus,#wpadminbar .quicklinks .menupop a:focus span{color:#333;text-shadow:none;}#wpadminbar .quicklinks .menupop li:hover,#wpadminbar .quicklinks .menupop li.hover,#wpadminbar .quicklinks .menupop a:focus{background-color:#eaf2fa;}#wpadminbar .quicklinks .menupop>a:focus{background-color:#fff;}#wpadminbar .ab-top-menu>.menupop>a span{white-space:nowrap;}#wpadminbar .ab-top-menu>li>a:hover,#wpadminbar .ab-top-menu>li>a:hover span,#wpadminbar .ab-top-menu>li>a:focus,#wpadminbar .ab-top-menu>li>a:focus span{color:#fafafa;}#wpadminbar.nojs .ab-top-menu>li>a:hover span,#wpadminbar .ab-top-menu>li.hover>a:hover span{background:none;}#wpadminbar .menupop li a>span{display:block;background:url(../images/admin-bar-sprite.png?d=11122010) right -31px no-repeat;padding:0 1.5em 0 0;}#wpadminbar .opposite.menupop li a>span{background-position:-28px -31px;padding:0 0 0 1.5em;}#wpadminbar .quicklinks .menupop .secondary{background:#eee;margin:6px 0 -6px;border-top:1px solid #dfdfdf;}#wpadminbar .quicklinks .menupop .secondary>a{display:none;}#wpadminbar .quicklinks .menupop li.secondary>ul,#wpadminbar .quicklinks .opposite.menupop li.secondary>ul{display:block;position:relative;right:auto;margin:0;border:0;background:#eee;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;}#wpadminbar .quicklinks .menupop li.secondary>ul>li:hover,#wpadminbar .quicklinks .menupop li.secondary>ul>li.hover,#wpadminbar .quicklinks .menupop li.secondary>ul>li a:focus{background:#dfdfdf;}#wpadminbar .quicklinks a span#ab-updates{background:#eee;color:#333;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-webkit-border-radius:10px;border-radius:10px;}#wpadminbar .quicklinks a:hover span#ab-updates{background:#fff;color:#000;}#wpadminbar li.opposite{float:right;}#wpadminbar ul li:last-child,#wpadminbar ul li:last-child a{border-right:0;}#wp-admin-bar-my-account>ul{min-width:270px;}#wpadminbar #wp-admin-bar-my-account .user-info-item{margin-left:88px;margin-right:16px;}#wpadminbar #wp-admin-bar-my-account .user-info-item>a{padding-left:8px;}#wpadminbar #wp-admin-bar-my-account .user-info{margin-top:6px;margin-bottom:15px;height:auto;background:none;}#wp-admin-bar-my-account .user-info .avatar{position:absolute;left:-72px;top:4px;}#wpadminbar #wp-admin-bar-my-account .user-info a{height:auto;}#wpadminbar #wp-admin-bar-my-account .user-info span{background:none;padding:0;height:18px;}#wpadminbar #wp-admin-bar-my-account .user-info .display-name{color:#333;}#wpadminbar #wp-admin-bar-my-account .user-info .username{color:#999;font-size:11px;}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{width:16px;height:16px;border:1px solid #999;padding:0;background:#eee;line-height:24px;vertical-align:middle;margin:-2px 0 0 6px;float:none;}#wpadminbar .quicklinks li img.blavatar{vertical-align:middle;margin:-3px 4px 0 0;padding:0;}#wpadminbar #wp-admin-bar-search a{padding:0;}#wpadminbar .quicklinks .admin-bar-search:hover{background:transparent;}#wpadminbar #adminbarsearch{float:right;height:24px;padding:2px 4px;margin:0;}#wpadminbar #adminbarsearch .adminbar-input{height:23px;width:140px;float:left;font:13px sans-serif;border:none;padding:0 3px 0 24px;margin:0 3px 0 0;color:#ccc;text-shadow:#444 0 -1px 0;background-color:rgba(255,255,255,0);background-image:url('../images/admin-bar-search.png');background-repeat:no-repeat;background-position:4px 2px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;outline:none;-webkit-transition-duration:400ms;-webkit-transition-property:width,background;-webkit-transition-timing-function:ease;-moz-transition-duration:400ms;-moz-transition-property:width,background;-moz-transition-timing-function:ease;-o-transition-duration:400ms;-o-transition-property:width,background;-o-transition-timing-function:ease;}#wpadminbar #adminbarsearch .adminbar-input:focus{color:#555;text-shadow:0 1px 0 #fff;width:200px;background-color:rgba(255,255,255,0.9);}#wpadminbar #adminbarsearch .adminbar-input::-webkit-input-placeholder{color:#ddd;}#wpadminbar #adminbarsearch .adminbar-input:-moz-placeholder{color:#ddd;}#wpadminbar #adminbarsearch .adminbar-button{display:none;}#wpadminbar .wp-admin-bar-logo>a{padding-left:24px;background:url(../images/wp-logo-white.png) no-repeat 13px 6px;}#wpadminbar .wp-admin-bar-logo>a span{height:28px;}#wpadminbar.nojs .wp-admin-bar-logo:hover>a,#wpadminbar .wp-admin-bar-logo.hover>a,#wpadminbar .quicklinks .wp-admin-bar-logo>a:focus{background:url(../images/wp-logo-dark.png) no-repeat 12px 6px;}#wpadminbar .ab-comments-icon{position:relative;padding-top:5px;float:left;}#wpadminbar .ab-comments-icon-body{margin-top:3px;background:#999;height:10px;width:14px;-webkit-border-radius:10px;border-radius:10px;}#wpadminbar a:hover .ab-comments-icon-body{background:#bbb;color:#555;}#wpadminbar a .ab-comments-icon-arrow{height:0;position:absolute;bottom:-3px;left:3px;border-left:4px solid #999;border-bottom:4px solid transparent;}#wpadminbar a:hover .ab-comments-icon-arrow{border-left-color:#bbb;}#wpadminbar #ab-awaiting-mod{margin-left:4px;}#wpadminbar span.count-0{display:none;}* html #wpadminbar{overflow:hidden;position:absolute;}* html #wpadminbar .quicklinks ul li a{float:left;}* html #wpadminbar .menupop a span{background-image:none;} \ No newline at end of file +#wpadminbar *{height:auto;width:auto;margin:0;padding:0;position:static;text-transform:none;letter-spacing:normal;line-height:1;font:normal 13px/28px sans-serif;color:#ccc;text-shadow:#444 0 -1px 0;}#wpadminbar ul li:before,#wpadminbar ul li:after{content:normal;}#wpadminbar a,#wpadminbar a:hover,#wpadminbar a img,#wpadminbar a img:hover{outline:none;border:none;text-decoration:none;background:none;}#wpadminbar{direction:ltr;color:#ccc;font:normal 13px/28px sans-serif;height:28px;position:fixed;top:0;left:0;width:100%;z-index:99999;min-width:960px;background-color:#464646;background-image:-ms-linear-gradient(bottom,#373737,#464646 5px);background-image:-moz-linear-gradient(bottom,#373737,#464646 5px);background-image:-o-linear-gradient(bottom,#373737,#464646 5px);background-image:-webkit-gradient(linear,left bottom,left top,from(#373737),to(#464646));background-image:-webkit-linear-gradient(bottom,#373737,#464646 5px);background-image:linear-gradient(bottom,#373737,#464646 5px);}#wpadminbar ul,#wpadminbar ul li{background:none;list-style:none;margin:0;padding:0;position:relative;z-index:99999;}#wpadminbar .quicklinks{border-left:1px solid transparent;}#wpadminbar .quicklinks ul{text-align:left;}#wpadminbar li{float:left;}#wpadminbar .quicklinks>ul>li{border-right:1px solid #555;}#wpadminbar .quicklinks>ul>li>a{border-right:1px solid #333;}#wpadminbar .quicklinks .top-secondary>li{border-left:1px solid #333;border-right:0;float:right;}#wpadminbar .quicklinks .top-secondary>li>a{border-left:1px solid #555;border-right:0;}#wpadminbar .quicklinks a,#wpadminbar .shortlink-input{height:28px;display:block;padding:0 1em;margin:0;}#wpadminbar .quicklinks a>span{line-height:28px;}#wpadminbar .quicklinks .menupop ul,#wpadminbar .shortlink-input{margin:0 0 0 -1px;padding-top:6px;padding-bottom:6px;-moz-box-shadow:0 4px 6px rgba(0,0,0,0.2);-webkit-box-shadow:0 4px 6px rgba(0,0,0,0.2);box-shadow:0 4px 6px rgba(0,0,0,0.2);background:#fff;display:none;position:absolute;float:none;border-width:0 1px 1px 1px;border-style:solid;border-color:#dfdfdf;}#wpadminbar .quicklinks .top-secondary .menupop ul{right:0;margin:0 -1px 0 0;}#wpadminbar .selected .shortlink-input{display:block;}#wpadminbar .quicklinks .menupop ul li{float:none;}#wpadminbar .quicklinks .menupop ul li a strong{font-weight:bold;}#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop ul li a span,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar .quicklinks .menupop.hover ul li a span,#wpadminbar.nojs .quicklinks .menupop:hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a span,#wpadminbar .shortlink-input{line-height:26px;height:26px;color:#21759B;text-shadow:none;white-space:nowrap;min-width:140px;}#wpadminbar .shortlink-input{width:200px;}#wpadminbar.nojs .quicklinks li:hover>ul,#wpadminbar .quicklinks li.hover>ul{display:block;}#wpadminbar .quicklinks .menupop li:hover>ul,#wpadminbar .quicklinks .menupop li.hover>ul{margin-left:100%;margin-top:-33px;border-width:1px;}#wpadminbar .quicklinks .top-secondary .menupop li:hover>ul,#wpadminbar .quicklinks .top-secondary .menupop li.hover>ul{margin-left:0;left:inherit;right:100%;}#wpadminbar .ab-top-menu>li:hover,#wpadminbar .ab-top-menu>li>a:focus{background:#3a3a3a;background-image:-ms-linear-gradient(bottom,#3a3a3a,#222);background-image:-moz-linear-gradient(bottom,#3a3a3a,#222);background-image:-o-linear-gradient(bottom,#3a3a3a,#222);background-image:-webkit-gradient(linear,left bottom,left top,from(#3a3a3a),to(#222));background-image:-webkit-linear-gradient(bottom,#3a3a3a,#222);background-image:linear-gradient(bottom,#3a3a3a,#222);}#wpadminbar.nojs .ab-top-menu>li.menupop:hover,#wpadminbar .ab-top-menu li.menupop.hover,#wpadminbar .quicklinks .menupop>a:focus{background:#fff;}#wpadminbar.nojs .quicklinks .menupop:hover a,#wpadminbar.nojs .quicklinks .menupop:hover span,#wpadminbar .quicklinks .menupop.hover a,#wpadminbar .quicklinks .menupop.hover span,#wpadminbar .quicklinks .menupop a:focus,#wpadminbar .quicklinks .menupop a:focus span{color:#333;text-shadow:none;}#wpadminbar .quicklinks .menupop li:hover,#wpadminbar .quicklinks .menupop li.hover,#wpadminbar .quicklinks .menupop a:focus{background-color:#eaf2fa;}#wpadminbar .quicklinks .menupop>a:focus{background-color:#fff;}#wpadminbar .ab-top-menu>.menupop>a span{white-space:nowrap;}#wpadminbar .ab-top-menu>li>a:hover,#wpadminbar .ab-top-menu>li>a:hover span,#wpadminbar .ab-top-menu>li>a:focus,#wpadminbar .ab-top-menu>li>a:focus span{color:#fafafa;}#wpadminbar.nojs .ab-top-menu>li>a:hover span,#wpadminbar .ab-top-menu>li.hover>a:hover span{background:none;}#wpadminbar .menupop li a>span{display:block;background:url(../images/admin-bar-sprite.png?d=11122010) right -31px no-repeat;padding:0 1.5em 0 0;}#wpadminbar .top-secondary .menupop li a>span{background-position:-28px -31px;padding:0 0 0 1.5em;}#wpadminbar .quicklinks .menupop ul.sub-secondary{display:block;position:relative;right:auto;margin:0;border:0;background:#eee;margin:6px 0 -6px;border-top:1px solid #dfdfdf;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;}#wpadminbar .quicklinks .menupop .sub-secondary>li:hover,#wpadminbar .quicklinks .menupop .sub-secondary>li.hover,#wpadminbar .quicklinks .menupop .sub-secondary>li a:focus{background:#dfdfdf;}#wpadminbar .quicklinks a span#ab-updates{background:#eee;color:#333;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-webkit-border-radius:10px;border-radius:10px;}#wpadminbar .quicklinks a:hover span#ab-updates{background:#fff;color:#000;}#wpadminbar .top-secondary{float:right;}#wpadminbar ul li:last-child,#wpadminbar ul li:last-child a{border-right:0;}#wp-admin-bar-my-account>ul{min-width:270px;}#wpadminbar #wp-admin-bar-my-account .user-info-item{margin-left:88px;margin-right:16px;}#wpadminbar #wp-admin-bar-my-account .user-info-item>a{padding-left:8px;}#wpadminbar #wp-admin-bar-my-account .user-info{margin-top:6px;margin-bottom:15px;height:auto;background:none;}#wp-admin-bar-my-account .user-info .avatar{position:absolute;left:-72px;top:4px;}#wpadminbar #wp-admin-bar-my-account .user-info a{height:auto;}#wpadminbar #wp-admin-bar-my-account .user-info span{background:none;padding:0;height:18px;}#wpadminbar #wp-admin-bar-my-account .user-info .display-name{color:#333;}#wpadminbar #wp-admin-bar-my-account .user-info .username{color:#999;font-size:11px;}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{width:16px;height:16px;border:1px solid #999;padding:0;background:#eee;line-height:24px;vertical-align:middle;margin:-2px 0 0 6px;float:none;}#wpadminbar .quicklinks li img.blavatar{vertical-align:middle;margin:-3px 4px 0 0;padding:0;}#wpadminbar #wp-admin-bar-search a{padding:0;}#wpadminbar .quicklinks .admin-bar-search:hover{background:transparent;}#wpadminbar #adminbarsearch{float:right;height:24px;padding:2px 4px;margin:0;}#wpadminbar #adminbarsearch .adminbar-input{height:23px;width:140px;float:left;font:13px sans-serif;border:none;padding:0 3px 0 24px;margin:0 3px 0 0;color:#ccc;text-shadow:#444 0 -1px 0;background-color:rgba(255,255,255,0);background-image:url('../images/admin-bar-search.png');background-repeat:no-repeat;background-position:4px 2px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;outline:none;-webkit-transition-duration:400ms;-webkit-transition-property:width,background;-webkit-transition-timing-function:ease;-moz-transition-duration:400ms;-moz-transition-property:width,background;-moz-transition-timing-function:ease;-o-transition-duration:400ms;-o-transition-property:width,background;-o-transition-timing-function:ease;}#wpadminbar #adminbarsearch .adminbar-input:focus{color:#555;text-shadow:0 1px 0 #fff;width:200px;background-color:rgba(255,255,255,0.9);}#wpadminbar #adminbarsearch .adminbar-input::-webkit-input-placeholder{color:#ddd;}#wpadminbar #adminbarsearch .adminbar-input:-moz-placeholder{color:#ddd;}#wpadminbar #adminbarsearch .adminbar-button{display:none;}#wpadminbar .wp-admin-bar-logo>a{padding-left:24px;background:url(../images/wp-logo-white.png) no-repeat 13px 6px;}#wpadminbar .wp-admin-bar-logo>a span{height:28px;}#wpadminbar.nojs .wp-admin-bar-logo:hover>a,#wpadminbar .wp-admin-bar-logo.hover>a,#wpadminbar .quicklinks .wp-admin-bar-logo>a:focus{background:url(../images/wp-logo-dark.png) no-repeat 12px 6px;}#wpadminbar .ab-comments-icon{position:relative;padding-top:5px;float:left;}#wpadminbar .ab-comments-icon-body{margin-top:3px;background:#999;height:10px;width:14px;-webkit-border-radius:10px;border-radius:10px;}#wpadminbar a:hover .ab-comments-icon-body{background:#bbb;color:#555;}#wpadminbar a .ab-comments-icon-arrow{height:0;position:absolute;bottom:-3px;left:3px;border-left:4px solid #999;border-bottom:4px solid transparent;}#wpadminbar a:hover .ab-comments-icon-arrow{border-left-color:#bbb;}#wpadminbar #ab-awaiting-mod{margin-left:4px;}#wpadminbar span.count-0{display:none;}* html #wpadminbar{overflow:hidden;position:absolute;}* html #wpadminbar .quicklinks ul li a{float:left;}* html #wpadminbar .menupop a span{background-image:none;} \ No newline at end of file diff --git a/wp-includes/css/admin-bar.dev.css b/wp-includes/css/admin-bar.dev.css index d1ffe94302..7a7645820b 100644 --- a/wp-includes/css/admin-bar.dev.css +++ b/wp-includes/css/admin-bar.dev.css @@ -78,12 +78,13 @@ border-right: 1px solid #333; } -#wpadminbar .quicklinks > ul > li.opposite { +#wpadminbar .quicklinks .top-secondary > li { border-left: 1px solid #333; border-right: 0; + float: right; } -#wpadminbar .quicklinks > ul > li.opposite > a { +#wpadminbar .quicklinks .top-secondary > li > a { border-left: 1px solid #555; border-right: 0; } @@ -117,7 +118,7 @@ border-color: #dfdfdf; } -#wpadminbar .quicklinks .opposite.menupop ul { +#wpadminbar .quicklinks .top-secondary .menupop ul { right: 0; margin: 0 -1px 0 0; } @@ -166,8 +167,8 @@ border-width: 1px; } -#wpadminbar .quicklinks .opposite.menupop li:hover > ul, -#wpadminbar .quicklinks .opposite.menupop li.hover > ul { +#wpadminbar .quicklinks .top-secondary .menupop li:hover > ul, +#wpadminbar .quicklinks .top-secondary .menupop li.hover > ul { margin-left: 0; left: inherit; right: 100%; @@ -232,37 +233,30 @@ padding: 0 1.5em 0 0; } -#wpadminbar .opposite.menupop li a > span { +#wpadminbar .top-secondary .menupop li a > span { background-position: -28px -31px; padding: 0 0 0 1.5em; } -#wpadminbar .quicklinks .menupop .secondary { - background: #eee; - margin: 6px 0 -6px; - border-top: 1px solid #dfdfdf; -} - -#wpadminbar .quicklinks .menupop .secondary > a { - display: none; -} - -#wpadminbar .quicklinks .menupop li.secondary > ul, -#wpadminbar .quicklinks .opposite.menupop li.secondary > ul { +#wpadminbar .quicklinks .menupop ul.sub-secondary { display: block; position: relative; right: auto; margin: 0; border: 0; + background: #eee; + margin: 6px 0 -6px; + border-top: 1px solid #dfdfdf; + -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } -#wpadminbar .quicklinks .menupop li.secondary > ul > li:hover, -#wpadminbar .quicklinks .menupop li.secondary > ul > li.hover, -#wpadminbar .quicklinks .menupop li.secondary > ul > li a:focus { +#wpadminbar .quicklinks .menupop .sub-secondary > li:hover, +#wpadminbar .quicklinks .menupop .sub-secondary > li.hover, +#wpadminbar .quicklinks .menupop .sub-secondary > li a:focus { background: #dfdfdf; } @@ -283,7 +277,7 @@ color: #000; } -#wpadminbar li.opposite { +#wpadminbar .top-secondary { float: right; } diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 733eaf6fe6..3510eb8d8a 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -452,7 +452,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(), '20111108a' ); + $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20111109' ); $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20111107' ); $styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20111107' ); $styles->add( 'wp-pointer', "/wp-includes/css/wp-pointer$suffix.css", array(), '20111017' );