Toggle FCKeditor on and off for Correspondence

Most of our staff have decided they like the plaintext editor
preference better than the WYSIWYG editor. (One reason is because the
browser’s spellchecker is better than the Rich text editor.)

However, once in a while, they need to paste something with specific
formatting, like chunks of code with indenting, and for that the HTML
editor works better. So I wanted a way to let staff easily switch or
revert from plaintext to the FCKeditor.

The code to swap plaintext for Rich text editor is below.

Does anyone have any Javascript for going in reverse – from FCKeditor
to plaintext textarea? There are some entity transformations that take
place going from plain to rich that need to be reversed, and hidden
html elements that get attached to the DOM that need to be removed.

— /usr/share/request-tracker3.8/html/Elements/HeaderJavascript
2009-06-16 14:57:46.000000000 -0700
+++ HeaderJavascript 2009-08-24 16:57:28.000000000 -0700
@@ -54,27 +54,49 @@

-% if ( RT->Config->Get(‘MessageBoxRichText’, $session{‘CurrentUser’}) ) {

-% }
+% if($m->{‘top_path’} =~ /(Update.html)/) { # try to only do this on
Comment/Reply page
+% # if FCK is OFF in preferences, give option to turn it on
+% if (! RT->Config->Get(‘MessageBoxRichText’, $session{‘CurrentUser’})) {
+
+% } # end had WYSIWYG editor OFF in preferences
+% } # end was on Update.html