Ticket #23898: 23898.diff
File 23898.diff, 3.5 KB (added by , 12 years ago) |
---|
-
wp-includes/post-template.php
1426 1426 // The following removes that revision when $parent == false 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 ); 1432 1432 … … 1436 1436 foreach ( $revisions as $revision ) { 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 ) ) 1442 1442 continue; -
wp-admin/includes/ajax-actions.php
2130 2130 if ( 0 != $single_revision_id ) { 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 ) { 2135 2138 $temp = $left_revision; … … 2155 2158 if ( ! empty( $show_split_view ) ) 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' ] ) ) 2161 2165 $content .= $diff[ 'html' ]; … … 2185 2189 $revisions = array_reverse( $revisions ); 2186 2190 2187 2191 $previous_revision_id = 0; 2192 2188 2193 foreach ( $revisions as $revision ) : 2189 2194 //error_log( ( $show_autosaves )); 2190 2195 if ( empty( $show_autosaves ) && wp_is_post_autosave( $revision ) ) … … 2269 2274 $revision_from_date_author = $revision_date_author; 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, 2275 2280 'revision_date_author' => $revision_date_author, -
wp-admin/js/revisions.js
424 424 // render the revisions 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( 442 445 this.model.at( thediff ).toJSON(),