You are not logged in.
I'm writting a plugin that will allow me to enter comments into text inside the xinha editor. I do this by using a mix of php and AJAX calls. Essentially, I select some text in the editor, press the "Comments" button and an ajax call is made to generate the comment, display whatever needs to be displayed in the screen (in my case, a box to enter comments) then I call back another function in my xinha comments plug in that does 2 things:
1) encloses the selected text in a span tags like:
<span id=comment_<comment_id> style="background-color: yellow;">...</span>
2) Adds an image after the span to load the comment:
<img id=comment_<comment_id> onmouseover="onmouseover_load_comment(<comment_id>);" onmouseout="onmouseout_unload_comment(<comment_id>);" src="img.gif">
The idea behind this is that I can then display what the user entered comments in an html page, override the onmouseover_load_comment and onmouseout_unload_comment functions so that the comments are displayed. As an extra, I capture double-click events to the image and make another ajax call so that I can display and update the comment while editing the document.
I don't have any problems when displaying the document in HTML format, however when I'm editing the document and the user hovers over the images, I get a javascriopt error. I understand the reason for this error is that it is trying to call the functions with in the editor's iframe, and those functions are not declared. My question, simply, is there any way to include these functions (they would be empty functions) in the editor's iframe so that I don't get that error?
Thank you for any help.
German Kalinec
Offline