Responsive columns on the dashboard and write screens, first run, see #20015

git-svn-id: http://svn.automattic.com/wordpress/trunk@20272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2012-03-23 21:41:00 +00:00
parent 79ff94923e
commit bba9c91990
14 changed files with 368 additions and 396 deletions

View File

@ -136,6 +136,10 @@ div.dashboard-widget-submit {
border-top-color: #ccc;
}
ul.category-tabs li {
border-color: transparent;
}
div.tabs-panel,
.wp-tab-panel,
ul.category-tabs li.tabs,

View File

@ -144,6 +144,10 @@ div.dashboard-widget-submit {
border-top-color: #ccc;
}
ul.category-tabs li {
border-color: transparent;
}
div.tabs-panel,
.wp-tab-panel,
ul.category-tabs li.tabs,

View File

@ -126,10 +126,6 @@ p.submit { /* quick edit and reply in edit-comments.php */
height:22px;
}
.inner-sidebar { /* fix edit single comment */
position: static;
}
form#widgets-filter { /* fix widget page */
position: static;
}

View File

@ -1,4 +1,13 @@
/* Fixes for IE bugs */
/* Fixes for IE 7 bugs */
.wp-editor-wrap .wp-editor-container textarea.wp-editor-area {
width: 97%;
}
#post-body.columns-2 #postbox-container-1 {
padding-left: 19px;
}
.welcome-panel .wp-badge {
position: absolute;
}
@ -497,7 +506,6 @@ table.ie-fixed {
display: inline;
}
* html .inner-sidebar #side-sortables,
* html .postbox-container .meta-box-sortables {
height: 300px;
}

View File

