Hello all,
I want to insert an image in FCKEditor at the current cursor position.
I've been able to insert the image, but not at the current cursor postion using this:
I have a web page which contains the FCK editor. There is a Flex button on that page, which is calling the FCK.InsertHtml function. Everything is working okay, except that the image is getting inserted at the top line of the FCKEditor, not at the actual cursor position.
The browser I'm using is Firefox 3.0.8.
Can anyone suggest anything please ?
Regards,
Trish.
=================================================================================================
To further explain what I'm talking about I've written down this scenario here:
1. Type word "start" in FCK Editor, on 1st line.
2. Hit return a few times.
3. Type word "end".
4. Click on FCK Editor somewhere between words "start" and "end".
5. Click on Flex button to call the InsertHtml command.
Expected behaviour:
image should be in between words "start" and "end".
Actual behaviour:
image is displayed on top line of FCK Editor.
The "start" word is now on the 2nd line of the FCK Editor.
I want to insert an image in FCKEditor at the current cursor position.
I've been able to insert the image, but not at the current cursor postion using this:
FCK.InsertHtml("<span><IMG SRC=\"photo21.jpg\"></span>");
I have a web page which contains the FCK editor. There is a Flex button on that page, which is calling the FCK.InsertHtml function. Everything is working okay, except that the image is getting inserted at the top line of the FCKEditor, not at the actual cursor position.
The browser I'm using is Firefox 3.0.8.
Can anyone suggest anything please ?
Regards,
Trish.
=================================================================================================
To further explain what I'm talking about I've written down this scenario here:
1. Type word "start" in FCK Editor, on 1st line.
2. Hit return a few times.
3. Type word "end".
4. Click on FCK Editor somewhere between words "start" and "end".
5. Click on Flex button to call the InsertHtml command.
Expected behaviour:
image should be in between words "start" and "end".
Actual behaviour:
image is displayed on top line of FCK Editor.
The "start" word is now on the 2nd line of the FCK Editor.
Re: problem with insertHTML
Hello all,
I've been able to narrow down the problem a bit more.
What's happening is that when the end user clicks on the Flex button the FCKEditor is hidden, so as that a Flex popup can be properly displayed. When the end user selects an image, the popup disappears, and the selected image should be displayed at the last cursor position in the FCK Editor.
The problem seems to be caused by the FCKEditor being hidden. If I comment out the code for this, the selected image is inserted in the correct place in the FCK Editor. But if I do that then the Flex popup isn't displayed correctly.
The code I am using to hide the FCK editor is this:
I was looking at this question, which was raised on the FCKEditor forums in the past:
viewtopic.php?f=5&t=7545
in it suggests to do something like:
try {
var oEditor = FCKeditorAPI.GetInstance('editor') ;
oEditor.MakeEditable();
} catch(e) {}
I've tried this but the problem is still happening.
Can anyone suggest something please ?