Make WordPress Core

Opened 18 years ago

Closed 17 years ago

Last modified 17 months ago

#6682 closed defect (bug) (fixed)

Preview link shows an out of date version

Reported by: dancoulter's profile DanCoulter Owned by: azaozz's profile azaozz
Milestone: 2.6 Priority: normal
Severity: minor Version: 2.5
Component: Administration Keywords: has-patch blessed
Focuses: Cc:

Description

When you click on the preview link, it (obviously) shows the most recently saved version. This version can be a bit out-of-date because the autosave only happens every minute. Having to click "Save", then waiting for the page to refresh, then clicking on the Preview link is a bit counter intuitive. The link can easily be used to trigger the autosave() JS function so that the most up-to-date version is displayed upon preview.

Attachments (2)

autosave-on-preview.patch (758 bytes) - added by DanCoulter 18 years ago.
6682.patch (2.3 KB) - added by azaozz 17 years ago.

Download all attachments as: .zip

Change History (14)

#1 @DanCoulter
18 years ago

  • Keywords has-patch added

#2 @ryan
18 years ago

  • Owner changed from anonymous to ryan

#3 @matt
18 years ago

  • Keywords blessed added

#4 @ryan
18 years ago

  • Milestone changed from 2.7 to 2.6

The preview often pops up before the autosave completes. We need to wait until autosave completes somehow.

#5 @trombonekenny
18 years ago

I like the way Atlassian Confluence Wikis provide previews (you can try it out on their test space at http://confluence.atlassian.com/display/TESTING/Home): they use tabs over the textarea box to choose between a rich text editor, a plain textarea, and a rendered preview. Since it's a javascript function to switch between an editor or a preview (instead of opening a new window,) it can wait for the autosave to complete. IMO, it's a smoother workflow because it keeps everything in one window, it keeps all the editing tools on the screen and only previews the content part (not the full rendered blog page.)

That tabbed/JS behavior should be pretty easy to prototype as a plugin. Maybe I'll take a crack at that soon.

I disagree with the 'minor' severity of the ticket... this is the biggest change I've noticed going to 2.5. Previewing, re-editing, and saving are critical workflows in the way I use WP, and that's a process I want to be efficient and intuitive. I don't think it is anymore with 2.5.1.

#6 @ryan
17 years ago

  • Owner changed from ryan to azaozz

#7 @azaozz
17 years ago

Changed the above patch to wait for autosave to complete (to enable the buttons again) before showing the preview. Trade off is that the preview window will remain blank until autosave is done, may look as if the server is a bit slow sometimes.

We can show a mini-preview in a tab, however the editor area is quite small compared to the link above, so the preview will not be as good. Another option might be to show it in a ThickBox, similar to the theme preview.

@azaozz
17 years ago

#8 @ryan
17 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [8170]) Autosave when Preview is clicked. Props azaozz and DanCoulter. fixes #6682

This ticket was mentioned in PR #6683 on WordPress/wordpress-develop by @jonsurrell.


19 months ago
#9

  • Add print_script_module_data to WP_Script_Modules
  • Use scriptmoduledata filter for Interactivity data

Depends on (includes) #6682.

Trac ticket:

@jonsurrell commented on PR #6683:


18 months ago
#10

@luisherranz @cbravobernal @darerodz I'd love to get an Interactivity API review of this 🙏

@jonsurrell commented on PR #6683:


17 months ago
#11

Suggested commit message:

Interactivity API: Use Script Modules filter for store and config data

A dedicated API exists for passing data to Script Modules implemented in
changeset [58579]. Use this Core API instead of a custom implementation
for Interactivity API to pass data to the client.

Props jonsurrell, gziolo, luisherranz, cbravobernal.
Fixes #61512.
Note: See TracTickets for help on using tickets.