Hello,
first of all the tools with which I encounter the problem:
Browser: Firefox 2.0.0.6
FCKeditor: 2.4.3
currently I implement a plugin, which allows the user to insert pictures, which were previously uploaded to the server through a feature outside of the FCKeditor. The plugin doesn't only offer the insertion of pictures, but the ability to change an already inserted picture in the editor. And here lies the problem. The thing I have in mind to change/insert the picture should be something like this:
1a. Select the already inserted image in the editor (for image change)
or
1b. Click on the place where the image should be inserted (for simple image insertion)
2. Click my image plugin button
3. Choose (another) image and click OK
4. The new image is inserted into the editor
5. The new image automaticly gets the focus (is selected) in the editor
Steps 1-4 work, but I can't figure out how to set the focus to the newly inserted image (for both cases).
In the case of the image change, there is the problem that the border, which indicates the selection of the image, remains, even when the new image is inserted. The border disappears after I click into the editor area, or do a switch from EditorView to SourceView and back.
The code to insert the image is the following:
I have looked into InsertHtml, an tried various things there, to get the focus to the newly inserted element, but without any success.
So my questions are:
1. Is there a way to refresh the editor area through a JavaScript-Method (I haven't found anything by browsing the forum/docs/src), to get rid of the old selection of the previous image
2. How can an element be selected in the editor area through JavaScript
If you want to know anything else, which might be important, let me know.
Thanks for your Help
thomas
first of all the tools with which I encounter the problem:
Browser: Firefox 2.0.0.6
FCKeditor: 2.4.3
currently I implement a plugin, which allows the user to insert pictures, which were previously uploaded to the server through a feature outside of the FCKeditor. The plugin doesn't only offer the insertion of pictures, but the ability to change an already inserted picture in the editor. And here lies the problem. The thing I have in mind to change/insert the picture should be something like this:
1a. Select the already inserted image in the editor (for image change)
or
1b. Click on the place where the image should be inserted (for simple image insertion)
2. Click my image plugin button
3. Choose (another) image and click OK
4. The new image is inserted into the editor
5. The new image automaticly gets the focus (is selected) in the editor
Steps 1-4 work, but I can't figure out how to set the focus to the newly inserted image (for both cases).
In the case of the image change, there is the problem that the border, which indicates the selection of the image, remains, even when the new image is inserted. The border disappears after I click into the editor area, or do a switch from EditorView to SourceView and back.
The code to insert the image is the following:
if(src != "") { FCK.InsertHtml("<img src='"+src+"' border='"+border+"' alt='" + alt + "'>") ; } else { FCKSelection.Delete() ; }
I have looked into InsertHtml, an tried various things there, to get the focus to the newly inserted element, but without any success.
So my questions are:
1. Is there a way to refresh the editor area through a JavaScript-Method (I haven't found anything by browsing the forum/docs/src), to get rid of the old selection of the previous image
2. How can an element be selected in the editor area through JavaScript
If you want to know anything else, which might be important, let me know.
Thanks for your Help
thomas
Re: Changing a pre selected image through own plugin
I remember that such problem used to exist, at least with tables, but I don't know right now (I guess that it's still present), and my tests might differ, so it's better that you do the tests yourself.
Re: Changing a pre selected image through own plugin
Same problem here. Maybe I will investigate this problem a bit more (maybe I do a bug report), when I have time. But currently it does not have such a high prio, because there are other things to develop first. The basic functionality works, and I found a way to do a refresh through FCK.SetHTML().
Thanks for your reply
thomas