@ -2119,12 +2119,6 @@ div.star {
position: relative;
}
#side-info-column {
float: left;
right: auto;
left: 0;
}
h3.tb {
margin-left: 0;
margin-right: 5px;

View File

@ -104,6 +104,7 @@ TABLE OF CONTENTS:
}
/* inner 2 column liquid layout */
/*
.inner-sidebar {
float: right;
clear: right;
@ -140,10 +141,7 @@ TABLE OF CONTENTS:
margin-right: 300px;
}
#post-body-content #side-sortables.empty-container {
border: 0 none;
height: 0;
}
*/
/* 2 columns main area */
@ -915,11 +913,6 @@ ul#add-to-blog-users {
margin-top: -2px;
}
#post-body #major-publishing-actions {
border-top: 0;
margin-top: 0;
}
#delete-action {
line-height: 25px;
vertical-align: middle;
@ -933,32 +926,6 @@ ul#add-to-blog-users {
line-height: 23px;
}
#post-body #minor-publishing {
padding-bottom: 10px;
}
#post-body #misc-publishing-actions {
padding: 0;
}
#post-body .misc-pub-section {
border-left-width: 1px;
border-left-style: solid;
border-top: 0;
border-bottom: 0;
min-height: 30px;
float: left;
max-width: 32%;
}
#post-body .misc-pub-section:first-child {
border-left: 0;
}
#post-body .misc-pub-section-last {
border-right: 0;
}
#misc-publishing-actions {
padding: 6px 0 0;
}
@ -1217,6 +1184,10 @@ form.upgrade .hint {
margin: 0 5px 0 2px;
}
.metabox-prefs .columns-prefs label input {
margin: 0 2px;
}
.metabox-prefs label a {
display: none;
}
@ -1825,18 +1796,169 @@ body.admin-bar {
margin: 0.6em 0;
}
/* Screens with postboxes */
.postbox-container {
float: left;
}
.postbox-container .meta-box-sortables {
min-height: 350px;
#dashboard-widgets.columns-1 .postbox-container {
width: 100%;
}
.postbox-container .meta-box-sortables.empty-container,
#side-sortables.empty-container {
#dashboard-widgets.columns-2 .postbox-container {
width: 49.5%;
}
#dashboard-widgets.columns-2 #postbox-container-2,
#dashboard-widgets.columns-2 #postbox-container-3,
#dashboard-widgets.columns-2 #postbox-container-4 {
float: right;
width: 50.5%;
}
#dashboard-widgets.columns-3 .postbox-container {
width: 33.5%;
}
#dashboard-widgets.columns-3 #postbox-container-1 {
width: 33%;
}
#dashboard-widgets.columns-3 #postbox-container-3,
#dashboard-widgets.columns-3 #postbox-container-4 {
float: right;
}
#dashboard-widgets.columns-4 .postbox-container {
width: 25%;
}
.postbox-container .meta-box-sortables {
min-height: 50px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.postbox-container .meta-box-sortables:empty {
min-height: 0;
height: 0;
}
.metabox-holder .postbox-container .empty-container {
border: 3px dashed #CCCCCC;
height: 350px;
height: 250px;
}
.metabox-holder.columns-1 .postbox-container .empty-container,
.columns-2 #postbox-container-3 .empty-container,
.columns-2 #postbox-container-4 .empty-container,
.columns-3 #postbox-container-4 .empty-container {
border: 0 none;
height: 0;
min-height: 0;
}
#poststuff {
padding-top: 10px;
}
#poststuff #post-body {
padding: 0;
}
#post-body-content {
width: 100%;
float: left;
}
#poststuff .postbox-container {
width: 100%;
}
#poststuff #post-body.columns-2 {
margin-right: 300px;
}
#post-body.columns-2 #postbox-container-1 {
float: right;
margin-right: -300px;
width: 280px;
}
/* one column on the dash */
@media only screen and (max-width: 768px) {
#wpbody-content #dashboard-widgets .postbox-container {
width: 100%;
}
#wpbody-content .metabox-holder .postbox-container .empty-container {
border: 0 none;
height: 0;
min-height: 0;
}
}
/* two columns on the dash, but keep the setting if one is selected */
@media only screen and (min-width: 768px) and (max-width: 1200px) {
#wpbody-content #dashboard-widgets .postbox-container {
width: 49.5%;
}
#wpbody-content #dashboard-widgets #postbox-container-2,
#wpbody-content #dashboard-widgets #postbox-container-3,
#wpbody-content #dashboard-widgets #postbox-container-4 {
float: right;
width: 50.5%;
}
#wpbody-content .metabox-holder .postbox-container .empty-container,
#wpbody-content #postbox-container-3 .empty-container,
#wpbody-content #postbox-container-4 .empty-container {
border: 0 none;
height: 0;
min-height: 0;
}
#wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container {
width: 100%;
}
#wpbody #wpbody-content .metabox-holder.columns-1 .postbox-container .empty-container {
border: 0 none;
height: 0;
min-height: 0;
}
/* show the radio buttons for column prefs only for one or two columns */
.index-php .screen-layout,
.index-php .columns-prefs {
display: block;
}
.columns-prefs .columns-prefs-3,
.columns-prefs .columns-prefs-4 {
display: none;
}
}
/* one column on the post write/edit screen */
@media only screen and (max-width: 1024px) {
#wpbody-content #poststuff #post-body {
margin: 0;
}
#wpbody-content #post-body.columns-2 #postbox-container-1 {
margin-right: 0;
width: 100%;
}
/* hide the radio buttons for column prefs */
.screen-layout,
.columns-prefs {
display: none;
}
}
.postbox .hndle {
@ -2746,82 +2868,25 @@ input#link_url {
max-width: 260px;
}
#post-body ul.category-tabs,
#post-body ul.add-menu-item-tabs {
float: left;
width: 120px;
text-align: right;
/* Negative margin for the sake of those without JS: all tabs display */
margin: 0 -120px 0 5px;
padding: 0;
}
#post-body ul.category-tabs li,
#post-body ul.add-menu-item-tabs li {
padding: 8px;
}
#post-body ul.category-tabs li.tabs,
#post-body ul.add-menu-item-tabs li.tabs {
-webkit-border-top-left-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.wp-tab-panel,
.categorydiv div.tabs-panel,
.customlinkdiv div.tabs-panel,
.posttypediv div.tabs-panel,
.taxonomydiv div.tabs-panel,
#linkcategorydiv div.tabs-panel {
height: 200px;
overflow: auto;
padding: 0.5em 0.9em;
border-style: solid;
border-width: 1px;
}
.nav-menus-php .customlinkdiv div.tabs-panel,
.nav-menus-php .posttypediv div.tabs-panel,
.nav-menus-php .taxonomydiv div.tabs-panel {
height: auto;
max-height: 205px;
}
div.tabs-panel-active {
display:block;
}
div.tabs-panel-inactive {
display:none;
}
#post-body .categorydiv div.tabs-panel,
.taxonomy div.tabs-panel,
#post-body #linkcategorydiv div.tabs-panel {
margin: 0 5px 0 125px;
}
.press-this #side-sortables .category-tabs li,
.has-right-sidebar #side-sortables .category-tabs li,
ul.category-tabs li,
#side-sortables .add-menu-item-tabs li,
.wp-tab-bar li {
display: inline;
line-height: 1.35em;
}
.no-js #side-sortables .category-tabs li.hide-if-no-js {
.no-js .category-tabs li.hide-if-no-js {
display: none;
}
#side-sortables .category-tabs a,
.category-tabs a,
#side-sortables .add-menu-item-tabs a,
.wp-tab-bar a {
text-decoration: none;
}
#side-sortables .category-tabs {
.category-tabs {
margin: 8px 0 3px;
}
@ -2834,16 +2899,6 @@ div.tabs-panel-inactive {
margin-bottom: 3px;
}
.categorydiv ul,
.customlinkdiv ul,
.posttypediv ul,
.taxonomydiv ul,
#linkcategorydiv ul {
list-style: none;
padding: 0;
margin: 0;
}
#normal-sortables .postbox #replyrow .submit {
float: none;
margin: 0;
@ -2867,14 +2922,13 @@ ul.wp-tab-bar {
margin-top: 12px;
}
ul.category-tabs li.tabs,
ul.category-tabs li,
ul.add-menu-item-tabs li.tabs,
.wp-tab-active {
border-style: solid solid none;
border-width: 1px 1px 0;
}
#post-body .category-tabs li.tabs,
#post-body .add-menu-item-tabs li.tabs {
border-style: solid none solid solid;
border-width: 1px 0 1px 1px;
@ -3141,7 +3195,6 @@ table.diff .diff-deletedline del, table.diff .diff-addedline ins {
margin: 0;
}
#post-body ul.category-tabs,
#post-body ul.add-menu-item-tabs {
float: left;
width: 120px;
@ -3151,12 +3204,10 @@ table.diff .diff-deletedline del, table.diff .diff-addedline ins {
padding: 0;
}
#post-body ul.category-tabs li,
#post-body ul.add-menu-item-tabs li {
padding: 8px;
}
#post-body ul.category-tabs li.tabs,
#post-body ul.add-menu-item-tabs li.tabs {
-webkit-border-top-left-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
@ -3164,11 +3215,11 @@ table.diff .diff-deletedline del, table.diff .diff-addedline ins {
border-bottom-left-radius: 3px;
}
.wp-tab-panel,
.categorydiv div.tabs-panel,
.customlinkdiv div.tabs-panel,
.posttypediv div.tabs-panel,
.taxonomydiv div.tabs-panel,
#linkcategorydiv div.tabs-panel {
.taxonomydiv div.tabs-panel {
height: 200px;
overflow: auto;
padding: 0.5em 0.9em;
@ -3191,17 +3242,14 @@ div.tabs-panel-inactive {
display:none;
}
#post-body .categorydiv div.tabs-panel,
.taxonomy div.tabs-panel,
#post-body #linkcategorydiv div.tabs-panel {
.colunms-1 .categorydiv div.tabs-panel,
.taxonomy div.tabs-panel {
margin: 0 5px 0 125px;
}
.categorydiv ul,
.customlinkdiv ul,
.posttypediv ul,
.taxonomydiv ul,
#linkcategorydiv ul {
.taxonomydiv ul {
list-style: none;
padding: 0;
margin: 0;
@ -3214,8 +3262,7 @@ ul.export-filters,
.categorydiv ul.categorychecklist ul,
.customlinkdiv ul.categorychecklist ul,
.posttypediv ul.categorychecklist ul,
.taxonomydiv ul.categorychecklist ul,
#linkcategorydiv ul.categorychecklist ul {
.taxonomydiv ul.categorychecklist ul {
margin-left: 18px;
}
@ -4244,7 +4291,6 @@ h3.available-themes {
font-size: 15px;
}
#post-body ul.category-tabs li.tabs a,
#post-body ul.add-menu-item-tabs li.tabs a,
#TB_window #TB_title a.tb-theme-preview-link,
#TB_window #TB_title a.tb-theme-preview-link:visited {
@ -5170,10 +5216,6 @@ body.full-overlay-active {
width: 98%;
}
.wp-editor-container textarea.wp-editor-area {
width: 99.9%;
}
#template div {
margin-right: 190px;
}

View File

@ -272,17 +272,9 @@ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
?>
<div id="poststuff" class="metabox-holder<?php echo 1 != $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
<div id="side-info-column" class="inner-sidebar">
<?php
if ( 1 != $screen_layout_columns ) {
('page' == $post_type) ? do_action('submitpage_box') : do_action('submitpost_box');
$side_meta_boxes = do_meta_boxes($post_type, 'side', $post);
}
?>
</div>
<div id="poststuff">
<div id="post-body">
<div id="post-body" class="metabox-holder columns-<?php echo 1 == $screen_layout_columns ? '1' : '2'; ?>">
<div id="post-body-content">
<?php if ( post_type_supports($post_type, 'title') ) { ?>
<div id="titlediv">
@ -338,25 +330,43 @@ wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
</tr></tbody></table>
</div>
</div><!-- /post-body-content -->
<?php
}
if ( 1 == $screen_layout_columns ) {
('page' == $post_type) ? do_action('submitpage_box') : do_action('submitpost_box');
$side_meta_boxes = do_meta_boxes($post_type, 'side', $post);
}
?>
<div id="postbox-container-1" class="postbox-container">
<?php
if ( 'page' == $post_type )
do_action('submitpage_box');
else
do_action('submitpost_box');
do_meta_boxes($post_type, 'side', $post);
?>
</div>
<div id="postbox-container-2" class="postbox-container">
<?php
do_meta_boxes(null, 'normal', $post);
( 'page' == $post_type ) ? do_action('edit_page_form') : do_action('edit_form_advanced');
if ( 'page' == $post_type )
do_action('edit_page_form');
else
do_action('edit_form_advanced');
do_meta_boxes(null, 'advanced', $post);
do_action('dbx_post_sidebar'); ?>
?>
</div>
<?php
</div>
</div>
do_action('dbx_post_sidebar');
?>
</div><!-- /post-body -->
<br class="clear" />
</div><!-- /poststuff -->
</form>

View File

@ -16,13 +16,60 @@ if ( !defined('ABSPATH') )
<?php screen_icon(); ?>
<h2><?php _e('Edit Comment'); ?></h2>
<div id="poststuff" class="metabox-holder has-right-sidebar">
<div id="poststuff">
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID; ?>" />
<input type="hidden" name="action" value="editedcomment" />
<input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
<input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
<div id="side-info-column" class="inner-sidebar">
<div id="post-body" class="metabox-holder columns-2">
<div id="post-body-content">
<div id="namediv" class="stuffbox">
<h3><label for="name"><?php _e( 'Author' ) ?></label></h3>
<div class="inside">
<table class="form-table editcomment">
<tbody>
<tr valign="top">
<td class="first"><?php _e( 'Name:' ); ?></td>
<td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" tabindex="1" id="name" /></td>
</tr>
<tr valign="top">
<td class="first">
<?php
if ( $comment->comment_author_email ) {
printf( __( 'E-mail (%s):' ), get_comment_author_email_link( __( 'send e-mail' ), '', '' ) );
} else {
_e( 'E-mail:' );
}
?></td>
<td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" tabindex="2" id="email" /></td>
</tr>
<tr valign="top">
<td class="first">
<?php
if ( ! empty( $comment->comment_author_url ) && 'http://' != $comment->comment_author_url ) {
$link = '<a href="' . $comment->comment_author_url . '" rel="external nofollow" target="_blank">' . __('visit site') . '</a>';
printf( __( 'URL (%s):' ), apply_filters('get_comment_author_link', $link ) );
} else {
_e( 'URL:' );
} ?></td>
<td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" tabindex="3" /></td>
</tr>
</tbody>
</table>
<br />
</div>
</div>
<div id="postdiv" class="postarea">
<?php
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );
wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
</div>
</div><!-- /post-body-content -->
<div id="postbox-container-1" class="postbox-container">
<div id="submitdiv" class="stuffbox" >
<h3><span class='hndle'><?php _e('Status') ?></span></h3>
<div class="inside">
@ -69,69 +116,27 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
</div>
</div>
</div>
</div>
</div><!-- /submitdiv -->
</div>
<div id="post-body">
<div id="post-body-content">
<div id="namediv" class="stuffbox">
<h3><label for="name"><?php _e( 'Author' ) ?></label></h3>
<div class="inside">
<table class="form-table editcomment">
<tbody>
<tr valign="top">
<td class="first"><?php _e( 'Name:' ); ?></td>
<td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" tabindex="1" id="name" /></td>
</tr>
<tr valign="top">
<td class="first">
<?php
if ( $comment->comment_author_email ) {
printf( __( 'E-mail (%s):' ), get_comment_author_email_link( __( 'send e-mail' ), '', '' ) );
} else {
_e( 'E-mail:' );
}
?></td>
<td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" tabindex="2" id="email" /></td>
</tr>
<tr valign="top">
<td class="first">
<?php
if ( ! empty( $comment->comment_author_url ) && 'http://' != $comment->comment_author_url ) {
$link = '<a href="' . $comment->comment_author_url . '" rel="external nofollow" target="_blank">' . __('visit site') . '</a>';
printf( __( 'URL (%s):' ), apply_filters('get_comment_author_link', $link ) );
} else {
_e( 'URL:' );
} ?></td>
<td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" tabindex="3" /></td>
</tr>
</tbody>
</table>
<br />
</div>
</div>
<div id="postdiv" class="postarea">
<div id="postbox-container-2" class="postbox-container">
<?php
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );
wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
</div>
<?php
do_action('add_meta_boxes', 'comment', $comment);
do_action('add_meta_boxes_comment', $comment);
do_meta_boxes(null, 'normal', $comment);
?>
</div>
<input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID) ?>" />
<input type="hidden" name="p" value="<?php echo esc_attr($comment->comment_post_ID) ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
<?php wp_original_referer_field(true, 'previous'); ?>
<input type="hidden" name="noredir" value="1" />
</div>
</div>
</div><!-- /post-body -->
</div>
</div>
</form>

