Changeset 23872
- Timestamp:
- 03/29/2013 08:50:09 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ajax-actions.php
r23832 r23872 2131 2131 $right_revision = get_post( $single_revision_id ); 2132 2132 2133 if ( 0 == $compare_to ) 2134 $left_revision = get_post( $post_id ); 2135 2133 2136 // make sure the right revision is the most recent 2134 2137 if ( $compare_two_mode && $right_revision->ID < $left_revision->ID ) { … … 2156 2159 $args = array( 'show_split_view' => true ); 2157 2160 2158 $diff = wp_text_diff_with_count( $left_content, $right_content, $args ); 2161 // compare_to == 0 means first revision, so compare to a blank field to show whats changed 2162 $diff = wp_text_diff_with_count( ( 0 == $compare_to) ? '' : $left_content, $right_content, $args ); 2159 2163 2160 2164 if ( isset( $diff[ 'html' ] ) ) … … 2186 2190 2187 2191 $previous_revision_id = 0; 2192 2188 2193 foreach ( $revisions as $revision ) : 2189 2194 //error_log( ( $show_autosaves )); … … 2270 2275 $revision_date_author = $tmp; 2271 2276 } 2272 if ( ( $compare_two_mode || 0!== $previous_revision_id ) ) {2277 if ( ( $compare_two_mode || -1 !== $previous_revision_id ) ) { 2273 2278 $alltherevisions[] = array ( 2274 2279 'ID' => $revision->ID, -
trunk/wp-admin/js/revisions.js
r23831 r23872 425 425 render: function() { 426 426 var addHtml = ''; 427 var thediff; 427 428 // compare two revisions mode? 428 429 429 430 if ( 2 === REVAPP._compareOneOrTwo ) { 431 430 432 this.comparetwochecked = 'checked'; 431 433 if ( this.draggingLeft ) { 432 if ( this.model.at( REVAPP._leftDiff ) ) { 434 thediff = REVAPP._leftDiff -1; 435 if ( this.model.at( thediff ) ) { 433 436 addHtml = this.template( _.extend( 434 this.model.at( REVAPP._leftDiff ).toJSON(),437 this.model.at( thediff ).toJSON(), 435 438 { comparetwochecked: this.comparetwochecked } // keep the checkmark checked 436 439 ) ); 437 440 } 438 441 } else { // dragging right handle 439 var thediff = REVAPP._rightDiff;442 thediff = REVAPP._rightDiff -1; 440 443 if ( this.model.at( thediff ) ) { 441 444 addHtml = this.template( _.extend( -
trunk/wp-includes/post-template.php
r23849 r23872 1427 1427 $parent_included = _wp_last_revision_matches_current_post( $post_id ); 1428 1428 if ( $parent_included && ! $parent ) 1429 array_ pop( $revisions );1429 array_shift( $revisions ); 1430 1430 elseif ( ! $parent_included && $parent ) 1431 1431 array_unshift( $revisions, $post ); … … 1437 1437 if ( !current_user_can( 'read_post', $revision->ID ) ) 1438 1438 continue; 1439 1439 1440 1440 $is_autosave = wp_is_post_autosave( $revision ); 1441 1441 if ( ( 'revision' === $type && $is_autosave ) || ( 'autosave' === $type && ! $is_autosave ) )
Note: See TracChangeset
for help on using the changeset viewer.