Revisions UI: Remove the "To:" prefix from the header when viewing a single revision. Also prefix a revision field with a label.
props SergeyBiryukov, adamsilverstein, faishal. fixes #23903. git-svn-id: http://core.svn.wordpress.org/trunk@23994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4cb9074985
commit
731f040664
|
@ -1495,6 +1495,10 @@ table.diff .diff-addedline ins {
|
|||
background-color: #aaa;
|
||||
}
|
||||
|
||||
.diff-label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* jQuery UI Slider */
|
||||
.wp-slider.ui-slider {
|
||||
border-color: #d1e5ee;
|
||||
|
|
|
@ -1398,6 +1398,10 @@ table.diff .diff-addedline ins {
|
|||
background-color: #aaa;
|
||||
}
|
||||
|
||||
.diff-label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
body .ui-tooltip {
|
||||
border-color: #d7d7d7;
|
||||
background-color: #fff;
|
||||
|
|
|
@ -3612,6 +3612,14 @@ table.diff .diff-addedline ins {
|
|||
width: 95%;
|
||||
}
|
||||
|
||||
#diff-title-to strong {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.comparing-two-revisions #diff-title-to strong {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.diff-slider-ticks-wrapper {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
|
@ -3623,6 +3631,12 @@ table.diff .diff-addedline ins {
|
|||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.diff-label {
|
||||
margin: 20px 0 5px;
|
||||
padding-left: 3px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.diff-header {
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
|
@ -3642,38 +3656,15 @@ table.diff .diff-addedline ins {
|
|||
|
||||
.diff-title img {
|
||||
vertical-align: middle;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#restore-revision {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.diff-col-titles {
|
||||
font-size: 16px;
|
||||
width: 100%;
|
||||
margin: 20px 0 10px;
|
||||
}
|
||||
|
||||
.diff-col-title-added,
|
||||
.diff-col-title-removed {
|
||||
width: auto;
|
||||
text-align: left;
|
||||
float: left;
|
||||
width: 48%;
|
||||
}
|
||||
|
||||
.diff-col-title-added span,
|
||||
.diff-col-title-removed span {
|
||||
padding: .5em;
|
||||
}
|
||||
|
||||
.diff-col-title-added {
|
||||
float: right;
|
||||
color: #00a100;
|
||||
}
|
||||
|
||||
.diff-col-title-removed {
|
||||
color: #d2281f;
|
||||
#diff-table {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.comparing-two-revisions #diff-previous-revision,
|
||||
|
|
|
@ -2135,7 +2135,7 @@ function wp_ajax_revisions_data() {
|
|||
$lines_added = $lines_deleted = 0;
|
||||
$content = '';
|
||||
//compare from left to right, passed from application
|
||||
foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
|
||||
foreach ( _wp_post_revision_fields() as $field => $field_value ) {
|
||||
$left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' );
|
||||
$right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' );
|
||||
|
||||
|
@ -2149,8 +2149,10 @@ function wp_ajax_revisions_data() {
|
|||
// compare_to == 0 means first revision, so compare to a blank field to show whats changed
|
||||
$diff = wp_text_diff_with_count( ( 0 == $compare_to ) ? '' : $left_content, $right_content, $args );
|
||||
|
||||
if ( isset( $diff[ 'html' ] ) )
|
||||
if ( isset( $diff[ 'html' ] ) ) {
|
||||
$content .= sprintf( '<div class="diff-label">%s</div>', $field_value );
|
||||
$content .= $diff[ 'html' ];
|
||||
}
|
||||
|
||||
if ( isset( $diff[ 'lines_added' ] ) )
|
||||
$lines_added = $lines_added + $diff[ 'lines_added' ];
|
||||
|
|
|
@ -141,13 +141,7 @@ require_once( './admin-header.php' );
|
|||
<input type="button" id="restore-revision" class="button button-primary" data-restore-link="{{{ data.restoreLink }}}" value="<?php esc_attr_e( 'Restore This Revision' )?>" />
|
||||
</div>
|
||||
|
||||
<div class="diff-col-titles">
|
||||
<div class="diff-col-title-removed"><span><?php _e( 'Removed -' ); ?></span></div>
|
||||
<div class="diff-col-title-added"><span><?php _e( 'Added +' ); ?></span></div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div>{{{ data.diff }}}</div>
|
||||
<div id="diff-table">{{{ data.diff }}}</div>
|
||||
</script>
|
||||
|
||||
<script id="tmpl-revision-interact" type="text/html">
|
||||
|
|
Loading…
Reference in New Issue