View File

@ -75,17 +75,9 @@ wp_nonce_field( $nonce_action );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
<div id="poststuff" class="metabox-holder<?php echo 1 != $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
<div id="side-info-column" class="inner-sidebar">
<?php
if ( 1 != $screen_layout_columns ) {
do_action('submitlink_box');
$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
}
?>
</div>
<div id="poststuff">
<div id="post-body">
<div id="post-body" class="metabox-holder columns-<?php echo 1 == $screen_layout_columns ? '1' : '2'; ?>">
<div id="post-body-content">
<div id="namediv" class="stuffbox">
<h3><label for="link_name"><?php _ex('Name', 'link name') ?></label></h3>
@ -110,18 +102,27 @@ if ( 1 != $screen_layout_columns ) {
<p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
</div>
</div>
</div><!-- /post-body-content -->
<div id="postbox-container-1" class="postbox-container">
<?php
if ( 1 == $screen_layout_columns ) {
do_action('submitlink_box');
$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
}
do_action('submitlink_box');
$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
?>
</div>
<div id="postbox-container-2" class="postbox-container">
<?php
do_meta_boxes(null, 'normal', $link);
do_meta_boxes(null, 'advanced', $link);
?>
</div>
<?php
if ( $link_id ) : ?>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
@ -131,7 +132,6 @@ if ( $link_id ) : ?>
<input type="hidden" name="action" value="add" />
<?php endif; ?>
</div>
</div>
</div>

View File

@ -196,51 +196,28 @@ function wp_dashboard() {
global $screen_layout_columns;
$screen = get_current_screen();
$class = 'columns-' . $screen_layout_columns;
$hide2 = $hide3 = $hide4 = '';
switch ( $screen_layout_columns ) {
case 4:
$width = 'width:25%;';
break;
case 3:
$width = 'width:33.333333%;';
$hide4 = 'display:none;';
break;
case 2:
$width = 'width:50%;';
$hide3 = $hide4 = 'display:none;';
break;
default:
$width = 'width:100%;';
$hide2 = $hide3 = $hide4 = 'display:none;';
}
?>
<div id="dashboard-widgets" class="metabox-holder">
<?php
echo "\t<div id='postbox-container-1' class='postbox-container' style='$width'>\n";
do_meta_boxes( $screen->id, 'normal', '' );
<div id="dashboard-widgets" class="metabox-holder <?php echo $class; ?>">
<div id='postbox-container-1' class='postbox-container'>
<?php do_meta_boxes( $screen->id, 'normal', '' ); ?>
</div>
<div id='postbox-container-2' class='postbox-container'>
<?php do_meta_boxes( $screen->id, 'side', '' ); ?>
</div>
<div id='postbox-container-3' class='postbox-container'>
<?php do_meta_boxes( $screen->id, 'column3', '' ); ?>
</div>
<div id='postbox-container-4' class='postbox-container'>
<?php do_meta_boxes( $screen->id, 'column4', '' ); ?>
</div>
</div>
echo "\t</div><div id='postbox-container-2' class='postbox-container' style='{$hide2}$width'>\n";
do_meta_boxes( $screen->id, 'side', '' );
echo "\t</div><div id='postbox-container-3' class='postbox-container' style='{$hide3}$width'>\n";
do_meta_boxes( $screen->id, 'column3', '' );
echo "\t</div><div id='postbox-container-4' class='postbox-container' style='{$hide4}$width'>\n";
do_meta_boxes( $screen->id, 'column4', '' );
?>
</div></div>
<form style="display:none" method="get" action="">
<p>
<?php
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
?>
</p>
</form>
<?php
}
/* Dashboard Widgets */

View File

@ -658,38 +658,41 @@ if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('m
*
* @param object $link
*/
function link_categories_meta_box($link) { ?>
<ul id="category-tabs" class="category-tabs">
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
</ul>
<div id="categories-all" class="tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php
if ( isset($link->link_id) )
wp_link_category_checklist($link->link_id);
else
wp_link_category_checklist();
?>
function link_categories_meta_box($link) {
?>
<div id="taxonomy-linkcategory" class="categorydiv">
<ul id="category-tabs" class="category-tabs">
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
</ul>
</div>
<div id="categories-pop" class="tabs-panel" style="display: none;">
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
<?php wp_popular_terms_checklist('link_category'); ?>
</ul>
</div>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="link-category-add" class="wp-hidden-child">
<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
<input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
</p>
<div id="categories-all" class="tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php
if ( isset($link->link_id) )
wp_link_category_checklist($link->link_id);
else
wp_link_category_checklist();
?>
</ul>
</div>
<div id="categories-pop" class="tabs-panel" style="display: none;">
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
<?php wp_popular_terms_checklist('link_category'); ?>
</ul>
</div>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="link-category-add" class="wp-hidden-child">
<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
<input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
</p>
</div>
</div>
<?php
}

View File

@ -929,12 +929,12 @@ final class WP_Screen {
}
?>
<h5><?php _e('Screen Layout'); ?></h5>
<h5 class="screen-layout"><?php _e('Screen Layout'); ?></h5>
<div class='columns-prefs'><?php
_e('Number of Columns:');
for ( $i = 1; $i <= $num; ++$i ):
?>
<label>
<label class="columns-prefs-<?php echo $i; ?>">
<input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>'
<?php checked( $screen_layout_columns, $i ); ?> />
<?php echo esc_html( $i ); ?>

View File

@ -351,7 +351,7 @@ $(document).ready( function() {
});
}
// auto-fold the menu when screen is under 800px
// auto-fold the menu when screen is under 900px
$(window).bind('resize.autofold', function(){
if ( getUserSetting('mfold') == 'f' )
return;
@ -359,7 +359,7 @@ $(document).ready( function() {
var width = $(window).width();
// fold admin menu
if ( width <= 800 ) {
if ( width <= 900 ) {
if ( !folded ) {
$(document.body).addClass('folded');
folded = true;

View File

@ -3,7 +3,9 @@ var postboxes, is_iPad = navigator.userAgent.match(/iPad/);
(function($) {
postboxes = {
add_postbox_toggles : function(page, args) {
this.init(page, args);
var self = this;
self.init(page, args);
$('.postbox h3, .postbox .handlediv').bind('click.postboxes', function() {
var p = $(this).parent('.postbox'), id = p.attr('id');
@ -12,13 +14,15 @@ var postboxes, is_iPad = navigator.userAgent.match(/iPad/);
return;
p.toggleClass('closed');
postboxes.save_state(page);
if ( page != 'press-this' )
self.save_state(page);
if ( id ) {
if ( !p.hasClass('closed') && $.isFunction(postboxes.pbshow) )
postboxes.pbshow(id);
self.pbshow(id);
else if ( p.hasClass('closed') && $.isFunction(postboxes.pbhide) )
postboxes.pbhide(id);
self.pbhide(id);
}
});
@ -38,22 +42,22 @@ var postboxes, is_iPad = navigator.userAgent.match(/iPad/);
if ( $(this).prop('checked') ) {
$('#' + box).show();
if ( $.isFunction( postboxes.pbshow ) )
postboxes.pbshow( box );
self.pbshow( box );
} else {
$('#' + box).hide();
if ( $.isFunction( postboxes.pbhide ) )
postboxes.pbhide( box );
self.pbhide( box );
}
postboxes.save_state(page);
postboxes._mark_area();
self.save_state(page);
self._mark_area();
});
$('.columns-prefs input[type="radio"]').bind('click.postboxes', function(){
var n = parseInt($(this).val(), 10), pb = postboxes;
var n = parseInt($(this).val(), 10);
if ( n ) {
pb._pb_edit(n);
pb.save_order(page);
self._pb_edit(n);
self.save_order(page);
}
});
},
@ -88,8 +92,8 @@ var postboxes, is_iPad = navigator.userAgent.match(/iPad/);
}
});
if ( navigator.userAgent.match(/iPad/) ) {
$(document.body).bind('orientationchange', function(){ postboxes._pb_change(); });
if ( navigator.userAgent.match(/mobile/i) ) {
$(document.body).bind('orientationchange.postboxes', function(){ postboxes._pb_change(); });
this._pb_change();
}
@ -124,89 +128,22 @@ var postboxes, is_iPad = navigator.userAgent.match(/iPad/);
$.post( ajaxurl, postVars );
},
_colname : function(n) {
switch (n) {
case 1:
return 'normal';
break
case 2:
return 'side';
break
case 3:
return 'column3';
break
case 4:
return 'column4';
break
default:
return '';
}
},
_mark_area : function() {
$('#side-info-column .meta-box-sortables:visible, #dashboard-widgets .meta-box-sortables:visible').each(function(n, el){
var visible = $('div.postbox:visible').length;
$('#post-body .meta-box-sortables:visible, #dashboard-widgets .meta-box-sortables:visible').not('#advanced-sortables').each(function(n, el){
var t = $(this);
if ( !t.children('.postbox:visible').length )
t.addClass('empty-container');
else
if ( visible == 1 || t.children('.postbox:visible').length )
t.removeClass('empty-container');
else
t.addClass('empty-container');
});
},
_pb_edit : function(n) {
var ps = $('#poststuff'), i, el, done, pb = postboxes, visible = $('.postbox-container:visible').length;
if ( n == visible )
return;
if ( ps.length ) {
if ( n == 2 ) {
$('.wrap').removeClass('columns-1').addClass('columns-2');
ps.addClass('has-right-sidebar');
if ( !$('#side-info-column #side-sortables').length )
$('#side-info-column').append( $('#side-sortables') );
} else if ( n == 1 ) {
$('.wrap').removeClass('columns-2').addClass('columns-1');
ps.removeClass('has-right-sidebar');
if ( !$('#post-body-content #side-sortables').length )
$('#normal-sortables').before( $('#side-sortables') );
}
} else {
for ( i = 4; ( i > n && i > 1 ); i-- ) {
el = $('#' + postboxes._colname(i) + '-sortables');
$('#' + postboxes._colname(i-1) + '-sortables').append(el.children('.postbox'));
el.parent().hide();
}
for ( i = n; i > 0; i-- ) {
el = $('#' + postboxes._colname(i) + '-sortables');
done = false;
if ( el.parent().is(':hidden') ) {
switch ( i ) {
case 4:
done = pb._move_one( el, $('.postbox:visible', $('#column3-sortables')) );
case 3:
if ( !done )
done = pb._move_one( el, $('.postbox:visible', $('#side-sortables')) );
case 2:
if ( !done )
done = pb._move_one( el, $('.postbox:visible', $('#normal-sortables')) );
default:
if ( !done )
el.addClass('empty-container')
}
el.parent().show();
}
}
$('.postbox-container:visible').css('width', 100/n + '%');
}
var el = $('.metabox-holder').get(0);
el.className = el.className.replace(/columns-\d+/, 'columns-' + n);
},
_pb_change : function() {
@ -225,14 +162,6 @@ var postboxes, is_iPad = navigator.userAgent.match(/iPad/);
}
},
_move_one : function(el, move) {
if ( move.length > 1 ) {
el.append( move.last() );
return true;
}
return false;
},
/* Callbacks */
pbshow : false,