Ticket #41612: 41612.2.diff
File 41612.2.diff, 14.9 KB (added by , 6 years ago) |
---|
-
src/js/media/views/attachment/details.js
42 42 rerenderOnModelChange: false 43 43 }); 44 44 45 this.on( 'ready', this.initialFocus );46 45 // Call 'initialize' directly on the parent class. 47 46 Attachment.prototype.initialize.apply( this, arguments ); 48 47 }, 49 48 50 initialFocus: function() {51 if ( ! wp.media.isTouchDevice ) {52 /*53 Previously focused the first ':input' (the readonly URL text field).54 Since the first ':input' is now a button (delete/trash): when pressing55 spacebar on an attachment, Firefox fires deleteAttachment/trashAttachment56 as soon as focus is moved. Explicitly target the first text field for now.57 @todo change initial focus logic, also for accessibility.58 */59 this.$( 'input[type="text"]' ).eq( 0 ).focus();60 }61 },62 49 /** 63 50 * @param {Object} event 64 51 */ -
src/wp-includes/css/media-views.css
431 431 .attachment-details .setting input[type="tel"], 432 432 .attachment-details .setting input[type="url"], 433 433 .attachment-details .setting textarea, 434 .attachment-details .setting .value { 434 .attachment-details .setting .value, 435 .attachment-details .setting + .description { 435 436 box-sizing: border-box; 436 437 margin: 1px; 437 438 width: 65%; … … 439 440 } 440 441 441 442 .media-sidebar .setting .value, 442 .attachment-details .setting .value { 443 .attachment-details .setting .value, 444 .attachment-details .setting + .description { 443 445 margin: 0 1px; 444 446 text-align: left; 445 447 } 446 448 449 .attachment-details .setting + .description { 450 font-size: 12px; 451 font-style: normal; 452 margin-bottom: 0.5em; 453 } 454 447 455 .media-sidebar .setting textarea, 448 456 .attachment-details .setting textarea, 449 457 .compat-item .field textarea { … … 2040 2048 clear: both; 2041 2049 } 2042 2050 2051 .media-embed .setting.has-description { 2052 margin-bottom: 0; 2053 } 2054 2043 2055 .image-details .embed-media-settings .setting { 2044 2056 float: none; 2045 2057 width: auto; … … 2069 2081 2070 2082 .image-details .embed-media-settings .setting input.link-to-custom, 2071 2083 .image-details .embed-media-settings .link-target, 2072 .image-details .embed-media-settings .custom-size { 2084 .image-details .embed-media-settings .custom-size, 2085 .image-details .description { 2073 2086 margin-left: 27%; 2074 2087 width: 70%; 2075 2088 } 2076 2089 2090 .image-details .description { 2091 font-style: normal; 2092 margin-top: 0; 2093 } 2094 2077 2095 .image-details .embed-media-settings .link-target { 2078 2096 margin-top: 24px; 2079 2097 } -
src/wp-includes/media-template.php
404 404 </div> 405 405 406 406 <div class="settings"> 407 <label class="setting" data-setting="url">408 <span class="name"><?php _e( 'URL' ); ?></span>409 <input type="text" value="{{ data.url }}" readonly />410 </label>411 407 <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 408 <# if ( 'image' === data.type ) { #> 409 <label class="setting" data-setting="alt"> 410 <span class="name"><?php _e( 'Alternative Text' ); ?></span> 411 <input type="text" value="{{ data.alt }}" aria-describedby="alt-text-description" {{ maybeReadOnly }} /> 412 </label> 413 <p class="description" id="alt-text-description"><?php _e( 'Functional replacement for the image. Leave empty if the image is not a key part of the content.' ); ?></p> 414 <# } #> 412 415 <?php if ( post_type_supports( 'attachment', 'title' ) ) : ?> 413 416 <label class="setting" data-setting="title"> 414 417 <span class="name"><?php _e( 'Title' ); ?></span> … … 432 435 <span class="name"><?php _e( 'Caption' ); ?></span> 433 436 <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 434 437 </label> 435 <# if ( 'image' === data.type ) { #>436 <label class="setting" data-setting="alt">437 <span class="name"><?php _e( 'Alt Text' ); ?></span>438 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} />439 </label>440 <# } #>441 438 <label class="setting" data-setting="description"> 442 439 <span class="name"><?php _e( 'Description' ); ?></span> 443 440 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> … … 456 453 <# } #> 457 454 </div> 458 455 <# } #> 456 <label class="setting" data-setting="url"> 457 <span class="name"><?php _e( 'Copy Link' ); ?></span> 458 <input type="text" value="{{ data.url }}" readonly /> 459 </label> 459 460 <div class="attachment-compat"></div> 460 461 </div> 461 462 … … 595 596 </div> 596 597 </div> 597 598 598 <label class="setting" data-setting="url">599 <span class="name"><?php _e( 'URL' ); ?></span>600 <input type="text" value="{{ data.url }}" readonly />601 </label>602 599 <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 600 <# if ( 'image' === data.type ) { #> 601 <label class="setting" data-setting="alt"> 602 <span class="name"><?php _e( 'Alt Text' ); ?></span> 603 <input type="text" value="{{ data.alt }}" aria-describedby="alt-text-description" {{ maybeReadOnly }} /> 604 </label> 605 <p class="description" id="alt-text-description"><?php _e( 'Functional replacement for the image. Leave empty if the image is not a key part of the content.' ); ?></p> 606 <# } #> 603 607 <?php if ( post_type_supports( 'attachment', 'title' ) ) : ?> 604 608 <label class="setting" data-setting="title"> 605 609 <span class="name"><?php _e( 'Title' ); ?></span> … … 623 627 <span class="name"><?php _e( 'Caption' ); ?></span> 624 628 <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 625 629 </label> 626 <# if ( 'image' === data.type ) { #>627 <label class="setting" data-setting="alt">628 <span class="name"><?php _e( 'Alt Text' ); ?></span>629 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} />630 </label>631 <# } #>632 630 <label class="setting" data-setting="description"> 633 631 <span class="name"><?php _e( 'Description' ); ?></span> 634 632 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 635 633 </label> 634 <label class="setting" data-setting="url"> 635 <span class="name"><?php _e( 'Copy Link' ); ?></span> 636 <input type="text" value="{{ data.url }}" readonly /> 637 </label> 636 638 </script> 637 639 638 640 <script type="text/html" id="tmpl-media-selection"> … … 948 950 </div> 949 951 </div> 950 952 <div class="column-settings"> 953 <label class="setting alt-text has-description"> 954 <span><?php _e( 'Alternative Text' ); ?></span> 955 <input type="text" data-setting="alt" value="{{ data.model.alt }}" aria-describedby="alt-text-description" /> 956 </label> 957 <p class="description" id="alt-text-description"><?php _e( 'Functional replacement for the image. Leave empty if the image is not a key part of the content.' ); ?></p> 958 951 959 <?php 952 960 /** This filter is documented in wp-admin/includes/media.php */ 953 961 if ( ! apply_filters( 'disable_captions', '' ) ) : … … 958 966 </label> 959 967 <?php endif; ?> 960 968 961 <label class="setting alt-text">962 <span><?php _e( 'Alternative Text' ); ?></span>963 <input type="text" data-setting="alt" value="{{ data.model.alt }}" />964 </label>965 966 969 <h2><?php _e( 'Display Settings' ); ?></h2> 967 970 <div class="setting align"> 968 971 <span><?php _e( 'Align' ); ?></span> -
tests/qunit/index.html
1118 1118 <div class="file-size"><strong>File size:</strong> {{ data.filesizeHumanReadable }}</div> 1119 1119 <# if ( 'image' === data.type && ! data.uploading ) { #> 1120 1120 <# if ( data.width && data.height ) { #> 1121 <div class="dimensions"><strong>Dimensions:</strong> {{ data.width }} × {{ data.height }}</div> 1121 <div class="dimensions"><strong>Dimensions:</strong> 1122 {{ data.width }} by {{ data.height }} pixels </div> 1122 1123 <# } #> 1123 1124 <# } #> 1124 1125 1125 <# if ( data.fileLength ) { #> 1126 <div class="file-length"><strong>Length:</strong> {{ data.fileLength }}</div> 1126 <# if ( data.fileLength && data.fileLengthHumanReadable ) { #> 1127 <div class="file-length"><strong>Length:</strong> 1128 <span aria-hidden="true">{{ data.fileLength }}</span> 1129 <span class="screen-reader-text">{{ data.fileLengthHumanReadable }}</span> 1130 </div> 1127 1131 <# } #> 1128 1132 1129 1133 <# if ( 'audio' === data.type && data.meta.bitrate ) { #> … … 1143 1147 </div> 1144 1148 1145 1149 <div class="settings"> 1146 <label class="setting" data-setting="url">1147 <span class="name">URL</span>1148 <input type="text" value="{{ data.url }}" readonly />1149 </label>1150 1150 <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 1151 <# if ( 'image' === data.type ) { #> 1152 <label class="setting" data-setting="alt"> 1153 <span class="name">Alternative Text</span> 1154 <input type="text" value="{{ data.alt }}" aria-describedby="alt-text-description" {{ maybeReadOnly }} /> 1155 </label> 1156 <p class="description" id="alt-text-description">Functional replacement for the image. Leave empty if the image is not a key part of the content.</p> 1157 <# } #> 1151 1158 <label class="setting" data-setting="title"> 1152 1159 <span class="name">Title</span> 1153 1160 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> … … 1166 1173 <span class="name">Caption</span> 1167 1174 <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 1168 1175 </label> 1169 <# if ( 'image' === data.type ) { #>1170 <label class="setting" data-setting="alt">1171 <span class="name">Alt Text</span>1172 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} />1173 </label>1174 <# } #>1175 1176 <label class="setting" data-setting="description"> 1176 1177 <span class="name">Description</span> 1177 1178 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 1178 1179 </label> 1179 < labelclass="setting">1180 <div class="setting"> 1180 1181 <span class="name">Uploaded By</span> 1181 1182 <span class="value">{{ data.authorName }}</span> 1182 </ label>1183 </div> 1183 1184 <# if ( data.uploadedToTitle ) { #> 1184 < labelclass="setting">1185 <div class="setting"> 1185 1186 <span class="name">Uploaded To</span> 1186 1187 <# if ( data.uploadedToLink ) { #> 1187 1188 <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span> … … 1188 1189 <# } else { #> 1189 1190 <span class="value">{{ data.uploadedToTitle }}</span> 1190 1191 <# } #> 1191 </ label>1192 </div> 1192 1193 <# } #> 1194 <label class="setting" data-setting="url"> 1195 <span class="name">Copy Link</span> 1196 <input type="text" value="{{ data.url }}" readonly /> 1197 </label> 1193 1198 <div class="attachment-compat"></div> 1194 1199 </div> 1195 1200 … … 1196 1201 <div class="actions"> 1197 1202 <a class="view-attachment" href="{{ data.link }}">View attachment page</a> 1198 1203 <# if ( data.can.save ) { #> | 1199 <a href=" post.php?post={{ data.id }}&action=edit">Edit more details</a>1204 <a href="{{ data.editLink }}">Edit more details</a> 1200 1205 <# } #> 1201 1206 <# if ( ! data.uploading && data.can.remove ) { #> | 1202 1207 <button type="button" class="button-link delete-attachment">Delete Permanently</button> … … 1280 1285 <div class="file-size">{{ data.filesizeHumanReadable }}</div> 1281 1286 <# if ( 'image' === data.type && ! data.uploading ) { #> 1282 1287 <# if ( data.width && data.height ) { #> 1283 <div class="dimensions">{{ data.width }} × {{ data.height }}</div> 1288 <div class="dimensions"> 1289 {{ data.width }} by {{ data.height }} pixels </div> 1284 1290 <# } #> 1285 1291 1286 1292 <# if ( data.can.save && data.sizes ) { #> … … 1288 1294 <# } #> 1289 1295 <# } #> 1290 1296 1291 <# if ( data.fileLength ) { #> 1292 <div class="file-length">Length: {{ data.fileLength }}</div> 1297 <# if ( data.fileLength && data.fileLengthHumanReadable ) { #> 1298 <div class="file-length">Length: <span aria-hidden="true">{{ data.fileLength }}</span> 1299 <span class="screen-reader-text">{{ data.fileLengthHumanReadable }}</span> 1300 </div> 1293 1301 <# } #> 1294 1302 1295 1303 <# if ( ! data.uploading && data.can.remove ) { #> … … 1304 1312 </div> 1305 1313 </div> 1306 1314 1307 <label class="setting" data-setting="url">1308 <span class="name">URL</span>1309 <input type="text" value="{{ data.url }}" readonly />1310 </label>1311 1315 <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 1316 <# if ( 'image' === data.type ) { #> 1317 <label class="setting" data-setting="alt"> 1318 <span class="name">Alt Text</span> 1319 <input type="text" value="{{ data.alt }}" aria-describedby="alt-text-description" {{ maybeReadOnly }} /> 1320 </label> 1321 <p class="description" id="alt-text-description">Functional replacement for the image. Leave empty if the image is not a key part of the content.</p> 1322 <# } #> 1312 1323 <label class="setting" data-setting="title"> 1313 1324 <span class="name">Title</span> 1314 1325 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> … … 1327 1338 <span class="name">Caption</span> 1328 1339 <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 1329 1340 </label> 1330 <# if ( 'image' === data.type ) { #>1331 <label class="setting" data-setting="alt">1332 <span class="name">Alt Text</span>1333 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} />1334 </label>1335 <# } #>1336 1341 <label class="setting" data-setting="description"> 1337 1342 <span class="name">Description</span> 1338 1343 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 1339 1344 </label> 1345 <label class="setting" data-setting="url"> 1346 <span class="name">Copy Link</span> 1347 <input type="text" value="{{ data.url }}" readonly /> 1348 </label> 1340 1349 </script> 1341 1350 1342 1351 <script type="text/html" id="tmpl-media-selection"> … … 1651 1660 </div> 1652 1661 </div> 1653 1662 <div class="column-settings"> 1663 <label class="setting alt-text has-description"> 1664 <span>Alternative Text</span> 1665 <input type="text" data-setting="alt" value="{{ data.model.alt }}" aria-describedby="alt-text-description" /> 1666 </label> 1667 <p class="description" id="alt-text-description">Functional replacement for the image. Leave empty if the image is not a key part of the content.</p> 1668 1654 1669 <label class="setting caption"> 1655 1670 <span>Caption</span> 1656 1671 <textarea data-setting="caption">{{ data.model.caption }}</textarea> 1657 1672 </label> 1658 1673 1659 <label class="setting alt-text">1660 <span>Alternative Text</span>1661 <input type="text" data-setting="alt" value="{{ data.model.alt }}" />1662 </label>1663 1664 1674 <h2>Display Settings</h2> 1665 1675 <div class="setting align"> 1666 1676 <span>Align</span> … … 1761 1771 </div> 1762 1772 <label class="setting link-rel"> 1763 1773 <span>Link Rel</span> 1764 <input type="text" data-setting="linkRel" value="{{ data.model.link ClassName}}" />1774 <input type="text" data-setting="linkRel" value="{{ data.model.linkRel }}" /> 1765 1775 </label> 1766 1776 <label class="setting link-class-name"> 1767 1777 <span>Link CSS Class</span>