[wp-trac] [WordPress Trac] #21812: Make custom TinyMCE views easier to implement

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 17 19:06:06 UTC 2012


#21812: Make custom TinyMCE views easier to implement
----------------------------+-----------------------
 Reporter:  koopersmith     |       Owner:  azaozz
     Type:  task (blessed)  |      Status:  assigned
 Priority:  high            |   Milestone:  3.5
Component:  TinyMCE         |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |
----------------------------+-----------------------

Comment (by koopersmith):

 Based on [https://irclogs.wordpress.org/chanlog.php?channel=wordpress-
 dev&day=2012-09-17&sort=asc#m457873 a conversation with azaozz in IRC],
 this is how we're going to proceed:

 On the TinyMCE side, you can create a preview type. Each preview can have
 multiple instances within MCE. TinyMCE requires that some sort of preview
 html be provided on render, so we will handle the creation of placeholder
 divs. The external JS will either immediately replace them, or replace
 them once their content has loaded (the latter will be especially useful
 when using AJAX requests).

 1. A preview object provides a regex, which is used to scan the content
 periodically.

 2. When content is replaced, it triggers a preview-provided callback that
 will either replace the div on the spot, or leave it as-is and replace it
 at a later point.

 3. When MCE needs to generate the text representation, it will either use
 a data attribute on the preview or trigger another callback (if provided).
 It will default to using the original text.

 azaozz is working on this, and barring any blockers, will have a patch
 later today.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21812#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list