Skip to content

Commit 0742a0f

Browse files
committed
Media: Follow the "proximity of controls" accessibility guidelines in the multi-file uploader.
This changeset updates the design of the Upload Media screen to stack progress bars below the file name. After the upload completes, Action buttons also stack below the file name. Props afercia, rcreators. Fixes #60141. Built from https://develop.svn.wordpress.org/trunk@58279 git-svn-id: https://core.svn.wordpress.org/trunk@57739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 58d2652 commit 0742a0f

8 files changed

Lines changed: 51 additions & 45 deletions

File tree

wp-admin/async-upload.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@
6565
<div class="filename new">
6666
<span class="media-list-title"><strong><?php echo esc_html( wp_html_excerpt( $title, 60, '&hellip;' ) ); ?></strong></span>
6767
<span class="media-list-subtitle"><?php echo esc_html( wp_basename( $file ) ); ?></span>
68+
<div class="attachment-tools">
69+
<?php
70+
if ( current_user_can( 'edit_post', $id ) ) {
71+
echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '">' . _x( 'Edit', 'media item' ) . '</a>';
72+
} else {
73+
echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>';
74+
}
75+
?>
76+
<span class="media-item-copy-container copy-to-clipboard-container edit-attachment">
77+
<button type="button" class="button button-small copy-attachment-url" data-clipboard-text="<?php echo $file_url; ?>"><?php _e( 'Copy URL to clipboard' ); ?></button>
78+
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
79+
</span>
80+
</div>
6881
</div>
6982
</div>
70-
<div class="attachment-tools">
71-
<span class="media-item-copy-container copy-to-clipboard-container edit-attachment">
72-
<button type="button" class="button button-small copy-attachment-url" data-clipboard-text="<?php echo esc_url( $file_url ); ?>"><?php _e( 'Copy URL to clipboard' ); ?></button>
73-
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
74-
</span>
75-
<?php
76-
if ( current_user_can( 'edit_post', $id ) ) {
77-
echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '">' . _x( 'Edit', 'media item' ) . '</a>';
78-
} else {
79-
echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>';
80-
}
81-
?>
82-
</div>
8383
</div>
8484
<?php
8585
break;

wp-admin/css/media-rtl.css

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,8 @@
113113
margin-left: 10px;
114114
}
115115

116-
.media-item-wrapper {
117-
display: grid;
118-
grid-template-columns: 1fr 1fr;
119-
}
120-
121116
.media-item .attachment-tools {
122117
display: flex;
123-
justify-content: flex-end;
124118
align-items: center;
125119
}
126120

@@ -191,15 +185,10 @@
191185
display: none;
192186
}
193187

194-
.media-item .original {
195-
position: relative;
196-
min-height: 34px;
197-
}
198-
199188
.media-item .progress {
200-
float: left;
189+
display: inline-block;
201190
height: 22px;
202-
margin: 7px 6px;
191+
margin: 0 6px 7px;
203192
width: 200px;
204193
line-height: 2em;
205194
padding: 0;
@@ -1437,3 +1426,17 @@ audio, video {
14371426
max-width: 100%;
14381427
}
14391428
}
1429+
1430+
@media only screen and (max-width: 375px) {
1431+
.media-item .attachment-tools {
1432+
align-items: baseline;
1433+
}
1434+
.media-item .edit-attachment.copy-to-clipboard-container {
1435+
flex-direction: column;
1436+
}
1437+
1438+
.copy-to-clipboard-container .success {
1439+
line-height: normal;
1440+
margin-top: 10px;
1441+
}
1442+
}

wp-admin/css/media-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/media.css

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,8 @@
112112
margin-right: 10px;
113113
}
114114

115-
.media-item-wrapper {
116-
display: grid;
117-
grid-template-columns: 1fr 1fr;
118-
}
119-
120115
.media-item .attachment-tools {
121116
display: flex;
122-
justify-content: flex-end;
123117
align-items: center;
124118
}
125119

@@ -190,15 +184,10 @@
190184
display: none;
191185
}
192186

193-
.media-item .original {
194-
position: relative;
195-
min-height: 34px;
196-
}
197-
198187
.media-item .progress {
199-
float: right;
188+
display: inline-block;
200189
height: 22px;
201-
margin: 7px 6px;
190+
margin: 0 6px 7px;
202191
width: 200px;
203192
line-height: 2em;
204193
padding: 0;
@@ -1436,3 +1425,17 @@ audio, video {
14361425
max-width: 100%;
14371426
}
14381427
}
1428+
1429+
@media only screen and (max-width: 375px) {
1430+
.media-item .attachment-tools {
1431+
align-items: baseline;
1432+
}
1433+
.media-item .edit-attachment.copy-to-clipboard-container {
1434+
flex-direction: column;
1435+
}
1436+
1437+
.copy-to-clipboard-container .success {
1438+
line-height: normal;
1439+
margin-top: 10px;
1440+
}
1441+
}

wp-admin/css/media.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-includes/js/plupload/handlers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function fileQueued( fileObj ) {
1616
jQuery( '<div class="media-item">' )
1717
.attr( 'id', 'media-item-' + fileObj.id )
1818
.addClass( 'child-of-' + postid )
19-
.append( '<div class="progress"><div class="percent">0%</div><div class="bar"></div></div>',
20-
jQuery( '<div class="filename original">' ).text( ' ' + fileObj.name ) )
19+
.append( jQuery( '<div class="filename original">' ).text( ' ' + fileObj.name ),
20+
'<div class="progress"><div class="percent">0%</div><div class="bar"></div></div>' )
2121
.appendTo( jQuery( '#media-items' ) );
2222

2323
// Disable submit.

wp-includes/js/plupload/handlers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.6-alpha-58278';
19+
$wp_version = '6.6-alpha-58279';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)