CKEditor 3.0 Plugins - Retrieving Selected Text / HTML

I have a plugin in an old FCKEditor that I would like to rebuild. I saw an example that used the iFrame code. I have a button defined and working, I get a dialog, but I can't figure out how to get the selected text / html in the dialog so that I can manipulate it.

My plugin is a rough MS File dialog box. When the user clicks on the file that is listed (or the html page in the list), my code updates the link textbox with the url to be used in the HREF property ... I can't find anything that tells me how to get highlighted text from the editor and replace it with the edited code as soon as my dialog works ... Any suggestions? I am in between with this, so if you post code please comment on what is going on so I can understand. Thank.

+2


source to share


1 answer


It seems my cookies are cleared ... Here is an update. I am using the following code:

CKEDITOR.instances.editor1.insertHtml('<a href=\x22www.google.com\x22>'
CKEDITOR.instances.editor1.getSelection().getNative() + '</a>');

      

I get the relevant code pasted into the CKEditor instance in FireFox, but in IE (6.0 here at the office) it sends [object Object] and the original url displays:



<a href="www.google.com">[object Object]</a>

      

Is there some problem that I am not seeing? I'm on CKE3.0 and will be downloading 3.01, but their changelog doesn't seem to have anything to do with it, so I'm not sure if it's a bug or not.

+1


source







All Articles