Ticket #24056: 24056-prioritize.patch
File 24056-prioritize.patch, 2.0 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/ajax-actions.php
2209 2209 ( 0 != $right_handle_at && $count > ( $right_handle_at - 2 ) ) ) ) { 2210 2210 $all_the_revisions[] = array ( 2211 2211 'ID' => $revision->ID, 2212 'timestamp' => strtotime($revision->post_modified) 2212 2213 ); 2213 2214 continue; 2214 2215 } … … 2217 2218 ( 0 != $left_handle_at && $count < $right_handle_at ) ) ) { 2218 2219 $all_the_revisions[] = array ( 2219 2220 'ID' => $revision->ID, 2221 'timestamp' => strtotime($revision->post_modified) 2220 2222 ); 2221 2223 continue; 2222 2224 } … … 2305 2307 'restoreLink' => urldecode( $restore_link ), 2306 2308 'previousID' => $previous_revision_id, 2307 2309 'isCurrent' => $is_current_revision, 2310 'timestamp' => strtotime($revision->post_modified) 2308 2311 ); 2309 2312 } 2310 2313 $previous_revision_id = $revision->ID; -
wp-admin/js/revisions.js
68 68 self.rightDiff = self.revisions.indexOf( revision ) + 1; 69 69 }); 70 70 71 // load revisions in order of their chronological closeness to the handles 72 var left = this.singleRevision ? 0 : self.revisions.models[self.leftDiff -1].get('timestamp'), 73 right = self.revisions.models[self.rightDiff-1].get('timestamp'); 74 revisionsToLoad = _.sortBy( revisionsToLoad, function( model ) { 75 var t = model.get('timestamp'), 76 y = Math.abs( t - right ), 77 x = Math.abs( t - left ); 78 return _.min([x,y]); 79 }); 80 71 81 _.each( revisionsToLoad, function( revision ) { 72 82 _.delay( function() { 73 83 revision.fetch( { … … 793 803 }); 794 804 }, 795 805 806 comparator: function(item) { 807 return item.get('timestamp'); 808 }, 809 796 810 url: function() { 797 811 return ajaxurl + 798 812 '?action=revisions-data' +