git-svn-id: https://develop.svn.wordpress.org/trunk@9545 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-11-06 08:13:50 +00:00
parent 8796e7cfe1
commit 7b2d2b7a11
16 changed files with 113 additions and 37 deletions

View File

@ -131,7 +131,7 @@ $messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.'); $messages[5] = __('Category not updated.');
?> ?>
<?php screen_options('category') ?> <?php screen_meta('category') ?>
<div class="wrap nosubsub"> <div class="wrap nosubsub">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -81,7 +81,7 @@ $post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0;
$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : ''; $search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
$search = attribute_escape( $search_dirty ); ?> $search = attribute_escape( $search_dirty ); ?>
<?php screen_options('comment') ?> <?php screen_meta('comment') ?>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -471,8 +471,7 @@ add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'p
endif; endif;
?> ?>
<?php screen_meta('post', 1, 'edit-post'); ?>
<?php screen_options('post', 1) ?>
<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?> <?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
<input type="hidden" name="mode" value="bookmarklet" /> <input type="hidden" name="mode" value="bookmarklet" />

View File

@ -60,7 +60,7 @@ $messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.'); $messages[5] = __('Category not updated.');
$messages[6] = __('Categories deleted.'); ?> $messages[6] = __('Categories deleted.'); ?>
<?php screen_options('link-category') ?> <?php screen_meta('link-category') ?>
<div class="wrap nosubsub"> <div class="wrap nosubsub">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -309,7 +309,7 @@ function link_advanced_meta_box($link) {
} }
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core'); ?> add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core'); ?>
<?php screen_options('link', 1) ?> <?php screen_meta('link', 1) ?>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -376,7 +376,7 @@ add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'p
endif; endif;
?> ?>
<?php screen_options('page', 1); ?> <?php screen_meta('page', 1); ?>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -100,7 +100,7 @@ if ( is_singular() ) {
require_once('admin-header.php'); ?> require_once('admin-header.php'); ?>
<?php screen_options('page') ?> <?php screen_meta('page') ?>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -129,7 +129,7 @@ $messages[4] = __('Tag not added.');
$messages[5] = __('Tag not updated.'); $messages[5] = __('Tag not updated.');
$messages[6] = __('Tags deleted.'); ?> $messages[6] = __('Tags deleted.'); ?>
<?php screen_options('tag') ?> <?php screen_meta('tag') ?>
<div class="wrap nosubsub"> <div class="wrap nosubsub">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -90,7 +90,7 @@ if ( empty($_GET['mode']) )
else else
$mode = attribute_escape($_GET['mode']); ?> $mode = attribute_escape($_GET['mode']); ?>
<?php screen_options('post') ?> <?php screen_meta('post') ?>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -3122,10 +3122,10 @@ function _post_states($post) {
} }
} }
function screen_options($screen, $metabox = false) { function screen_meta($screen, $metabox = false, $page = '') {
?> ?>
<div id="screen-options"> <div id="screen-meta">
<div id="screen-options-wrap" class="hidden"> <div id="screen-options-wrap" class="hidden">
<h5><?php _e('Show on screen') ?></h5> <h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get"> <form id="adv-settings" action="" method="get">
<div class="metabox-prefs"> <div class="metabox-prefs">
@ -3139,13 +3139,63 @@ function screen_options($screen, $metabox = false) {
?> ?>
<br class="clear" /> <br class="clear" />
</div></form> </div></form>
</div> </div>
<div id="screen-options-link-wrap" class="hide-if-no-js screen-options-closed"> <?php
<a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options') ?></a> if ( '' != $page ) {
// Allow a plugin to short-circuit
$help = apply_filters('contextual_help', '', $page);
if ( !empty($help) )
return;
global $title;
$help['edit-post'] = __('<a href="http://codex.wordpress.org/Writing_Posts">Writing Posts</a>');
$help['general-settings'] = __('<a href="http://codex.wordpress.org/Settings_General_SubPanel">General Settings</a>');
?>
<div id="contextual-help-wrap" class="hidden">
<?php
if ( isset($help[$page]) ) {
if ( isset($title) && 'edit-post' != $page )
echo '<h5>' . sprintf(__('Get help with "%s"'), $title) . '</h5>';
else
echo '<h5>' . __('Get help with this page') . '</h5>';
echo '<div class="metabox-prefs">' . $help[$page] . "</div>\n";
echo '<h5>' . __('Other Help') . '</h5>';
} else {
echo '<h5>' . __('Help') . '</h5>';
}
echo '<div class="metabox-prefs">';
_e('<a href="http://codex.wordpress.org/">Documentation</a>');
echo '<br />';
_e('<a href="http://wordpress.org/support/">Support Forums</a>');
echo "</div>\n";
?>
</div> </div>
<?php
}
?>
<div id="screen-meta-links">
<?php if ( '' != $page ) { ?>
<div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">
<a href="#contextual-help" id="contextual-help-link" class="show-settings"><?php _e('Help') ?></a>
</div>
<?php } ?>
<div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">
<a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options') ?></a>
</div>
</div>
</div> </div>
<?php <?php
}
function contextual_help( ) {
} }
?> ?>

View File

