[wp-trac] [WordPress Trac] #26959: Incorporate preview of inserted galleries in the visual editor using a new version of the wpview tinymce plugin

WordPress Trac noreply at wordpress.org
Tue Mar 4 04:55:18 UTC 2014


#26959: Incorporate preview of inserted galleries in the visual editor using a new
version of the wpview tinymce plugin
-------------------------+-----------------------------
 Reporter:  gcorne       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.9
Component:  Editor       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  ui, javascript
-------------------------+-----------------------------

Comment (by gcorne):

 [attachment:26959-06.patch 26959-06.patch] includes a substantial
 reworking of the core of {{{mce-view.js}}}

 * Switches from using Backbone Views to a Backbone-like View that doesn't
 create a reference to a DOM node. Instead, when data is fetched, all
 tinymce editor instances with the {{{wpview}}} plugin enabled are searched
 for view placeholders and the contents of the placeholders are replaced.
 Undo/Redo works much better as does copying and pasting ranges containing
 one or more views.
 * The original text that is replaced by the view is stored as a URI
 encoded data attribute and decoded when switching to the text
 representation. This is more robust because it is much more difficult for
 the original text version of the view to be lost.
 * {{{wp.mce.views}}} was reworked to try and make the separation between
 registering a view and using the view clearer.

 In the {{{wpview}}} plugin, some logic was added to remove empty <p>
 elements via backspace/delete when the <p> is the {{{firstChild}} and
 before a {{{wpview}}}. @azaozz also made some adjustments to how the view
 clipboard works, how padding is added when a view is the {{{firstChild}}}
 or {{{lastChild}}}, and how the conversion from html back to text works.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26959#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list