We've written a plugin to the Xinha text editor to handle footnotes. You can take a look at: http://www.nicholasbs.com/xinha/examples/Newbie.html
In order to handle some problems with the way Webkit and IE handle links at the end of lines (there's no way to use the cursor to get out of the link on the same line) we insert a blank element and move the selection to that, than collapse right. This works fine in Webkit and Gecko, but for some reason moveToElementText is spitting out an Invalid Argument exception. It doesn't matter which element we pass to it, the function seems to be completely broken. In other code paths, however, this function seems to work.
To reproduce the error using the link above, click in the main text input area, type anything, then click on the yellow page icon with the green plus sign, type anything into the lightbox dialog, and click on Insert. An example of the code that causes the problem is below:
if (Xinha.is_ie)
{
var mysel = editor.getSelection();
var myrange = doc.body.createTextRange();
myrange.moveToElementText(newel);
} else
{
editor.selectNodeContents(newel, false);
}
The code in question lives in svn at: https://svn.openplans.org/svn/xinha_dev/InsertNote
This plugin is built against a branch of Xinha available from svn at: http://svn.xinha.webfactional.com/branches/new-dialogs