After [32796], improve the accessibility and markup for instances of `touch_time()`.

Props rianrietveld, afercia.
Fixes #31714.

Built from https://develop.svn.wordpress.org/trunk@32945


git-svn-id: http://core.svn.wordpress.org/trunk@32916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-06-25 19:30:25 +00:00
parent 7142248743
commit 587c570efa
9 changed files with 60 additions and 20 deletions

View File

@ -317,8 +317,8 @@ table.media .column-title .row-actions {
margin-right: 70px; /* 60px image + margin */
}
table.media .column-title .media-info p {
margin-bottom: 0.2em;
table.media .column-title .media-info p {
margin-bottom: 0.2em;
}
/* @todo: pick a consistent list table selector */
@ -877,6 +877,13 @@ tr.inline-edit-row td,
line-height: 2.5;
}
.inline-edit-row fieldset.inline-edit-date label {
display: inline-block;
margin: 0;
line-height: 1.5;
vertical-align: baseline;
}
.inline-edit-row fieldset label.inline-edit-tags {
margin-top: 0;
}
@ -886,13 +893,23 @@ tr.inline-edit-row td,
width: auto;
}
.inline-edit-row fieldset label span.title {
.inline-edit-row fieldset label span.title,
.inline-edit-row fieldset.inline-edit-date legend {
display: block;
float: right;
width: 5em;
line-height: 2.5;
}
#posts-filter fieldset.inline-edit-date legend {
padding: 0;
}
.inline-edit-row fieldset.inline-edit-date select {
margin: 1px;
line-height: 28px;
}
.inline-edit-row fieldset label span.input-text-wrap {
display: block;
margin-right: 5em;

View File

@ -317,8 +317,8 @@ table.media .column-title .row-actions {
margin-left: 70px; /* 60px image + margin */
}
table.media .column-title .media-info p {
margin-bottom: 0.2em;
table.media .column-title .media-info p {
margin-bottom: 0.2em;
}
/* @todo: pick a consistent list table selector */
@ -877,6 +877,13 @@ tr.inline-edit-row td,
line-height: 2.5;
}
.inline-edit-row fieldset.inline-edit-date label {
display: inline-block;
margin: 0;
line-height: 1.5;
vertical-align: baseline;
}
.inline-edit-row fieldset label.inline-edit-tags {
margin-top: 0;
}
@ -886,13 +893,23 @@ tr.inline-edit-row td,
width: auto;
}
.inline-edit-row fieldset label span.title {
.inline-edit-row fieldset label span.title,
.inline-edit-row fieldset.inline-edit-date legend {
display: block;
float: left;
width: 5em;
line-height: 2.5;
}
#posts-filter fieldset.inline-edit-date legend {
padding: 0;
}
.inline-edit-row fieldset.inline-edit-date select {
margin: 1px;
line-height: 28px;
}
.inline-edit-row fieldset label span.input-text-wrap {
display: block;
margin-left: 5em;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -92,7 +92,10 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
?>
<span id="timestamp"><?php printf( $stamp, $date ); ?></span>
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
<fieldset id='timestampdiv' class='hide-if-js'>
<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
<?php touch_time( ( 'editcomment' === $action ), 0 ); ?>
</fieldset>
</div>
<?php

View File

@ -1211,10 +1211,10 @@ class WP_Posts_List_Table extends WP_List_Table {
endif; // post_type_supports title ?>
<?php if ( !$bulk ) : ?>
<label><span class="title"><?php _e( 'Date' ); ?></span></label>
<div class="inline-edit-date">
<fieldset class="inline-edit-date">
<legend><span class="title"><?php _e( 'Date' ); ?></span></legend>
<?php touch_time( 1, 1, 0, 1 ); ?>
</div>
</fieldset>
<br class="clear" />
<?php endif; // $bulk

View File

@ -206,7 +206,10 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
<span id="timestamp">
<?php printf($stamp, $date); ?></span>
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div>
<fieldset id="timestampdiv" class="hide-if-js">
<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
<?php touch_time( ( $action === 'edit' ), 1 ); ?>
</fieldset>
</div><?php // /misc-pub-section ?>
<?php endif; ?>

View File

@ -781,19 +781,19 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$cur_hh = gmdate( 'H', $time_adj );
$cur_mn = gmdate( 'i', $time_adj );
$month = '<label for="mm" class="screen-reader-text">' . __( 'Month' ) . '</label><select ' . ( $multi ? '' : 'id="mm" ' ) . 'name="mm"' . $tab_index_attribute . ">\n";
$month = '<label><span class="screen-reader-text">' . __( 'Month' ) . '</span><select ' . ( $multi ? '' : 'id="mm" ' ) . 'name="mm"' . $tab_index_attribute . ">\n";
for ( $i = 1; $i < 13; $i = $i +1 ) {
$monthnum = zeroise($i, 2);
$month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected( $monthnum, $mm, false ) . '>';
/* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
$month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) ) . "</option>\n";
}
$month .= '</select>';
$month .= '</select></label>';
$day = '<label for="jj" class="screen-reader-text">' . __( 'Day' ) . '</label><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
$year = '<label for="aa" class="screen-reader-text">' . __( 'Year' ) . '</label><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
$hour = '<label for="hh" class="screen-reader-text">' . __( 'Hour' ) . '</label><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
$minute = '<label for="mn" class="screen-reader-text">' . __( 'Minute' ) . '</label><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
$day = '<label><span class="screen-reader-text">' . __( 'Day' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
$year = '<label><span class="screen-reader-text">' . __( 'Year' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" /></label>';
$hour = '<label><span class="screen-reader-text">' . __( 'Hour' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
$minute = '<label><span class="screen-reader-text">' . __( 'Minute' ) . '</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" /></label>';
echo '<div class="timestamp-wrap">';
/* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32944';
$wp_version = '4.3-alpha-32945';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.