Hi.
I'm trying to adjust the Insert Link dialog to be able to generate links so that if a link is marked to be open in a new window but the user has disabled javascript or popups then it just work like a normal link.
I wanna change the generated links from:
<a href="javascript:void('http://google.com','','options...')">
to
<a href="http://google.com" onclick="window.open(...
It doesn't seem hard, I already have done it and it works fine, BUT (testing for the moment just with IE6), when the user now clicks in the link while in edit mode the onclick is executed and a new window opens
This doesn't happen with a link that just has been changed from a normal link to a link with onclick, you must change from HTML mode to Source mode or reload the new data from db.
I've tryed to catch the onclick event at the body level, but it gets there AFTER it has executed the onclick of the link.
So for now the only solution that I've found is to change with a RegExp all the onclick= to FCKonclick= (before passing the data to FCKeditor and revert the changes after editing is done) and then change the code in the Insert Link window to use this attribute.
I don't think that this is very clean,
Is there a better solution to this problem or should just go ahead with these changes?
Thu, 10/06/2005 - 09:02
#1