inserting text into yui editor from a thickbox
| Project: | YUI Rich Text Editor |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
I am using fileframework and would like to embed files in YUI editor. Fileframework does not support this yet but I have managed thus far to get the [file ] tag (text as far as yui is concerned) to insert into the editor from the embed file popup thickbox that fileframework provides.
The problem I have is with IE. In firefox everything works great. Text is inserted in the correct place. In IE when the thickbox launches to insert the file, I think the text position in YUI is lost. So text is inserted at the beginning of the YUI editor (position 0), no matter where the cursor was placed before clicking on the embed file icon.
Here is the code I have for the fileframwork file_embed.js file:
var myEd = YAHOO.widget.EditorInfo._instances;
var myEditor = myEd['edit-body'];
if (myEditor) {
try {
tb_remove(); // close the thickbox
myEditor.focus();
myEditor.execCommand('inserthtml', content); // content is a text variable provided by fileframework with the [file] tag
}
catch (e) { alert("couldnt insert content" + e); }
} Any help much appreciated!