@ -28,7 +28,7 @@ require_once('admin-header.php');
$today = current_time('mysql', 1); $today = current_time('mysql', 1);
?> ?>
<?php screen_options('dashboard', 1); ?> <?php screen_meta('dashboard', 1); ?>
<div class="wrap"> <div class="wrap">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -1,14 +1,31 @@
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
$('#show-settings-link').click(function () { $('#show-settings-link').click(function () {
$('#screen-options-wrap').slideToggle('normal', function(){ $('#screen-options-wrap').slideToggle('fast', function(){
if ( $(this).hasClass('screen-options-open') ) { if ( $(this).hasClass('screen-options-open') ) {
$('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'}); $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
$('#contextual-help-link-wrap').removeClass('invisible');
$(this).removeClass('screen-options-open'); $(this).removeClass('screen-options-open');
} else { } else {
$('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'}); $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'});
$('#contextual-help-link-wrap').addClass('invisible');
$(this).addClass('screen-options-open'); $(this).addClass('screen-options-open');
} }
}); });
return false; return false;
}).parent();
$('#contextual-help-link').click(function () {
$('#contextual-help-wrap').slideToggle('fast', function(){
if ( $(this).hasClass('contextual-help-open') ) {
$('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
$('#screen-options-link-wrap').removeClass('invisible');
$(this).removeClass('contextual-help-open');
} else {
$('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'});
$('#screen-options-link-wrap').addClass('invisible');
$(this).addClass('contextual-help-open');
}
});
return false;
}); });
}); });

View File

@ -74,7 +74,7 @@ switch ($order_by) {
break; break;
} ?> } ?>
<?php screen_options('link') ?> <?php screen_meta('link') ?>
<div class="wrap nosubsub"> <div class="wrap nosubsub">
<h2><?php echo wp_specialchars( $title ); ?></h2> <h2><?php echo wp_specialchars( $title ); ?></h2>

View File

@ -145,7 +145,7 @@ if ( is_singular() ) {
require_once('admin-header.php'); ?> require_once('admin-header.php'); ?>
<?php screen_options('media') ?> <?php screen_meta('media') ?>
<?php <?php
if ( isset($_GET['posted']) && (int) $_GET['posted'] ) { if ( isset($_GET['posted']) && (int) $_GET['posted'] ) {

View File

@ -237,7 +237,7 @@ default:
} }
endif; ?> endif; ?>
<?php screen_options('user') ?> <?php screen_meta('user') ?>
<?php if ( isset($errors) && is_wp_error( $errors ) ) : ?> <?php if ( isset($errors) && is_wp_error( $errors ) ) : ?>
<div class="error"> <div class="error">

View File

@ -1,3 +1,10 @@
#wpbody {
clear: both;
}
.plugins .name, .plugins .name,
#pass-strength-result.strong, #pass-strength-result.strong,
#pass-strength-result.short, #pass-strength-result.short,
@ -1494,6 +1501,7 @@ table.form-table td .updated {
font-weight: bold; font-weight: bold;
padding: 6px 7px; padding: 6px 7px;
margin: 0 0 10px; margin: 0 0 10px;
line-height: 1;
} }
.metabox-holder .postbox, .metabox-holder .postbox,
@ -1502,6 +1510,7 @@ table.form-table td .updated {
margin-bottom: 20px; margin-bottom: 20px;
border-width: 1px; border-width: 1px;
border-style: solid; border-style: solid;
line-height: 1;
-moz-border-radius: 6px; -moz-border-radius: 6px;
-khtml-border-radius: 6px; -khtml-border-radius: 6px;
-webkit-border-radius: 6px; -webkit-border-radius: 6px;
@ -2355,27 +2364,30 @@ fieldset {
/* show/hide settings */ /* show/hide settings */
#screen-options { #screen-meta {
position: relative; position: relative;
clear: both; clear: both;
} }
#wpbody { #screen-meta-links {
clear: both; margin: 0 20px 0 0;
} }
#screen-options-link-wrap { #screen-meta .invisible {
visibility: hidden;
}
#screen-options-link-wrap,
#contextual-help-link-wrap {
float: right; float: right;
background: transparent url( images/screen-options-left.gif ) no-repeat 0 0; background: transparent url( images/screen-options-left.gif ) no-repeat 0 0;
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
height: 23px; height: 23px;
padding: 0; padding: 0;
position: relative; margin: -1px 10px 0 0;
right: 100px;
top: -1px;
} }
#screen-options a.show-settings { #screen-meta a.show-settings {
text-decoration: none; text-decoration: none;
z-index: 1; z-index: 1;
padding: 0 18px 0 8px; padding: 0 18px 0 8px;
@ -2388,25 +2400,23 @@ fieldset {
background-color: transparent; background-color: transparent;
} }
#screen-options a#show-settings-link { #screen-meta a.show-settings {
background-image: url( images/screen-options-right.gif ); background-image: url( images/screen-options-right.gif );
} }
#screen-options a#hide-settings-link { #screen-meta a.show-settings:hover {
background-image: url( images/screen-options-right-up.gif );
}
#screen-options a.show-settings:hover {
text-decoration: none; text-decoration: none;
} }
#screen-options-wrap h5 { #screen-options-wrap h5,
#contextual-help-wrap h5 {
padding: 10px 0 0 15px; padding: 10px 0 0 15px;
margin: 0; margin: 0;
font-size: 13px; font-size: 13px;
} }
#screen-options-wrap { #screen-options-wrap,
#contextual-help-wrap {
border-style: none solid solid; border-style: none solid solid;
border-top: 0 none; border-top: 0 none;
border-width: 0 1px 1px; border-width: 0 1px 1px;