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: https://develop.svn.wordpress.org/trunk@23994 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2013-04-15 18:40:17 +00:00
parent 744b903ec0
commit b3879a543a
5 changed files with 30 additions and 35 deletions

View File

@ -1495,6 +1495,10 @@ table.diff .diff-addedline ins {
background-color: #aaa; background-color: #aaa;
} }
.diff-label {
color: #666;
}
/* jQuery UI Slider */ /* jQuery UI Slider */
.wp-slider.ui-slider { .wp-slider.ui-slider {
border-color: #d1e5ee; border-color: #d1e5ee;

View File

@ -1398,6 +1398,10 @@ table.diff .diff-addedline ins {
background-color: #aaa; background-color: #aaa;
} }
.diff-label {
color: #666;
}
body .ui-tooltip { body .ui-tooltip {
border-color: #d7d7d7; border-color: #d7d7d7;
background-color: #fff; background-color: #fff;

View File

@ -3612,6 +3612,14 @@ table.diff .diff-addedline ins {
width: 95%; width: 95%;
} }
#diff-title-to strong {
display: none;
}
.comparing-two-revisions #diff-title-to strong {
display: inline;
}
.diff-slider-ticks-wrapper { .diff-slider-ticks-wrapper {
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
@ -3623,6 +3631,12 @@ table.diff .diff-addedline ins {
margin-top: 20px; margin-top: 20px;
} }
.diff-label {
margin: 20px 0 5px;
padding-left: 3px;
font-size: 13px;
}
.diff-header { .diff-header {
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
@ -3642,38 +3656,15 @@ table.diff .diff-addedline ins {
.diff-title img { .diff-title img {
vertical-align: middle; vertical-align: middle;
margin-left: 5px;
} }
#restore-revision { #restore-revision {
margin-left: 10px; margin-left: 10px;
} }
.diff-col-titles { #diff-table {
font-size: 16px; margin-top: 20px;
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;
} }
.comparing-two-revisions #diff-previous-revision, .comparing-two-revisions #diff-previous-revision,

View File

@ -2135,7 +2135,7 @@ function wp_ajax_revisions_data() {
$lines_added = $lines_deleted = 0; $lines_added = $lines_deleted = 0;
$content = ''; $content = '';
//compare from left to right, passed from application //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' ); $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' ); $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 // 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 ); $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' ]; $content .= $diff[ 'html' ];
}
if ( isset( $diff[ 'lines_added' ] ) ) if ( isset( $diff[ 'lines_added' ] ) )
$lines_added = $lines_added + $diff[ 'lines_added' ]; $lines_added = $lines_added + $diff[ 'lines_added' ];

View File

@ -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' )?>" /> <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>
<div class="diff-col-titles"> <div id="diff-table">{{{ data.diff }}}</div>
<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>
</script> </script>
<script id="tmpl-revision-interact" type="text/html"> <script id="tmpl-revision-interact" type="text/html">