Make WordPress Core


Ignore:
Timestamp:
07/22/2013 05:05:45 AM (11 years ago)
Author:
markjaquith
Message:

Revisions: Pinned controls, layout tweaks, copy tweaks, misc.

  • When you scroll down the diff view, the controls will pin to the top.
  • The revisions meta view was cleaned up. Copy changes.
  • Loading indicator in the center of the screen (so it follows as you scroll).
  • Tooltips "flip" when you cross the center line, so that they don't hit the container edge and wrap for later revisions.
  • The "Restore" button's inactive state is handled on render, instead of after.
  • Make sure we always have a current revision, even if the timestamp doesn't work out on the most recent one.

See #24804. Props markjaquith, nacin, ocean90, aaroncampbell.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/revision.php

    r24730 r24761  
    100100        $modified = strtotime( $revision->post_modified );
    101101        $modified_gmt = strtotime( $revision->post_modified_gmt );
    102         $restore_link = wp_nonce_url(
     102        $restore_link = str_replace( '&', '&', wp_nonce_url(
    103103            add_query_arg(
    104104                array( 'revision' => $revision->ID,
     
    107107            ),
    108108            "restore-post_{$revision->ID}"
    109         );
     109        ) );
    110110
    111111        if ( ! isset( $authors[ $revision->post_author ] ) ) {
    112112            $authors[ $revision->post_author ] = array(
    113113                'id' => (int) $revision->post_author,
    114                 'avatar' => $show_avatars ? get_avatar( $revision->post_author, 24 ) : '',
     114                'avatar' => $show_avatars ? get_avatar( $revision->post_author, 32 ) : '',
    115115                'name' => get_the_author_meta( 'display_name', $revision->post_author ),
    116116            );
     
    143143    }
    144144
     145    // If a post has been saved since the last revision (no revisioned fields were changed)
     146    // we may not have a "current" revision. Mark the latest revision as "current".
     147    if ( empty( $current_id ) )
     148        $revisions[ $revision->ID ]['current'] = true;
     149
    145150    // Now, grab the initial diff
    146151    $compare_two_mode = is_numeric( $from );
Note: See TracChangeset for help on using the changeset viewer.