[wp-trac] [WordPress Trac] #11862: the_editor js bug when switching between Visual / HTML with multiple on page

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 16 00:09:54 UTC 2010


#11862: the_editor js bug when switching between Visual / HTML with multiple on
page
--------------------------+-------------------------------------------------
 Reporter:  sc0ttkclark   |       Owner:                
     Type:  defect (bug)  |      Status:  new           
 Priority:  normal        |   Milestone:  Future Release
Component:  Editor        |     Version:  2.9.1         
 Severity:  normal        |    Keywords:  needs-patch   
--------------------------+-------------------------------------------------

Comment(by chrisbliss18):

 I've been working on a patch for this issue, and I'm at a point where I
 need to get a sanity check. While I am certain that the code can be
 updated to make the function work properly with multiple instances, I'm
 not so certain that such a patch would ever be accepted into core.

 I've attached the working copy of my patch as it stands currently as well
 as a brief plugin that simply adds a second instance of the_editor to the
 posts and pages editors. Using these together will allow for testing of
 this idea.

 The current patch solves the problem as Scott described it while also
 exposing the level of work required to get this solution properly coded.
 The patch allows for more than one instance of the editors to coexist with
 the HTML and Visual tabs working as expected.

 The following are known issues with the current patch:
  * The "Insert into Post" media upload feature always adds to the first
 editor.
  * The HTML quick links always use the last editor.

 There are some additional issues that are related to use. For example, the
 the_editor function does not handle generating the table that creates the
 bottom part of the editor which contains the resize handle. This means
 that there are additional coding needs beyond just using the_editor. This
 table is also styled in such a way that using matching IDs and classes for
 the table structure is all but necessary to get the same look, this causes
 issues with the word count JS code.

 Due to these issues, I'm wondering if my efforts wouldn't be better spent
 on creating a patch that duplicates the functionality of the_editor but
 does so in a way that doesn't affect any of the code and styling that
 the_editor currently uses. After a time, the the_editor function could be
 deprecated and all the core code would use the new function.

 I'd like to get some thoughts on what other developers would like to see
 as it relates to this issue and what type of solution would be desired.

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


More information about the wp-trac mailing list