[Project_owners] <editor> in Thunderbird not working

Thomas Schmid schmid-thomas at gmx.net
Thu Jan 3 14:03:28 PST 2008


Hi,

I want to use an "editor" instead of a textbox. But I am experiencing a 
strange behavior.
The following code runs smoothly in Firefox. But for some reason it does 
not work with Thunderbird.

What is wrong with this code? Why isn't it running with Thunderbird?
Has anyone experienced a similar issue?

Thanks

Thomas


<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<!DOCTYPE window >
<window id="yourwindow" 
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
<script type="text/javascript">
<![CDATA[

function makeEditable()
{
   var editor = document.getElementById('content-frame');

   editor.makeEditable('html', false);

   var htmlEditor = editor.getHTMLEditor(editor.contentWindow);
   htmlEditor = 
htmlEditor.QueryInterface(Components.interfaces.nsIPlaintextEditor);

   htmlEditor.insertText("Test");
}

]]>
</script>
<vbox flex="1">
<editor type="content-primary" id="content-frame" editortype="html" 
src="about:blank" flex="1"/>
<button label="Edit" oncommand="makeEditable();"/>
</vbox>
</window>



More information about the Project_owners mailing list