mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-15 22:30:25 +00:00
Accessibility: Media: Add a "Copy URL" button to the attachment File URL fields.
For a number of years, various screens in the WordPress admin provided users with a readonly input field to copy the attachment file URL. Manually copying from a readonly field is an annoying task at best even for mouser users. It's a usability and accessibility issue at the same time. These fields now have a new "Copy URL" button that is easy to use and accessible to everyone. Props theolg, markdubois, vabrashev, sajjad67, xkon, nrqsnchz, melchoyce, audrasjb, afercia. See #41612, #50322, #50335. Fixes #48463. git-svn-id: https://develop.svn.wordpress.org/trunk@48232 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -797,6 +797,16 @@ border color while dragging a file over the uploader drop area */
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.copy-to-clipboard-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 8px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.copy-to-clipboard-container .success {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
14.2 - Image Editor
|
||||
@@ -1215,6 +1225,10 @@ audio, video {
|
||||
width: auto;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.copy-to-clipboard-container .success {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3268,6 +3268,10 @@ function attachment_submitbox_metadata() {
|
||||
<div class="misc-pub-section misc-pub-attachment">
|
||||
<label for="attachment_url"><?php _e( 'File URL:' ); ?></label>
|
||||
<input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" />
|
||||
<span class="copy-to-clipboard-container">
|
||||
<button type="button" class="button copy-attachment-url edit-media" data-clipboard-target="#attachment_url"><?php _e( 'Copy URL' ); ?></button>
|
||||
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="misc-pub-section misc-pub-filename">
|
||||
<?php _e( 'File name:' ); ?> <strong><?php echo $filename; ?></strong>
|
||||
|
||||
Reference in New Issue
Block a user