Changeset 29436
- Timestamp:
- 08/07/2014 08:31:21 PM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/css/media-views.css
r29425 r29436 285 285 286 286 .media-sidebar h3, 287 .image-details h3, 288 .attachment-info h3 { 287 .image-details h3 { 289 288 position: relative; 290 289 font-weight: bold; … … 1486 1485 } 1487 1486 1488 .attachment-details .settings-save-status .spinner, 1489 .attachment-details .settings-save-status .saved { 1490 margin: 0 5px -20px; 1487 .attachment-details .settings-save-status .spinner { 1488 margin: 0 5px 0; 1491 1489 } 1492 1490 … … 1511 1509 } 1512 1510 1513 .attachment-info .details {1514 clear: right;1515 }1516 1517 .attachment-info h3:first-child {1518 margin-top: 0;1519 }1520 1521 .attachment-info .details .setting .name {1522 float: left;1523 margin: 8px 1% 0 1% !important;1524 padding: 0;1525 line-height: 1.1;1526 }1527 1528 .attachment-info .details .url.setting .name {1529 padding-top: 3px;1530 }1531 1532 .attachment-info .setting .value {1533 font-style: italic;1534 }1535 1536 1511 .attachment-info .filename { 1537 1512 font-weight: bold; … … 1594 1569 font-size: 12px; 1595 1570 max-width: 100%; 1596 }1597 1598 .attachment-info .advanced-toggle {1599 color: #666;1600 text-decoration: none;1601 display: block;1602 }1603 .attachment-info .advanced-toggle:hover {1604 color: #d54e21;1605 }1606 1607 .attachment-info .advanced-toggle:after {1608 font: normal 20px/1 'dashicons';1609 speak: none;1610 vertical-align: top;1611 -webkit-font-smoothing: antialiased;1612 -moz-osx-font-smoothing: grayscale;1613 content: '\f140';1614 display: inline-block;1615 margin-top: -2px;1616 }1617 .attachment-info .advanced-visible .advanced-toggle:after {1618 content: '\f142';1619 1571 } 1620 1572 -
trunk/src/wp-includes/js/media-views.js
r29435 r29436 6320 6320 'click .edit-attachment': 'editAttachment', 6321 6321 'click .refresh-attachment': 'refreshAttachment', 6322 'click .advanced-toggle': 'onToggleAdvanced',6323 6322 'keydown': 'toggleSelectionHandler' 6324 6323 }, … … 6333 6332 media.view.Attachment.prototype.initialize.apply( this, arguments ); 6334 6333 }, 6335 6336 /**6337 * Render view, then check if the advanced details should be shown.6338 */6339 render: function(){6340 media.view.Attachment.prototype.render.apply( this, arguments );6341 6342 if ( 'show' === getUserSetting( 'advImgDetails' ) ) {6343 this.toggleAdvanced( true );6344 }6345 },6346 6334 /** 6347 6335 * @param {Object} event … … 6400 6388 return false; 6401 6389 } 6402 },6403 6404 onToggleAdvanced: function( event ) {6405 event.preventDefault();6406 this.toggleAdvanced();6407 },6408 6409 toggleAdvanced: function( show ) {6410 var $advanced = this.$( '.advanced-section' ), mode = 'show';6411 6412 if ( $advanced.hasClass('advanced-visible') || false === show ) {6413 $advanced.removeClass('advanced-visible');6414 $advanced.find('.advanced-settings').addClass('hidden');6415 mode = 'hide';6416 } else {6417 $advanced.addClass('advanced-visible');6418 $advanced.find('.advanced-settings').removeClass('hidden');6419 }6420 6421 setUserSetting( 'advImgDetails', mode );6422 6390 } 6391 6423 6392 }); 6424 6393 -
trunk/src/wp-includes/media-template.php
r29430 r29436 332 332 </span> 333 333 <div class="details"> 334 <h3><?php _e('Attachment Details'); ?></h3> 335 <div class="filename setting"> 336 <span class="name"><?php _e( 'File name' ); ?></span> <span class="value">{{ data.filename }}</span> 337 </div> 338 <div class="filename setting"> 339 <span class="name"><?php _e( 'File type' ); ?></span> <span class="value">{{ data.mime }}</span> 340 </div> 341 <div class="uploaded setting"> 342 <span class="name"><?php _e( 'Uploaded on' ); ?></span> <span class="value">{{ data.dateFormatted }}</span> 343 </div> 344 <div class="file-size setting"> 345 <span class="name"><?php _e( 'File size' ); ?></span> <span class="value">{{ data.filesizeHumanReadable }}</span> 346 </div> 334 <div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div> 335 <div class="filename"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div> 336 <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div> 337 338 <div class="file-size"><strong><?php _e( 'File size:' ); ?></strong> {{ data.filesizeHumanReadable }}</div> 347 339 <# if ( 'image' === data.type && ! data.uploading ) { #> 348 340 <# if ( data.width && data.height ) { #> 349 <div class="dimensions setting"><span class="name"><?php _e( 'Dimensions' ); ?></span> <span class="value">{{ data.width }} × {{ data.height }}</span></div>341 <div class="dimensions"><strong><?php _e( 'Dimensions:' ); ?></strong> {{ data.width }} × {{ data.height }}</div> 350 342 <# } #> 351 343 <# } #> 352 344 353 345 <# if ( data.fileLength ) { #> 354 <div class="file-length setting"><span class="name"><?php _e( 'Length' ); ?></span> <span class="value">{{ data.fileLength }}</span></div>346 <div class="file-length"><strong><?php _e( 'Length:' ); ?></strong> {{ data.fileLength }}</div> 355 347 <# } #> 356 348 357 349 <# if ( 'audio' === data.type && data.meta.bitrate ) { #> 358 <div class="bitrate setting">359 <s pan class="name"><?php _e( 'Bitrate' ); ?></span> <span class="value">{{ Math.round( data.meta.bitrate / 1000 ) }}kb/s350 <div class="bitrate"> 351 <strong><?php _e( 'Bitrate:' ); ?></strong> {{ Math.round( data.meta.bitrate / 1000 ) }}kb/s 360 352 <# if ( data.meta.bitrate_mode ) { #> 361 353 {{ ' ' + data.meta.bitrate_mode.toUpperCase() }} 362 <# } #> </span>354 <# } #> 363 355 </div> 364 356 <# } #> 365 366 <label class="url setting" data-setting="url">367 <span class="name"><?php _e( 'URL' ); ?></span>368 <input type="text" value="{{ data.url }}" readonly />369 </label>370 357 371 358 <div class="compat-meta"> … … 376 363 </div> 377 364 378 <div class="settings advanced-section"> 379 <h3><a class="advanced-toggle" href="#"><?php _e( 'Attachment Meta' ); ?></a></h3> 380 <div class="advanced-settings hidden"> 381 <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 382 <label class="setting" data-setting="title"> 383 <span class="name"><?php _e( 'Title' ); ?></span> 384 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> 365 <div class="settings"> 366 <label class="setting" data-setting="url"> 367 <span class="name"><?php _e('URL'); ?></span> 368 <input type="text" value="{{ data.url }}" readonly /> 369 </label> 370 <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> 371 <label class="setting" data-setting="title"> 372 <span class="name"><?php _e('Title'); ?></span> 373 <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> 374 </label> 375 <# if ( 'audio' === data.type ) { #> 376 <?php foreach ( array( 377 'artist' => __( 'Artist' ), 378 'album' => __( 'Album' ), 379 ) as $key => $label ) : ?> 380 <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>"> 381 <span class="name"><?php echo $label ?></span> 382 <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" /> 383 </label> 384 <?php endforeach; ?> 385 <# } #> 386 <label class="setting" data-setting="caption"> 387 <span class="name"><?php _e( 'Caption' ); ?></span> 388 <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 389 </label> 390 <# if ( 'image' === data.type ) { #> 391 <label class="setting" data-setting="alt"> 392 <span class="name"><?php _e( 'Alt Text' ); ?></span> 393 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> 385 394 </label> 386 <# if ( 'audio' === data.type ) { #> 387 <?php foreach ( array( 388 'artist' => __( 'Artist' ), 389 'album' => __( 'Album' ), 390 ) as $key => $label ) : ?> 391 <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>"> 392 <span class="name"><?php echo $label ?></span> 393 <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" /> 395 <# } #> 396 <label class="setting" data-setting="description"> 397 <span class="name"><?php _e('Description'); ?></span> 398 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 399 </label> 400 <label class="setting"> 401 <span class="name"><?php _e( 'Uploaded By' ); ?></span> 402 <span class="value">{{ data.authorName }}</span> 403 </label> 404 <# if ( data.uploadedTo ) { #> 405 <label class="setting"> 406 <span class="name"><?php _e( 'Uploaded To' ); ?></span> 407 <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span> 394 408 </label> 395 <?php endforeach; ?> 396 <# } #> 397 <label class="setting" data-setting="caption"> 398 <span class="name"><?php _e( 'Caption' ); ?></span> 399 <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> 400 </label> 401 <# if ( 'image' === data.type ) { #> 402 <label class="setting" data-setting="alt"> 403 <span class="name"><?php _e( 'Alt Text' ); ?></span> 404 <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> 405 </label> 406 <# } #> 407 <label class="setting" data-setting="description"> 408 <span class="name"><?php _e( 'Description' ); ?></span> 409 <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> 410 </label> 411 <label class="setting"> 412 <span class="name"><?php _e( 'Uploaded By' ); ?></span> 413 <span class="value">{{ data.authorName }}</span> 414 </label> 415 <# if ( data.uploadedTo ) { #> 416 <label class="setting"> 417 <span class="name"><?php _e( 'Uploaded To' ); ?></span> 418 <# if ( data.uploadedToLink ) { #> 419 <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span> 420 <# } else { #> 421 <span class="value">{{ data.uploadedToTitle }}</span> 422 <# } #> 423 </label> 424 <# } #> 425 <div class="attachment-compat"></div> 426 </div> 409 <# } #> 410 <div class="attachment-compat"></div> 427 411 </div> 428 412
Note: See TracChangeset
for help on using the changeset viewer.