Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#6682 closed defect (bug) (fixed)

Preview link shows an out of date version

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


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 9 years ago.
6682.patch (2.3 KB) - added by azaozz 9 years ago.

Download all attachments as: .zip

Change History (10)

#1 @DanCoulter
9 years ago

  • Keywords has-patch added

#2 @ryan
9 years ago

  • Owner changed from anonymous to ryan

#3 @matt
9 years ago

  • Keywords blessed added

#4 @ryan
9 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
9 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
9 years ago

  • Owner changed from ryan to azaozz

#7 @azaozz
9 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.

9 years ago

#8 @ryan
9 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

Note: See TracTickets for help on using tickets.