Move Page Options button to the header

git-svn-id: http://svn.automattic.com/wordpress/trunk@9054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-10-02 01:32:27 +00:00
parent 5fd146865b
commit 28d9d8fde9
15 changed files with 35 additions and 72 deletions

View File

@ -105,4 +105,11 @@ if ( $parent_file == 'options-general.php' ) {
favorite_actions();
?>
$settings_pages = array( 'categories.php', 'edit.php', 'edit-comments.php', 'edit-form-advanced.php', 'edit-link-categories.php', 'edit-link-form.php', 'edit-page-form.php', 'edit-tags.php', 'link-manager.php', 'upload.php', 'users.php', 'edit-pages.php' );
if ( in_array( $pagenow, $settings_pages ) ) { ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="show-settings" style="display:none;"><?php _e('Hide Options') ?></a>
</div>
<?php } ?>

View File

@ -121,10 +121,7 @@ $messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.');
?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -132,7 +129,7 @@ $messages[5] = __('Category not updated.');
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<?php
if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>

View File

@ -81,10 +81,7 @@ $post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0;
$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
$search = attribute_escape( $search_dirty ); ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -92,7 +89,7 @@ $search = attribute_escape( $search_dirty ); ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<?php
if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {

View File

@ -401,17 +401,14 @@ endif;
?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
<?php meta_box_prefs('post') ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>

View File

@ -58,10 +58,7 @@ $messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.');
$messages[6] = __('Categories deleted.'); ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -69,7 +66,7 @@ $messages[6] = __('Categories deleted.'); ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div>

View File

@ -263,10 +263,7 @@ function link_advanced_meta_box($link) {
}
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core'); ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -274,7 +271,7 @@ add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link'
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<div class="wrap">

View File

@ -277,10 +277,7 @@ add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'p
endif;
?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -288,7 +285,7 @@ endif;
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<div class="wrap">

View File

@ -100,10 +100,7 @@ if ( is_singular() ) {
require_once('admin-header.php'); ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -111,7 +108,7 @@ require_once('admin-header.php'); ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<div class="wrap">

View File

@ -125,10 +125,7 @@ $messages[4] = __('Tag not added.');
$messages[5] = __('Tag not updated.');
$messages[6] = __('Tags deleted.'); ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -136,7 +133,7 @@ $messages[6] = __('Tags deleted.'); ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div>

View File

@ -90,10 +90,7 @@ if ( empty($_GET['mode']) )
else
$mode = attribute_escape($_GET['mode']); ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -101,8 +98,7 @@ else
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<div class="wrap">
<?php

View File

@ -1,14 +1,19 @@
jQuery(document).ready( function($) {
$('#show-settings-link').click(function () {
$(this).hide()
$('#edit-settings-wrap').slideDown('normal');
$('#edit-settings-wrap').slideDown('normal', function(){
$('#hide-settings-link').show();
$('#show-settings-link').hide();
});
return false;
});
$('#hide-settings-link').click(function () {
$('#edit-settings-wrap').slideUp('normal', function(){
$('#show-settings-link').show();
$('#hide-settings-link').hide();
});
return false;
});
});

View File

@ -74,10 +74,7 @@ switch ($order_by) {
break;
} ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -85,7 +82,7 @@ switch ($order_by) {
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<?php
if ( isset($_GET['deleted']) ) {

View File

@ -145,10 +145,7 @@ if ( is_singular() ) {
require_once('admin-header.php'); ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -156,7 +153,7 @@ require_once('admin-header.php'); ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<?php
if ( isset($_GET['posted']) && (int) $_GET['posted'] ) {

View File

@ -237,10 +237,7 @@ default:
}
endif; ?>
<div id="edit-settings">
<a href="#edit_settings" id="show-settings-link" class="hide-if-no-js show-settings"><?php _e('Page Options') ?></a>
<div id="edit-settings-wrap" class="hidden">
<a href="#edit_settings" id="hide-settings-link" class="show-settings"><?php _e('Hide Options') ?></a>
<h5><?php _e('Show on screen') ?></h5>
<form id="adv-settings" action="" method="get">
<div class="metabox-prefs">
@ -248,7 +245,7 @@ default:
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<br class="clear" />
</div></form>
</div></div>
</div>
<?php if ( isset($errors) && is_wp_error( $errors ) ) : ?>
<div class="error">

View File

@ -2052,31 +2052,19 @@ a.togbox {
}
/* show/hide settings */
#show-settings-link,
#hide-settings-link {
#edit-settings {
position: absolute;
right: 200px;
top: 46px;
}
.show-settings {
display: block;
height: 18px;
font-size: 11px;
text-decoration: none;
z-index: 1;
}
#show-settings-link {
position: absolute;
padding: 3px 8px 1px;
right: 15px;
top: 0;
}
#hide-settings-link {
float: right;
padding: 3px 8px;
position: relative;
}
#edit-settings {
position: relative;
top: -12px;
}
#edit-settings-wrap h5 {
@ -2089,7 +2077,7 @@ a.togbox {
border-style: none solid solid;
border-top: 0 none;
border-width: 0 1px 1px;
margin: 0 15px;
margin: -10px 15px 10px;
-moz-border-radius: 0 0 4px 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px;