WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 20 months ago

Last modified 20 months ago

#21585 closed task (blessed) (fixed)

Gallery preview in the visual editor

Reported by: azaozz Owned by:
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Gallery Keywords:
Focuses: Cc:

Description

Display preview of the gallery in the visual editor.

Attachments (6)

21585.patch (46.6 KB) - added by azaozz 2 years ago.
21585-1.patch (45.8 KB) - added by azaozz 2 years ago.
21585-2.patch (23.9 KB) - added by azaozz 23 months ago.
21585-3.patch (23.8 KB) - added by azaozz 23 months ago.
Refreshed the patch for the min.js naming change
21585-4.patch (19.2 KB) - added by azaozz 23 months ago.
21585-5.patch (20.3 KB) - added by azaozz 22 months ago.

Download all attachments as: .zip

Change History (18)

azaozz2 years ago

comment:1 azaozz2 years ago

21585.patch is a "first run", still rough in many places.

  • Adds the 'noneditable' plugin to TinyMCE and uses it for the gallery preview (so the whole div is "static" in the editor).
  • The HTML for the gallery is fetched after TinyMCE loads or after switching Text -> Visual editor with XHR.
  • Supports all shortcode options.

azaozz2 years ago

comment:2 azaozz2 years ago

Changes in 21585-1.patch: remove some debug leftovers, move appending of the gallery preview div ID to ajax-actions.

comment:3 ocean902 years ago

Tested in Chrome and some points:

  • wp_die() instead of die()
  • editor.dev.css has some whitespace/tabs trouble
  • Editor resizer is gone
  • Double edit icons: http://cl.ly/Ilsh
  • Some edit icons doesn't have a function, seems like only the upper left with the photo icon is the one, but not the delete button.
  • You can resize the images, but it will not be saved
  • Though I selected to link the images with the file it still links to the attachment page

comment:4 simonwheatley2 years ago

  • Cc simon@… added

azaozz23 months ago

comment:5 azaozz23 months ago

In 21585-2.patch:

  • Replaced die() with wp_die().
  • Better "content-not-editable" in the editor, uses a blocking div that can be styled and prevents access to the gallery thumbnails so IE and Firefox won't try to make them resizeable.
  • The Edit and Delete popup buttons work properly.

To-do: better default styling of the gallery preview. Themes will be able to style the preview (in editor-style.css), but we need a sensible default styling for themes that don't use the default gallery.

Still a bit worried that previewing the gallery in the visual editor would be awkward (marginal UX) as the users would expect to edit it directly. Darkening the preview and showing the Edit and Delete buttons make it clear it can't be edited.

azaozz23 months ago

Refreshed the patch for the min.js naming change

azaozz23 months ago

azaozz22 months ago

comment:6 azaozz22 months ago

In 21585-5.patch: stop Firefox selecting all of the gallery preview (and highlighting it in blue), make the old gallery settings popup work by letting the user edit the gallery shortcode directly (for testing).

comment:7 nacin22 months ago

  • Type changed from enhancement to task (blessed)

comment:8 azizur21 months ago

  • Cc azizur added

comment:9 nacin20 months ago

Whatever happened here?

comment:10 nacin20 months ago

Last edited 20 months ago by nacin (previous) (diff)

comment:11 nacin20 months ago

  • Milestone 3.5 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #21815.

comment:12 nacin20 months ago

  • Milestone set to 3.5
  • Resolution changed from duplicate to fixed

Oops, this is fixed — in the sense that the preview in the editor is improved. #21815 was the underlying "view" functionality that made that possible.

Note: See TracTickets for help on using tickets.