Ticket #33704: 33704-focus.diff
File 33704-focus.diff, 5.4 KB (added by , 8 years ago) |
---|
-
src/wp-admin/edit-form-advanced.php
553 553 $title_placeholder = apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); 554 554 ?> 555 555 <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label> 556 <input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />556 <input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off"<?php if ( '' === $post->post_title ) { ?> class="wp-initial-focus"<?php } ?> /> 557 557 </div> 558 558 <?php 559 559 /** … … 738 738 <?php 739 739 if ( post_type_supports( $post_type, 'comments' ) ) 740 740 wp_comment_reply(); 741 ?>742 743 <?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>744 <script type="text/javascript">745 try{document.post.title.focus();}catch(e){}746 </script>747 <?php endif; ?> -
src/wp-admin/edit-form-comment.php
41 41 <tbody> 42 42 <tr> 43 43 <td class="first"><label for="name"><?php _e( 'Name:' ); ?></label></td> 44 <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td>44 <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" class="wp-initial-focus" /></td> 45 45 </tr> 46 46 <tr> 47 47 <td class="first"><label for="email"><?php _e( 'Email:' ); ?></label></td> … … 200 200 </div><!-- /post-body --> 201 201 </div> 202 202 </div> 203 </form> 204 205 <?php if ( ! wp_is_mobile() ) : ?> 206 <script type="text/javascript"> 207 try{document.post.name.focus();}catch(e){} 208 </script> 209 <?php endif; 203 </form> 204 No newline at end of file -
src/wp-admin/edit-tag-form.php
125 125 <table class="form-table"> 126 126 <tr class="form-field form-required term-name-wrap"> 127 127 <th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th> 128 <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" />128 <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" class="wp-initial-focus" /> 129 129 <p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td> 130 130 </tr> 131 131 <?php if ( !global_terms_enabled() ) { ?> … … 263 263 submit_button( __('Update') ); 264 264 ?> 265 265 </form> 266 </div> 267 268 <?php if ( ! wp_is_mobile() ) : ?> 269 <script type="text/javascript"> 270 try{document.forms.edittag.name.focus();}catch(e){} 271 </script> 272 <?php endif; 266 </div> 267 No newline at end of file -
src/wp-admin/edit-tags.php
411 411 412 412 <div class="form-field form-required term-name-wrap"> 413 413 <label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label> 414 <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />414 <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" class="wp-initial-focus" /> 415 415 <p><?php _e('The name is how it appears on your site.'); ?></p> 416 416 </div> 417 417 <?php if ( ! global_terms_enabled() ) : ?> … … 615 615 </div><!-- /col-container --> 616 616 </div><!-- /wrap --> 617 617 618 <?php if ( ! wp_is_mobile() ) : ?>619 <script type="text/javascript">620 try{document.forms.addtag['tag-name'].focus();}catch(e){}621 </script>622 618 <?php 623 endif;624 619 625 620 $wp_list_table->inline_edit(); 626 621 -
src/wp-admin/install.php
390 390 } 391 391 break; 392 392 } 393 394 if ( ! wp_is_mobile() ) { 395 ?> 396 <script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script> 397 <?php 393 ?> 394 <script type="text/javascript"> 395 var width = Math.max( document.documentElement.clientWidth, window.innerWidth || 0 ); 396 if ( width > 782 ) { 397 var t = document.getElementById( 'weblog_title' ); 398 if ( t ) { 399 t.focus(); 400 } 398 401 } 399 402 </script> 403 <?php 400 404 wp_print_scripts( $scripts_to_print ); 401 405 ?> 402 406 <script type="text/javascript"> -
src/wp-admin/js/common.js
913 913 $document.on( 'wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu', setPinMenu ); 914 914 915 915 // Set initial focus on a specific element. 916 $( '.wp-initial-focus' ).focus(); 916 if ( ! wpResponsiveActive ) { 917 $( '.wp-initial-focus' ).focus(); 918 } 917 919 }); 918 920 919 921 // Fire a custom jQuery event at the end of window resize