Revisions: real URLs and preloading of the requested diff.

* Real URLs are being used now, using pushState. `?revision={id}` or `?from={from}&to={to}`.
* Drop the redundant `action=edit` from the URLs (this is the default).
* The initial comparison is preloaded, whether a single revision or a compare-two situation.

See #24425.

git-svn-id: https://develop.svn.wordpress.org/trunk@24664 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2013-07-11 22:56:48 +00:00
parent 05006a0da4
commit 1fb9b2cfa1
4 changed files with 63 additions and 20 deletions
+5 -2
View File
@@ -11,9 +11,12 @@ require_once('./admin.php');
require ABSPATH . 'wp-admin/includes/revision.php';
wp_reset_vars( array( 'revision', 'action' ) );
wp_reset_vars( array( 'revision', 'action', 'from', 'to' ) );
$revision_id = absint( $revision );
$from = absint( $from );
if ( ! $revision_id )
$revision_id = absint( $to );
$redirect = 'edit.php';
switch ( $action ) :
@@ -79,7 +82,7 @@ else
$parent_file = $submenu_file = 'edit.php';
wp_enqueue_script( 'revisions' );
wp_localize_script( 'revisions', '_wpRevisionsSettings', wp_prepare_revisions_for_js( $post, $revision_id ) );
wp_localize_script( 'revisions', '_wpRevisionsSettings', wp_prepare_revisions_for_js( $post, $revision_id, $from ) );
/* Revisions Help Tab */