Postboxes drag/drop for all browsers, some base css fixes

git-svn-id: https://develop.svn.wordpress.org/trunk@9291 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-10-22 22:08:58 +00:00
parent a11ad49d80
commit 837b1b51bc
10 changed files with 174 additions and 104 deletions

View File

@ -88,8 +88,6 @@ if ( '' == $blog_name )
<?php } ?></h1> <?php } ?></h1>
<div id="wphead-info"> <div id="wphead-info">
<?php favorite_actions(); ?>
<div id="user_info"> <div id="user_info">
<p><?php printf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity) ?> | <p><?php printf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity) ?> |
<!-- <!--
@ -98,6 +96,8 @@ if ( '' == $blog_name )
--> -->
<a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a></p> <a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a></p>
</div> </div>
<?php favorite_actions(); ?>
</div> </div>
</div> </div>

View File

@ -1,34 +1,34 @@
/* 2 column liquid layout */ /* 2 column liquid layout */
div#wpbody { #wpwrap {
float: right; height: auto;
clear: right; min-height: 100%;
overflow: hidden;
width: 100%; width: 100%;
margin-left: -155px;
} }
div#wpbody-content { #wpcontent {
margin-left: 140px; height: 100%;
margin-bottom: 50px;
}
#wpbody-content {
overflow: hidden;
padding-top: 10px; padding-top: 10px;
} }
div#sidemenu-bg { #adminmenu {
border-right-style: solid;
border-right-width: 1px;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 135px;
}
ul#adminmenu {
float: left; float: left;
clear: left; clear: left;
margin: 10px 8px; margin: 10px 8px;
width: 135px; /* + 10 padding */
position: relative; position: relative;
} }
#footer {
clear: both;
position: relative;
width: 100%;
}
/* inner 2 column liquid layout */ /* inner 2 column liquid layout */
.inner-sidebar { .inner-sidebar {
@ -77,13 +77,23 @@ textarea, input, select {
padding: 3px; padding: 3px;
} }
.alignleft { float: left; } .alignleft {
.alignright { float: right; } float: left;
}
.textleft { text-align: left; } .alignright {
.textright { text-align: right; } float: right;
}
.clear { clear: both; height: 2px; } .textleft {
text-align: left;
}
.textright {
text-align: right;
}
.clear { clear: both; }
.hidden { display: none; } .hidden { display: none; }
@ -139,13 +149,24 @@ h6 {
float: left; float: left;
} }
.subsubsub a { line-height: 200%; padding: 3px; text-decoration: none; } .subsubsub a {
line-height: 200%;
padding: 3px;
text-decoration: none;
}
.subsubsub a.current { font-weight: bold; background: none; border: none;} .subsubsub a.current {
font-weight: bold;
background: none;
border: none;
}
.subsubsub li { display: inline; margin: 0; padding: 0; } .subsubsub li {
display: inline;
margin: 0;
padding: 0;
}
/* make it small? */
.subsubsub li.spam { .subsubsub li.spam {
font-size: .9em; font-size: .9em;
} }
@ -211,10 +232,6 @@ th.check-column + th, th.check-column + td {
text-align: center; text-align: center;
} }
#wpbody .wrap {
position: relative;
}
.wrap, .updated, .error { .wrap, .updated, .error {
margin: 0 15px; margin: 0 15px;
padding: 0; padding: 0;

View File

@ -1,12 +1,45 @@
/* Fixes for IE bugs */ /* Fixes for IE bugs */
.metabox-holder .postbox h3, #poststuff .postbox h3 { * html #wpbody-content {
margin-left: 140px;
}
* html #wpbody {
clear: right;
float: right;
margin-left: -185px;
width: 100%;
}
* html body {
background-color: #464646;
}
* html #wpwrap {
background-color: #fff;
}
#footer {
overflow: hidden;
}
.metabox-holder .postbox h3 {
padding-left: 23px; padding-left: 23px;
} }
input.button, input.button-secondary, input.button-highlighted { input.button, input.button-secondary, input.button-highlighted {
padding: 0; padding: 0;
} }
#side-info-column {
position: absolute;
right: 15px;
}
#wphead-info {
float: right;
}
/* /*
* html body.minwidth { * html body.minwidth {
_width: expression(document.documentElement.clientWidth < 810 ? "808px" : "99.9%"); _width: expression(document.documentElement.clientWidth < 810 ? "808px" : "99.9%");
@ -63,11 +96,13 @@ ul#adminmenu li.wp-menu-separator {
font-size: 3px; font-size: 3px;
} }
#template, #template div, #editcat, #addcat {
zoom: 100%;
}
* html #poststuff .postarea, * html #poststuff #titlediv { * html #poststuff .postarea, * html #poststuff #titlediv {
width: 95%;
margin-left: 3%;
} }
.submitbox { .submitbox {
@ -79,11 +114,31 @@ ul#adminmenu li.wp-menu-separator {
position: relative; position: relative;
} }
#wpwrap, #wpcontent, #post, #wrap, #postdivrich, #postdiv, #poststuff, .metabox-holder, #titlediv, #post-body, #editorcontainer, .tablenav, .widget-control-list, li.widget-list-control-item, #dragHelper, li.widget-list-control-item h4, .widget-sortable, .widget-control-actions { #wpwrap, #wpcontent, #post, #wrap, #postdivrich, #postdiv, #poststuff, .metabox-holder, #titlediv, #post-body, #editorcontainer, .tablenav, .widget-control-list, li.widget-list-control-item, #dragHelper, li.widget-list-control-item h4, .widget-sortable, .widget-control-actions, #tagchecklist {
display: block; display: block;
zoom: 100%; zoom: 100%;
} }
#favorite-inside, #favorite-inside a, .favorite-action {
z-index: 11;
zoom: 100%;
}
#wphead-info {
width: 350px;
max-width: 350px;
}
p.search-box {
position: static;
float: right;
margin: -3px 0 4px;
}
#wpbody .wrap {
position: static;
}
* html #editorcontainer { * html #editorcontainer {
padding: 0; padding: 0;
} }
@ -114,7 +169,8 @@ form#template div {
} }
#bh { #bh {
padding-right: 15px; margin: 3px 0 0 6px;
float: right;
} }
/* without this dashboard widgets appear in one column for some screen widths */ /* without this dashboard widgets appear in one column for some screen widths */
@ -122,11 +178,6 @@ div#dashboard-widgets {
padding-right: 1px; padding-right: 1px;
} }
#tagchecklist {
display: block;
zoom: 100%;
}
#tagchecklist span, #tagchecklist span a { #tagchecklist span, #tagchecklist span a {
display: inline-block; display: inline-block;
display: block; display: block;

