WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/02/2017 03:36:18 AM (2 years ago)
Author:
westonruter
Message:

Customize: Add infrastructure for trashing/reverting of unpublished changes; introduce full-screen OverlayNotification for trashing and theme install/preview.

  • Introduce a new wp.customize.previewer.trash() JS API to trash the current changeset, along with logic to WP_Customize_Manager to handle deleting changeset drafts.
  • Add trashing to wp.customize.state which is then used to update the UI.
  • UI for trashing is pending design feedback. One possibility is to add a new trash button to Publish Settings section that invokes wp.customize.previewer.trash().
  • Improve logic for managing the visibility and disabled states for publish buttons.
  • Prevent attempting requestChangesetUpdate while processing and bump processing while doing save.
  • Update changeset_date state only if sent in save response.
  • Merge ThemesSection#loadThemePreview() into ThemesPanel#loadThemePreview().
  • Remove unused autosaved state.
  • Start autosaving and prompting at beforeunload after a change first happens. This is key for theme previews since even if a user did not make any changes, there were still dirty settings which would get stored in an auto-draft unexpectedly.
  • Allow Notification to accept additional classes to be added to container.
  • Introduce OverlayNotification and use for theme installing, previewing, and trashing. Such overlay notifications take over the entire window.

Props westonruter, celloexpressions.
See #37661, #39896, #21666, #35210.

File:
1 edited

Legend:

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

    r41640 r41667  
    572572        'untitledBlogName'   => __( '(Untitled)' ),
    573573        'serverSaveError'    => __( 'Failed connecting to the server. Please try saving again.' ),
     574        'themeDownloading'   => __( 'Downloading your new theme…' ),
     575        'themePreviewWait'   => __( 'Setting up your live preview. This may take a bit.' ),
     576        'revertingChanges'   => __( 'Reverting unpublished changes…' ),
     577        'trashConfirm'       => __( 'Are you sure you would like to discard your unpublished changes?' ),
    574578        /* translators: %s: URL to the Customizer to load the autosaved version */
    575579        '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.