Make WordPress Core


Ignore:
Timestamp:
10/12/2017 04:00:15 AM (7 years ago)
Author:
westonruter
Message:

Customize: Add changeset locking in Customizer to prevent users from overriding each other's changes.

  • Customization locking is checked when changesets are saved and when heartbeat ticks.
  • Lock is lifted immediately upon a user closing the Customizer.
  • Heartbeat is introduced into Customizer.
  • Changes made to user after it was locked by another user are stored as an autosave revision for restoration.
  • Lock notification displays link to preview the other user's changes on the frontend.
  • A user loading a locked Customizer changeset will be presented with an option to take over.
  • Autosave revisions attached to a published changeset are converted into auto-drafts so that they will be presented to users for restoration.
  • Focus constraining is improved in overlay notifications.
  • Escape key is stopped from propagating in overlay notifications, and it dismisses dismissible overlay notifications.
  • Introduces changesetLocked state which is used to disable the Save button and suppress the AYS dialog when leaving the Customizer.
  • Fixes bug where users could be presented with each other's autosave revisions.

Props sayedwp, westonruter, melchoyce.
See #31436, #31897, #39896.
Fixes #42024.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r41805 r41839  
    548548    $scripts->add( 'customize-models',   "/wp-includes/js/customize-models.js", array( 'underscore', 'backbone' ), false, 1 );
    549549    $scripts->add( 'customize-views',    "/wp-includes/js/customize-views.js",  array( 'jquery', 'underscore', 'imgareaselect', 'customize-models', 'media-editor', 'media-views' ), false, 1 );
    550     $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util' ), false, 1 );
     550    $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util', 'jquery-ui-core' ), false, 1 );
    551551    did_action( 'init' ) && $scripts->localize( 'customize-controls', '_wpCustomizeControlsL10n', array(
    552552        'activate'           => __( 'Activate & Publish' ),
     
    575575        'expandSidebar'      => _x( 'Show Controls', 'label for hide controls button without length constraints' ),
    576576        'untitledBlogName'   => __( '(Untitled)' ),
    577         'serverSaveError'    => __( 'Failed connecting to the server. Please try saving again.' ),
     577        'unknownRequestFail' => __( 'Looks like something’s gone wrong. Wait a couple seconds, and then try again.' ),
    578578        'themeDownloading'   => __( 'Downloading your new theme…' ),
    579579        'themePreviewWait'   => __( 'Setting up your live preview. This may take a bit.' ),
    580580        'revertingChanges'   => __( 'Reverting unpublished changes…' ),
    581581        'trashConfirm'       => __( 'Are you sure you’d like to discard your unpublished changes?' ),
     582        /* translators: %s: Display name of the user who has taken over the changeset in customizer. */
     583        'takenOverMessage'   => __( '%s has taken over and is currently customizing.' ),
    582584        /* translators: %s: URL to the Customizer to load the autosaved version */
    583585        'autosaveNotice'     => __( 'There is a more recent autosave of your changes than the one you are previewing. <a href="%s">Restore the autosave</a>' ),
Note: See TracChangeset for help on using the changeset viewer.