Make WordPress Core

Changeset 20168


Ignore:
Timestamp:
03/10/2012 01:23:48 AM (13 years ago)
Author:
azaozz
Message:

Set proper HTML5 input types in the admin, props georgestephanis, fixes #17863

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin.dev.css

    r20166 r20168  
    211211input[type="text"],
    212212input[type="password"],
     213input[type="number"],
     214input[type="search"],
     215input[type="email"],
     216input[type="url"],
    213217textarea {
    214218    -moz-box-sizing: border-box;
     
    221225input[type="radio"] {
    222226    vertical-align: text-bottom;
     227}
     228
     229input[type="search"] {
     230    -webkit-appearance: textfield;
     231    text-align: left;
     232}
     233
     234input[type="search"]::-webkit-search-decoration {
     235    display: none;
    223236}
    224237
     
    790803
    791804input.small-text {
    792     width: 50px;
     805    width: 60px;
    793806}
    794807
  • trunk/wp-admin/edit-form-comment.php

    r20077 r20168  
    9393        }
    9494?></td>
    95     <td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" tabindex="2" id="email" /></td>
     95    <td><input type="email" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" tabindex="2" id="email" /></td>
    9696</tr>
    9797<tr valign="top">
  • trunk/wp-admin/includes/class-wp-list-table.php

    r20104 r20168  
    213213<p class="search-box">
    214214    <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
    215     <input type="text" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
     215    <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
    216216    <?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>
    217217</p>
     
    520520            $html_current_page = $current;
    521521        else
    522             $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
     522            $html_current_page = sprintf( "<input class='current-page' title='%s' type='number' step='1' min='1' name='paged' value='%s' size='%d' />",
    523523                esc_attr__( 'Current page' ),
    524                 esc_attr( 'paged' ),
    525524                $current,
    526525                strlen( $total_pages )
  • trunk/wp-admin/includes/dashboard.php

    r20038 r20168  
    464464    <form name="searchform" action="<?php echo network_admin_url('users.php'); ?>" method="get">
    465465        <p>
    466             <input type="text" name="s" value="" size="17" />
     466            <input type="search" name="s" value="" size="17" />
    467467            <?php submit_button( __( 'Search Users' ), 'button', 'submit', false, array( 'id' => 'submit_users' ) ); ?>
    468468        </p>
     
    471471    <form name="searchform" action="<?php echo network_admin_url('sites.php'); ?>" method="get">
    472472        <p>
    473             <input type="text" name="s" value="" size="17" />
     473            <input type="search" name="s" value="" size="17" />
    474474            <?php submit_button( __( 'Search Sites' ), 'button', 'submit', false, array( 'id' => 'submit_sites' ) ); ?>
    475475        </p>
  • trunk/wp-admin/includes/media.php

    r20114 r20168  
    18141814<p id="media-search" class="search-box">
    18151815    <label class="screen-reader-text" for="media-search-input"><?php _e('Search Media');?>:</label>
    1816     <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
     1816    <input type="search" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
    18171817    <?php submit_button( __( 'Search Media' ), 'button', '', false ); ?>
    18181818</p>
  • trunk/wp-admin/includes/ms.php

    r20029 r20168  
    375375    <tr>
    376376        <th><?php _e( 'Site Upload Space Quota '); ?></th>
    377         <td><input type="text" size="3" name="option[blog_upload_space]" value="<?php echo $quota; ?>" /> <?php _e( 'MB (Leave blank for network default)' ); ?></td>
     377        <td><input type="number" step="0.1" min="0" size="4" name="option[blog_upload_space]" value="<?php echo $quota; ?>" /> <?php _e( 'MB (Leave blank for network default)' ); ?></td>
    378378    </tr>
    379379    <?php
  • trunk/wp-admin/includes/nav-menu.php

    r19928 r20168  
    692692            ?>
    693693            <p class="quick-search-wrap">
    694                 <input type="text" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
     694                <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
    695695                <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
    696696                <?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
     
    923923            ?>
    924924            <p class="quick-search-wrap">
    925                 <input type="text" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
     925                <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
    926926                <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
    927927                <?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
  • trunk/wp-admin/includes/plugin-install.php

    r19710 r20168  
    128128            <option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option>
    129129        </select>
    130         <input type="text" name="s" value="<?php echo esc_attr($term) ?>" />
     130        <input type="search" name="s" value="<?php echo esc_attr($term) ?>" />
    131131        <label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label>
    132132        <?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?>
  • trunk/wp-admin/includes/screen.php

    r19987 r20168  
    984984        <div class='screen-options'>
    985985            <?php if ( !empty($per_page_label) ): ?>
    986                 <input type='text' class='screen-per-page' name='wp_screen_options[value]'
     986                <input type='number' step='1' min='1' class='screen-per-page' name='wp_screen_options[value]'
    987987                    id='<?php echo esc_attr( $option ); ?>' maxlength='3'
    988988                    value='<?php echo esc_attr( $per_page ); ?>' />
  • trunk/wp-admin/includes/template.php

    r20164 r20168  
    324324        <div class="inside">
    325325        <label for="author-email"><?php _e('E-mail') ?></label>
    326         <input type="text" name="newcomment_author_email" size="50" value="" tabindex="102" id="author-email" />
     326        <input type="email" name="newcomment_author_email" size="50" value="" tabindex="102" id="author-email" />
    327327        </div>
    328328
     
    599599    $month .= '</select>';
    600600
    601     $day = '<input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    602     $year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
    603     $hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    604     $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
     601    $day = '<input type="number" step="1" min="1" max="31" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
     602    $year = '<input type="number" step="1" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
     603    $hour = '<input type="number" step="1" min="0" max="23" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
     604    $minute = '<input type="number" step="1" min="0" max="59" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
    605605
    606606    echo '<div class="timestamp-wrap">';
  • trunk/wp-admin/includes/theme-install.php

    r20141 r20168  
    6363    <option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
    6464    </select>
    65     <input type="text" name="s" size="30" value="<?php echo esc_attr($term) ?>" />
     65    <input type="search" name="s" size="30" value="<?php echo esc_attr($term) ?>" />
    6666    <?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
    6767</form>
  • trunk/wp-admin/network/site-users.php

    r19897 r20168  
    301301        <tr>
    302302            <th scope="row"><?php _e( 'Email' ) ?></th>
    303             <td><input type="text" class="regular-text" name="user[email]" /></td>
     303            <td><input type="email" class="regular-text" name="user[email]" /></td>
    304304        </tr>
    305305        <tr>
  • trunk/wp-admin/options-discussion.php

    r19593 r20168  
    7272<label for="close_comments_for_old_posts">
    7373<input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked('1', get_option('close_comments_for_old_posts')); ?> />
    74 <?php printf( __('Automatically close comments on articles older than %s days'), '</label><input name="close_comments_days_old" type="text" id="close_comments_days_old" value="' . esc_attr(get_option('close_comments_days_old')) . '" class="small-text" />'); ?>
     74<?php printf( __('Automatically close comments on articles older than %s days'), '</label><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="' . esc_attr(get_option('close_comments_days_old')) . '" class="small-text" />'); ?>
    7575<br />
    7676<label for="thread_comments">
     
    101101$default_comments_page .= '>' . __('first') . '</option></select>';
    102102
    103 printf( __('Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="text" id="comments_per_page" value="' . esc_attr(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page );
     103printf( __('Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="number" step="1" min="1" id="comments_per_page" value="' . esc_attr(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page );
    104104
    105105?></label>
     
    143143<th scope="row"><?php _e('Comment Moderation'); ?></th>
    144144<td><fieldset><legend class="screen-reader-text"><span><?php _e('Comment Moderation'); ?></span></legend>
    145 <p><label for="comment_max_links"><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" value="' . esc_attr(get_option('comment_max_links')) . '" class="small-text" />' ); ?></label></p>
     145<p><label for="comment_max_links"><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="number" step="1" min="1" id="comment_max_links" value="' . esc_attr(get_option('comment_max_links')) . '" class="small-text" />' ); ?></label></p>
    146146
    147147<p><label for="moderation_keys"><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.'); ?></label></p>
  • trunk/wp-admin/options-general.php

    r19817 r20168  
    114114<tr valign="top">
    115115<th scope="row"><label for="admin_email"><?php _e('E-mail Address') ?> </label></th>
    116 <td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
     116<td><input name="admin_email" type="email" id="admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
    117117<span class="description"><?php _e('This address is used for admin purposes, like new user notification.') ?></span></td>
    118118</tr>
     
    133133<tr valign="top">
    134134<th scope="row"><label for="new_admin_email"><?php _e('E-mail Address') ?> </label></th>
    135 <td><input name="new_admin_email" type="text" id="new_admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
     135<td><input name="new_admin_email" type="email" id="new_admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
    136136<span class="description"><?php _e('This address is used for admin purposes. If you change this we will send you an e-mail at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></span>
    137137<?php
  • trunk/wp-admin/options-media.php

    r19507 r20168  
    6161<td>
    6262<label for="thumbnail_size_w"><?php _e('Width'); ?></label>
    63 <input name="thumbnail_size_w" type="text" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" class="small-text" />
     63<input name="thumbnail_size_w" type="number" step="1" min="1" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" class="small-text" />
    6464<label for="thumbnail_size_h"><?php _e('Height'); ?></label>
    65 <input name="thumbnail_size_h" type="text" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" class="small-text" /><br />
     65<input name="thumbnail_size_h" type="number" step="1" min="1" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" class="small-text" /><br />
    6666<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/>
    6767<label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
     
    7373<td><fieldset><legend class="screen-reader-text"><span><?php _e('Medium size'); ?></span></legend>
    7474<label for="medium_size_w"><?php _e('Max Width'); ?></label>
    75 <input name="medium_size_w" type="text" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" class="small-text" />
     75<input name="medium_size_w" type="number" step="1" min="1" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" class="small-text" />
    7676<label for="medium_size_h"><?php _e('Max Height'); ?></label>
    77 <input name="medium_size_h" type="text" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" class="small-text" />
     77<input name="medium_size_h" type="number" step="1" min="1" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" class="small-text" />
    7878</fieldset></td>
    7979</tr>
     
    8383<td><fieldset><legend class="screen-reader-text"><span><?php _e('Large size'); ?></span></legend>
    8484<label for="large_size_w"><?php _e('Max Width'); ?></label>
    85 <input name="large_size_w" type="text" id="large_size_w" value="<?php form_option('large_size_w'); ?>" class="small-text" />
     85<input name="large_size_w" type="number" step="1" min="1" id="large_size_w" value="<?php form_option('large_size_w'); ?>" class="small-text" />
    8686<label for="large_size_h"><?php _e('Max Height'); ?></label>
    87 <input name="large_size_h" type="text" id="large_size_h" value="<?php form_option('large_size_h'); ?>" class="small-text" />
     87<input name="large_size_h" type="number" step="1" min="1" id="large_size_h" value="<?php form_option('large_size_h'); ?>" class="small-text" />
    8888</fieldset></td>
    8989</tr>
     
    107107<td>
    108108<label for="embed_size_w"><?php _e('Width'); ?></label>
    109 <input name="embed_size_w" type="text" id="embed_size_w" value="<?php form_option('embed_size_w'); ?>" class="small-text" />
     109<input name="embed_size_w" type="number" step="1" min="1" id="embed_size_w" value="<?php form_option('embed_size_w'); ?>" class="small-text" />
    110110<label for="embed_size_h"><?php _e('Height'); ?></label>
    111 <input name="embed_size_h" type="text" id="embed_size_h" value="<?php form_option('embed_size_h'); ?>" class="small-text" />
     111<input name="embed_size_h" type="number" step="1" min="1" id="embed_size_h" value="<?php form_option('embed_size_h'); ?>" class="small-text" />
    112112<?php if ( !empty($content_width) ) echo '<br />' . __("If the width value is left blank, embeds will default to the max width of your theme."); ?>
    113113</td>
     
    129129<tr valign="top">
    130130<th scope="row"><label for="upload_url_path"><?php _e('Full URL path to files'); ?></label></th>
    131 <td><input name="upload_url_path" type="text" id="upload_url_path" value="<?php echo esc_attr( get_option('upload_url_path')); ?>" class="regular-text code" />
     131<td><input name="upload_url_path" type="url" id="upload_url_path" value="<?php echo esc_attr( get_option('upload_url_path')); ?>" class="regular-text code" />
    132132<span class="description"><?php _e('Configuring this is optional. By default, it should be blank.'); ?></span>
    133133</td>
  • trunk/wp-admin/options-reading.php

    r19596 r20168  
    106106<th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th>
    107107<td>
    108 <input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?>
     108<input name="posts_per_page" type="number" step="1" min="1" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?>
    109109</td>
    110110</tr>
    111111<tr valign="top">
    112112<th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th>
    113 <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td>
     113<td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td>
    114114</tr>
    115115<tr valign="top">
  • trunk/wp-admin/themes.php

    r20151 r20168  
    159159<p class="search-box">
    160160    <label class="screen-reader-text" for="theme-search-input"><?php _e('Search Installed Themes'); ?>:</label>
    161     <input type="text" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" />
     161    <input type="search" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" />
    162162    <?php submit_button( __( 'Search Installed Themes' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
    163163    <a id="filter-click" href="?filter=1"><?php _e( 'Feature Filter' ); ?></a>
  • trunk/wp-admin/user-edit.php

    r19712 r20168  
    334334<tr>
    335335    <th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
    336     <td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text" />
     336    <td><input type="email" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text" />
    337337    <?php
    338338    $new_email = get_option( $current_user->ID . '_new_email' );
  • trunk/wp-includes/class-wp-editor.php

    r20166 r20168  
    785785                <label>
    786786                    <span><?php _e( 'Search' ); ?></span>
    787                     <input type="text" id="search-field" class="link-search-field" tabindex="60" autocomplete="off" />
     787                    <input type="search" id="search-field" class="link-search-field" tabindex="60" autocomplete="off" />
    788788                    <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
    789789                </label>
Note: See TracChangeset for help on using the changeset viewer.