Put simply, detaching Whizzywig leaves traces of itself behind when switching between editors or disabling it.
Text in the original textarea is changed to a greenish color. The textarea's zIndex is overridden. An event handler is attached to the form's submit handler (it does nothing if no instances exist though).
I suggest we store these values the same way we store the original width in #651490: Whizzywig width and restore them when detaching the editor.

Detaching (and attaching) is also a bit "out of sync" with how Whizzywig's own routine does it before submitting the form (syncTextarea()). For example: After version 56, XHTML is the default output so we don't need to check if there's a global get_xhtml() function in whizzywig-56.js. The IE fix for anchors was also removed or moved somewhere else in that version, so we should no longer need to do that either.
Neither whizzywig.js or whizzywig-56.js handle synching correctly if the editor is detached while in source mode. Whizzywig itself does this by passing the original textarea contents to it's WYSIWYG mode DOM tree and back to the original textarea again, via tidyH(). I suggest we emulate this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TwoD’s picture

Status: Active » Needs review
FileSize
6.5 KB

This patch should apply to all -dev versions, but for some reason my D7 installation has gone nuts so I can't test it there.
Tested in FF and Chrome on D6 so far.
Needs to be combined with patch from #922436: Wizzywig: Uncaught TypeError: Cannot read property 'document' of null in Chrome to work in Chrome.

Ooops, missed a comment in whizzywig.js. Will probably be an update to this patch so I'll stick it in later.

TwoD’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
6.51 KB

Added missing comment, otherwise seems to work great so, RTBMe! ;)

sun’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for reporting, reviewing, and testing! Committed to all branches.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.