View File

@ -580,6 +580,7 @@ do_action('dbx_post_sidebar');
</div> </div>
</div> </div>
<br class="clear" />
</div><!-- /poststuff --> </div><!-- /poststuff -->
</form> </form>
</div> </div>

View File

@ -2322,13 +2322,10 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
function browse_happy() { function browse_happy() {
$getit = __( 'WordPress recommends a better browser' ); $getit = __( 'WordPress recommends a better browser' );
echo ' echo '
<span id="bh" class="alignright"><a href="http://browsehappy.com/" title="'.$getit.'"><img src="images/browse-happy.gif" alt="Browse Happy" /></a></span> <div id="bh"><a href="http://browsehappy.com/" title="'.$getit.'"><img src="images/browse-happy.gif" alt="Browse Happy" /></a></div>
'; ';
} }
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
add_action( 'in_admin_footer', 'browse_happy' );
/** /**
* {@internal Missing Short Description}} * {@internal Missing Short Description}}
* *

View File

@ -12,12 +12,6 @@
save_manage_columns_state(page); save_manage_columns_state(page);
} ); } );
if ( $.browser.msie ) {
$('#side-sortables').append( '<div id="make-it-tall"></div>' );
} else {
$('#side-sortables').append( '<div id="make-it-tall" style="margin-bottom: -2000px; padding-bottom: 2001px"></div>' );
}
$('#wpbody-content').css( 'overflow', 'hidden' );
} }
} }
}(jQuery)); }(jQuery));

View File

@ -51,7 +51,8 @@ adminMenu = {
fold : function(off) { fold : function(off) {
if (off) { if (off) {
$('#wpbody-content').css('marginLeft', '140px'); if ( $.browser.msie && $.browser.version.charAt(0) == 6 )
$('#wpbody-content').css('marginLeft', '140px');
$('#adminmenu').removeClass('folded'); $('#adminmenu').removeClass('folded');
$('#adminmenu li.wp-submenu-head').hide(); $('#adminmenu li.wp-submenu-head').hide();
$('#adminmenu a.wp-has-submenu').show(); $('#adminmenu a.wp-has-submenu').show();
@ -60,7 +61,8 @@ adminMenu = {
$('#adminmenu').addClass('folded'); $('#adminmenu').addClass('folded');
$('#adminmenu a.wp-has-submenu, #adminmenu .wp-submenu').hide(); $('#adminmenu a.wp-has-submenu, #adminmenu .wp-submenu').hide();
$('#adminmenu li.wp-submenu-head').show(); $('#adminmenu li.wp-submenu-head').show();
$('#wpbody-content').css('marginLeft', '38px'); if ( $.browser.msie && $.browser.version.charAt(0) == 6 )
$('#wpbody-content').css('marginLeft', '40px');
$('#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(); }, over: function(){ $(this).find('.wp-submenu').show(); },
out: function(){ $(this).find('.wp-submenu').hide(); }, out: function(){ $(this).find('.wp-submenu').hide(); },
@ -75,7 +77,7 @@ adminMenu = {
$(document).ready(function(){ $(document).ready(function(){
adminMenu.init(); adminMenu.init();
$('#favorite-inside').width($('#favorite-first').width()+24); $('#favorite-inside').width($('#favorite-actions').width()-4);
$('#favorite-toggle, #favorite-inside').bind( 'mouseenter', function(){$('#favorite-inside').removeClass('slideUp').addClass('slideDown'); setTimeout(function(){if ( $('#favorite-inside').hasClass('slideDown') ) { $('#favorite-inside').slideDown(100); $('#favorite-first').addClass('slide-down'); }}, 200) } ); $('#favorite-toggle, #favorite-inside').bind( 'mouseenter', function(){$('#favorite-inside').removeClass('slideUp').addClass('slideDown'); setTimeout(function(){if ( $('#favorite-inside').hasClass('slideDown') ) { $('#favorite-inside').slideDown(100); $('#favorite-first').addClass('slide-down'); }}, 200) } );
$('#favorite-toggle, #favorite-inside').bind( 'mouseleave', function(){$('#favorite-inside').removeClass('slideDown').addClass('slideUp'); setTimeout(function(){if ( $('#favorite-inside').hasClass('slideUp') ) { $('#favorite-inside').slideUp(100, function(){ $('#favorite-first').removeClass('slide-down'); } ); }}, 300) } ); $('#favorite-toggle, #favorite-inside').bind( 'mouseleave', function(){$('#favorite-inside').removeClass('slideDown').addClass('slideUp'); setTimeout(function(){if ( $('#favorite-inside').hasClass('slideUp') ) { $('#favorite-inside').slideUp(100, function(){ $('#favorite-first').removeClass('slide-down'); } ); }}, 300) } );

View File

@ -22,15 +22,23 @@
postboxes.save_state(page); postboxes.save_state(page);
} ); } );
if ( $.browser.msie ) { this.makeItTall();
$('#side-sortables').append( '<div id="make-it-tall"></div>' );
} else {
$('#side-sortables').append( '<div id="make-it-tall" style="margin-bottom: -2000px; padding-bottom: 2001px"></div>' );
}
$('#wpbody-content').css( 'overflow', 'hidden' );
this.init(page,args); this.init(page,args);
}, },
makeItTall : function() {
var t = $('#make-it-tall').remove();
if ( t.length < 1 )
t = $.browser.mozilla ? '<div id="make-it-tall" style="margin-bottom: -2000px; padding-bottom: 2001px"></div>' : '<div id="make-it-tall"> <br /> <br /></div>';
$('#side-sortables').append(t);
if ( $('#side-sortables').children().length > 1 )
$('#side-sortables').css({'minHeight':'300px'});
$('#wpbody-content').css( 'overflow', 'hidden' );
},
expandSidebar : function( doIt ) { expandSidebar : function( doIt ) {
if ( doIt || $.trim( $( '#side-info-column' ).text() ) ) { if ( doIt || $.trim( $( '#side-info-column' ).text() ) ) {
@ -50,14 +58,14 @@
items: '> .postbox', items: '> .postbox',
handle: '.hndle', handle: '.hndle',
distance: 2, distance: 2,
tolerance: 'pointer',
receive: function() {
postboxes.makeItTall();
},
stop: function() { stop: function() {
if ( 'side-sortables' == this.id ) { // doing this with jQuery doesn't work for some reason: make-it-tall gets duplicated if ( $('#side-sortables').children().length < 2 )
var makeItTall = document.getElementById( 'make-it-tall' ); $('#side-sortables').css({'minHeight':''});
var sideSort = makeItTall.parentNode;
sideSort.removeChild( makeItTall );
sideSort.appendChild( makeItTall );
}
var postVars = { var postVars = {
action: 'meta-box-order', action: 'meta-box-order',
_ajax_nonce: jQuery('#meta-box-order-nonce').val(), _ajax_nonce: jQuery('#meta-box-order-nonce').val(),

View File

@ -461,10 +461,6 @@ textarea.all-options, input.all-options {
margin-right: 0; margin-right: 0;
} }
#template, #template div, #editcat, #addcat {
zoom: 1;
}
/* A handy div class for hiding controls. /* A handy div class for hiding controls.
Some browsers will disable them when you Some browsers will disable them when you
set display: none; */ set display: none; */
@ -630,7 +626,6 @@ a.view-comment-post-link {
/* Admin Header */ /* Admin Header */
#wphead-info { #wphead-info {
float: right;
margin: 0 15px; margin: 0 15px;
} }
@ -930,24 +925,16 @@ html, body {
height: 100%; height: 100%;
} }
#wpwrap {
position: relative;
min-height: 100%;
overflow: hidden;
}
#wpcontent {
padding-bottom: 80px;
position: relative;
}
#footer { #footer {
word-spacing: .3em; word-spacing: .3em;
font-size: 11px; font-size: 11px;
clear: both;
height: 45px; height: 45px;
margin-top: -45px; margin-top: -45px;
position: relative; }
#in-footer {
padding: 15px 0 0 15px;
float: left;
} }
#footer #footer-thankyou, #footer #footer-upgrade { #footer #footer-thankyou, #footer #footer-upgrade {
@ -1404,9 +1391,16 @@ table.form-table td .updated {
margin: 0; margin: 0;
} }
/*
#side-info-column #side-sortables { #side-info-column #side-sortables {
height: 100%; height: 100%;
} }
*/
.submitbox .submit { .submitbox .submit {
text-align: left; text-align: left;
@ -1573,10 +1567,8 @@ p#big-add-button .button {
} }
p.search-box { p.search-box {
position: absolute; float: right;
right: 0; margin: -5px 0 0;
top: -5px;
margin: 0;
} }
.search-input { .search-input {
@ -1647,9 +1639,8 @@ body.wp-admin {
} }
.filter { .filter {
left: 180px; float: left;
position: absolute; margin: -5px 0 0 10px;
top: 24px;
} }
#the-comment-list td.comment p.comment-author { #the-comment-list td.comment p.comment-author {
@ -1818,7 +1809,7 @@ fieldset {
.sortable-placeholder { .sortable-placeholder {
border: 1px #bbb dashed; border: 1px #bbb dashed;
background: #f5f5f5; background-color: #f5f5f5;
z-index: -1; z-index: -1;
} }
@ -2506,7 +2497,7 @@ abbr.required {
/* favorite-actions */ /* favorite-actions */
#favorite-actions { #favorite-actions {
float: left; float: right;
margin: 11px 12px 0; margin: 11px 12px 0;
min-width: 130px; min-width: 130px;
position: relative; position: relative;
@ -2531,7 +2522,7 @@ abbr.required {
#favorite-inside { #favorite-inside {
margin: 0 0 0 1px; margin: 0 0 0 1px;
padding: 2px 8px 4px; padding: 0 0 6px;
border-width: 1px; border-width: 1px;
border-style: solid; border-style: solid;
position: absolute; position: absolute;
@ -2552,16 +2543,25 @@ abbr.required {
} }
.favorite-action { .favorite-action {
padding: 3px;
} }
#favorite-actions a { #favorite-actions a {
padding: 4px 5px 4px 0; display: block;
text-decoration: none; text-decoration: none;
color: #eee; color: #eee;
font-size: 11px; font-size: 11px;
} }
#favorite-inside a {
padding: 3px 5px 3px 10px;
}
#favorite-inside a:hover {
background-color: #8f8f8f;
color: #fff;
}
#favorite-toggle { #favorite-toggle {
height: 22px; height: 22px;
position: absolute; position: absolute;

