Ticket #28844: 28844.8.diff
File 28844.8.diff, 10.7 KB (added by , 10 years ago) |
---|
-
src/wp-includes/css/media-views.css
279 279 } 280 280 281 281 .media-sidebar h3, 282 .image-details h3, 283 .attachment-info h3 { 282 .image-details h3 { 284 283 position: relative; 285 284 font-weight: bold; 286 285 text-transform: uppercase; … … 1462 1461 z-index: 10; 1463 1462 } 1464 1463 1465 .attachment-details .settings-save-status .spinner, 1466 .attachment-details .settings-save-status .saved { 1467 margin: 0 5px -20px; 1464 .attachment-details .settings-save-status .spinner { 1465 margin: 0 5px 0; 1468 1466 } 1469 1467 1470 1468 .attachment-details .settings-save-status .saved { … … 1487 1485 padding-bottom: 11px; 1488 1486 } 1489 1487 1490 .attachment-info .details {1491 clear: right;1492 }1493 1494 .attachment-info h3:first-child {1495 margin-top: 0;1496 }1497 1498 .attachment-info .details .setting .name {1499 float: left;1500 margin: 8px 1% 0 1% !important;1501 padding: 0;1502 line-height: 1.1;1503 }1504 1505 .attachment-info .details .url.setting .name {1506 padding-top: 3px;1507 }1508 1509 .attachment-info .setting .value {1510 font-style: italic;1511 }1512 1513 1488 .attachment-info .filename { 1514 1489 font-weight: bold; 1515 1490 color: #464646; … … 1572 1547 max-width: 100%; 1573 1548 } 1574 1549 1575 .attachment-info .advanced-toggle {1576 color: #666;1577 text-decoration: none;1578 display: block;1579 }1580 .attachment-info .advanced-toggle:hover {1581 color: #d54e21;1582 }1583 1584 .attachment-info .advanced-toggle:after {1585 font: normal 20px/1 'dashicons';1586 speak: none;1587 vertical-align: top;1588 -webkit-font-smoothing: antialiased;1589 -moz-osx-font-smoothing: grayscale;1590 content: '\f140';1591 display: inline-block;1592 margin-top: -2px;1593 }1594 .attachment-info .advanced-visible .advanced-toggle:after {1595 content: '\f142';1596 }1597 1598 1550 .attachment-info .edit-attachment, 1599 1551 .attachment-info .refresh-attachment, 1600 1552 .attachment-info .delete-attachment, -
src/wp-includes/js/media-views.js
6334 6334 'click .trash-attachment': 'trashAttachment', 6335 6335 'click .edit-attachment': 'editAttachment', 6336 6336 'click .refresh-attachment': 'refreshAttachment', 6337 'click .advanced-toggle': 'onToggleAdvanced',6338 6337 'keydown': 'toggleSelectionHandler' 6339 6338 }, 6340 6339 … … 6347 6346 */ 6348 6347 media.view.Attachment.prototype.initialize.apply( this, arguments ); 6349 6348 }, 6350 6351 6349 /** 6352 * Render view, then check if the advanced details should be shown.6353 */6354 render: function(){6355 media.view.Attachment.prototype.render.apply( this, arguments );6356 6357 if ( 'show' === getUserSetting( 'advImgDetails' ) ) {6358 this.toggleAdvanced( true );6359 }6360 },6361 /**6362 6350 * @param {Object} event 6363 6351 */ 6364 6352 deleteAttachment: function( event ) { … … 6414 6402 $('.attachments-browser .details').focus(); 6415 6403 return false; 6416 6404 } 6417 } ,6405 } 6418 6406 6419 onToggleAdvanced: function( event ) {6420 event.preventDefault();6421 this.toggleAdvanced();6422 },6423 6424 toggleAdvanced: function( show ) {6425 var $advanced = this.$( '.advanced-section' ), mode = 'show';6426 6427 if ( $advanced.hasClass('advanced-visible') || false === show ) {6428 $advanced.removeClass('advanced-visible');6429 $advanced.find('.advanced-settings').addClass('hidden');6430 mode = 'hide';6431 } else {6432 $advanced.addClass('advanced-visible');6433 $advanced.find('.advanced-settings').removeClass('hidden');6434 }6435 6436 setUserSetting( 'advImgDetails', mode );6437 }6438 6407 }); 6439 6408 6440 6409 /** -
src/wp-includes/media-template.php
311 311 <span class="saved"><?php esc_html_e('Saved.'); ?></span> 312 312 </span> 313 313 <div class="details"> 314 <h3><?php _e('Attachment Details'); ?></h3> 315 <div class="filename setting"> 316 <span class="name"><?php _e( 'File name' ); ?></span> <span class="value">{{ data.filename }}</span> 317 </div> 318 <div class="filename setting"> 319 <span class="name"><?php _e( 'File type' ); ?></span> <span class="value">{{ data.mime }}</span> 320 </div> 321 <div class="uploaded setting"> 322 <span class="name"><?php _e( 'Uploaded on' ); ?></span> <span class="value">{{ data.dateFormatted }}</span> 323 </div> 324 <div class="file-size setting"> 325 <span class="name"><?php _e( 'File size' ); ?></span> <span class="value">{{ data.filesizeHumanReadable }}</span> 326 </div> 314 <div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div> 315 <div class="filename"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div> 316 <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div> 317 318 <div class="file-size"><strong><?php _e( 'File size:' ); ?></strong> {{ data.filesizeHumanReadable }}</div> 327 319 <# if ( 'image' === data.type && ! data.uploading ) { #> 328 320 <# if ( data.width && data.height ) { #> 329 <div class="dimensions setting"><span class="name"><?php _e( 'Dimensions' ); ?></span> <span class="value">{{ data.width }} × {{ data.height }}</span></div>321 <div class="dimensions"><strong><?php _e( 'Dimensions:' ); ?></strong> {{ data.width }} × {{ data.height }}</div> 330 322 <# } #> 331 323 <# } #> 332 324 333 325 <# if ( data.fileLength ) { #> 334 <div class="file-length setting"><span class="name"><?php _e( 'Length' ); ?></span> <span class="value">{{ data.fileLength }}</span></div>326 <div class="file-length"><strong><?php _e( 'Length:' ); ?></strong> {{ data.fileLength }}</div> 335 327 <# } #> 336 328 337 329 <# if ( 'audio' === data.type && data.meta.bitrate ) { #> 338 <div class="bitrate setting">339 <s pan class="name"><?php _e( 'Bitrate' ); ?></span> <span class="value">{{ Math.round( data.meta.bitrate / 1000 ) }}kb/s330 <div class="bitrate"> 331 <strong><?php _e( 'Bitrate:' ); ?></strong> {{ Math.round( data.meta.bitrate / 1000 ) }}kb/s 340 332 <# if ( data.meta.bitrate_mode ) { #> 341 333 {{ ' ' + data.meta.bitrate_mode.toUpperCase() }} 342 <# } #> </span>334 <# } #> 343 335 </div> 344 336 <# } #> 345 337 346 <label class="url setting" data-setting="url">347 <span class="name"><?php _e( 'URL' ); ?></span>348 <input type="text" value="{{ data.url }}" readonly />349 </label>350 351 338 <div class="compat-meta"> 352 339 <# if ( data.compat && data.compat.meta ) { #> 353 340 {{{ data.compat.meta }}} … … 355 342 </div> 356 343 </div> 357 344 358 <div class="settings advanced-section"> 359 <h3><a class="advanced-toggle" href="#"><?php _e( 'Attachment Meta' ); ?></a></h3> 360 <div class="advanced-settings hidden"> 361 <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 362 <label class="setting" data-setting="title"> 363 <span class="name"><?php _e( 'Title' ); ?></span> 364 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> 345 <div class="settings"> 346 <label class="setting" data-setting="url"> 347 <span class="name"><?php _e('URL'); ?></span> 348 <input type="text" value="{{ data.url }}" readonly /> 349 </label> 350 <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 351 <label class="setting" data-setting="title"> 352 <span class="name"><?php _e('Title'); ?></span> 353 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> 354 </label> 355 <# if ( 'audio' === data.type ) { #> 356 <?php foreach ( array( 357 'artist' => __( 'Artist' ), 358 'album' => __( 'Album' ), 359 ) as $key => $label ) : ?> 360 <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>"> 361 <span class="name"><?php echo $label ?></span> 362 <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" /> 363 </label> 364 <?php endforeach; ?> 365 <# } #> 366 <label class="setting" data-setting="caption"> 367 <span class="name"><?php _e( 'Caption' ); ?></span> 368 <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 369 </label> 370 <# if ( 'image' === data.type ) { #> 371 <label class="setting" data-setting="alt"> 372 <span class="name"><?php _e( 'Alt Text' ); ?></span> 373 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> 365 374 </label> 366 <# if ( 'audio' === data.type ) { #> 367 <?php foreach ( array( 368 'artist' => __( 'Artist' ), 369 'album' => __( 'Album' ), 370 ) as $key => $label ) : ?> 371 <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>"> 372 <span class="name"><?php echo $label ?></span> 373 <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" /> 374 </label> 375 <?php endforeach; ?> 376 <# } #> 377 <label class="setting" data-setting="caption"> 378 <span class="name"><?php _e( 'Caption' ); ?></span> 379 <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 380 </label> 381 <# if ( 'image' === data.type ) { #> 382 <label class="setting" data-setting="alt"> 383 <span class="name"><?php _e( 'Alt Text' ); ?></span> 384 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> 385 </label> 386 <# } #> 387 <label class="setting" data-setting="description"> 388 <span class="name"><?php _e( 'Description' ); ?></span> 389 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 390 </label> 375 <# } #> 376 <label class="setting" data-setting="description"> 377 <span class="name"><?php _e('Description'); ?></span> 378 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 379 </label> 380 <label class="setting"> 381 <span class="name"><?php _e( 'Uploaded By' ); ?></span> 382 <span class="value">{{ data.authorName }}</span> 383 </label> 384 <# if ( data.uploadedTo ) { #> 391 385 <label class="setting"> 392 <span class="name"><?php _e( 'Uploaded By' ); ?></span>393 <span class="value"> {{ data.authorName }}</span>386 <span class="name"><?php _e( 'Uploaded To' ); ?></span> 387 <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span> 394 388 </label> 395 <# if ( data.uploadedTo ) { #> 396 <label class="setting"> 397 <span class="name"><?php _e( 'Uploaded To' ); ?></span> 398 <# if ( data.uploadedToLink ) { #> 399 <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span> 400 <# } else { #> 401 <span class="value">{{ data.uploadedToTitle }}</span> 402 <# } #> 403 </label> 404 <# } #> 405 <div class="attachment-compat"></div> 406 </div> 389 <# } #> 390 <div class="attachment-compat"></div> 407 391 </div> 408 392 409 393 <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> |