Permalink
Browse files

Remove nearly all tabindex attributes from the admin, leaving them on…

…ly where absolutely necessary (for now that's only the toolbar).

Add tabindex="-1" for the menu images links to avoid double tab stops there when the menu is expanded.

Fix/add auto-focus on the first input fields on the Add/Edit Post, all taxonomy, all edit taxonomy, Log In and Edit Comment screens.

See #21340.

git-svn-id: http://core.svn.wordpress.org/trunk@21311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 6d556cb commit 34535097b7ded7607ef3eaf84d774a6284dfac4a azaozz committed Jul 24, 2012
@@ -283,7 +283,7 @@
<div id="titlediv">
<div id="titlewrap">
<label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
- <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
+ <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
</div>
<div class="inside">
<?php
@@ -312,7 +312,7 @@
<?php if ( post_type_supports($post_type, 'editor') ) { ?>
<div id="postdivrich" class="postarea">
-<?php wp_editor($post->post_content, 'content', array('dfw' => true, 'tabindex' => 1, 'tabfocus_elements' => 'sample-permalink,post-preview') ); ?>
+<?php wp_editor($post->post_content, 'content', array('dfw' => true, 'tabfocus_elements' => 'sample-permalink,post-preview') ); ?>
<table id="post-status-info" cellspacing="0"><tbody><tr>
<td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
@@ -378,7 +378,7 @@
wp_comment_reply();
?>
-<?php if ((isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?>
+<?php if ( (isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message']) ) : ?>
<script type="text/javascript">
try{document.post.title.focus();}catch(e){}
</script>
@@ -31,7 +31,7 @@
<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>
+ <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td>
</tr>
<tr valign="top">
<td class="first">
@@ -42,7 +42,7 @@
_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>
+ <td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" /></td>
</tr>
<tr valign="top">
<td class="first">
@@ -53,7 +53,7 @@
} 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>
+ <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); ?>" /></td>
</tr>
</tbody>
</table>
@@ -98,8 +98,8 @@
$stamp = __('Submitted on: <b>%1$s</b>');
$date = date_i18n( $datef, strtotime( $comment->comment_date ) );
?>
-<span id="timestamp"><?php printf($stamp, $date); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
-<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0, 5); ?></div>
+<span id="timestamp"><?php printf($stamp, $date); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a>
+<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
</div>
</div> <!-- misc actions -->
<div class="clear"></div>
@@ -110,7 +110,7 @@
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
</div>
<div id="publishing-action">
-<?php submit_button( __( 'Update' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?>
+<?php submit_button( __( 'Update' ), 'primary', 'save', false ); ?>
</div>
<div class="clear"></div>
</div>
@@ -82,23 +82,23 @@
<div id="namediv" class="stuffbox">
<h3><label for="link_name"><?php _ex('Name', 'link name') ?></label></h3>
<div class="inside">
- <input type="text" name="link_name" size="30" tabindex="1" value="<?php echo esc_attr($link->link_name); ?>" id="link_name" />
+ <input type="text" name="link_name" size="30" value="<?php echo esc_attr($link->link_name); ?>" id="link_name" />
<p><?php _e('Example: Nifty blogging software'); ?></p>
</div>
</div>
<div id="addressdiv" class="stuffbox">
<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
<div class="inside">
- <input type="text" name="link_url" size="30" class="code" tabindex="1" value="<?php echo esc_attr($link->link_url); ?>" id="link_url" />
+ <input type="text" name="link_url" size="30" class="code" value="<?php echo esc_attr($link->link_url); ?>" id="link_url" />
<p><?php _e('Example: <code>http://wordpress.org/</code> &#8212; don&#8217;t forget the <code>http://</code>'); ?></p>
</div>
</div>
<div id="descriptiondiv" class="stuffbox">
<h3><label for="link_description"><?php _e('Description') ?></label></h3>
<div class="inside">
- <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo isset($link->link_description) ? esc_attr($link->link_description) : ''; ?>" id="link_description" />
+ <input type="text" name="link_description" size="30" value="<?php echo isset($link->link_description) ? esc_attr($link->link_description) : ''; ?>" id="link_description" />
<p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
</div>
</div>
@@ -91,3 +91,6 @@
?>
</form>
</div>
+<script type="text/javascript">
+try{document.forms.edittag.name.focus();}catch(e){}
+</script>
View
@@ -408,7 +408,9 @@
</div><!-- /col-container -->
</div><!-- /wrap -->
-
+<script type="text/javascript">
+try{document.forms.addtag['tag-name'].focus();}catch(e){}
+</script>
<?php $wp_list_table->inline_edit(); ?>
<?php
@@ -754,7 +754,7 @@ function inline_edit() {
<?php if ( !$bulk ) : ?>
<label><span class="title"><?php _e( 'Date' ); ?></span></label>
<div class="inline-edit-date">
- <?php touch_time( 1, 1, 4, 1 ); ?>
+ <?php touch_time( 1, 1, 0, 1 ); ?>
</div>
<br class="clear" />
<?php endif; // $bulk
@@ -237,7 +237,7 @@ function single_row( $theme ) {
<?php foreach ( $actions as $action ): ?>
<li><?php echo $action; ?></li>
<?php endforeach; ?>
- <li class="hide-if-no-js"><a href="#" class="theme-detail" tabindex='4'><?php _e('Details') ?></a></li>
+ <li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e('Details') ?></a></li>
</ul>
</div>
@@ -171,7 +171,7 @@ function display_rows() {
<?php foreach ( $actions as $action ): ?>
<li><?php echo $action; ?></li>
<?php endforeach; ?>
- <li class="hide-if-no-js"><a href="#" class="theme-detail" tabindex='4'><?php _e('Details') ?></a></li>
+ <li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e('Details') ?></a></li>
</ul>
<?php echo $delete_action; ?>
@@ -505,7 +505,7 @@ function wp_dashboard_quick_press() {
<form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press">
<h4 id="quick-post-title"><label for="title"><?php _e('Title') ?></label></h4>
<div class="input-text-wrap">
- <input type="text" name="post_title" id="title" tabindex="1" autocomplete="off" value="<?php echo esc_attr( $post->post_title ); ?>" />
+ <input type="text" name="post_title" id="title" autocomplete="off" value="<?php echo esc_attr( $post->post_title ); ?>" />
</div>
<?php if ( current_user_can( 'upload_files' ) ) : ?>
@@ -516,25 +516,25 @@ function wp_dashboard_quick_press() {
<h4 id="content-label"><label for="content"><?php _e('Content') ?></label></h4>
<div class="textarea-wrap">
- <textarea name="content" id="content" class="mceEditor" rows="3" cols="15" tabindex="2"><?php echo esc_textarea( $post->post_content ); ?></textarea>
+ <textarea name="content" id="content" class="mceEditor" rows="3" cols="15"><?php echo esc_textarea( $post->post_content ); ?></textarea>
</div>
<script type="text/javascript">edCanvas = document.getElementById('content');edInsertContent = null;</script>
<h4><label for="tags-input"><?php _e('Tags') ?></label></h4>
<div class="input-text-wrap">
- <input type="text" name="tags_input" id="tags-input" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" />
+ <input type="text" name="tags_input" id="tags-input" value="<?php echo get_tags_to_edit( $post->ID ); ?>" />
</div>
<p class="submit">
<input type="hidden" name="action" id="quickpost-action" value="post-quickpress-save" />
<input type="hidden" name="post_ID" value="<?php echo $post_ID; ?>" />
<input type="hidden" name="post_type" value="post" />
<?php wp_nonce_field('add-post'); ?>
- <?php submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post', 'tabindex'=> 4 ) ); ?>
+ <?php submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post' ) ); ?>
<input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" />
<span id="publishing-action">
- <input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php current_user_can('publish_posts') ? esc_attr_e('Publish') : esc_attr_e('Submit for Review'); ?>" />
+ <input type="submit" name="publish" id="publish" accesskey="p" class="button-primary" value="<?php current_user_can('publish_posts') ? esc_attr_e('Publish') : esc_attr_e('Submit for Review'); ?>" />
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
</span>
<br class="clear" />
Oops, something went wrong.

0 comments on commit 3453509

Please sign in to comment.