View File

@ -165,7 +165,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'admin-forms', '/wp-admin/js/forms.js', array('jquery'), '20080729'); $scripts->add( 'admin-forms', '/wp-admin/js/forms.js', array('jquery'), '20080729');
$scripts->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' ); $scripts->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' );
$scripts->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' ); $scripts->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' );
$scripts->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery-ui-sortable'), '20080723' ); $scripts->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery-ui-sortable'), '20081022' );
$scripts->localize( 'postbox', 'postboxL10n', array( $scripts->localize( 'postbox', 'postboxL10n', array(
'requestFile' => admin_url('admin-ajax.php'), 'requestFile' => admin_url('admin-ajax.php'),
) ); ) );
@ -278,7 +278,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'dashboard', '/wp-admin/js/dashboard.js', array( 'jquery', 'admin-comments', 'postbox', 'settings-box' ), '20081016' ); $scripts->add( 'dashboard', '/wp-admin/js/dashboard.js', array( 'jquery', 'admin-comments', 'postbox', 'settings-box' ), '20081016' );
$scripts->add( 'hoverIntent', '/wp-includes/js/hoverIntent.js', array('jquery'), '20070327' ); $scripts->add( 'hoverIntent', '/wp-includes/js/hoverIntent.js', array('jquery'), '20070327' );
$scripts->add( 'menu', '/wp-admin/js/menu.js', array( 'jquery', 'hoverIntent' ), '20081018' ); $scripts->add( 'menu', '/wp-admin/js/menu.js', array( 'jquery', 'hoverIntent' ), '20081022' );
} }
} }
@ -309,7 +309,7 @@ function wp_default_styles( &$styles ) {
$rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' ); $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' );
$styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20081018' ); $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20081022' );
$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' ); $styles->add( 'ie', '/wp-admin/css/ie.css' );