Hello.
I have a iframe plugin that generates a link from a cms content list. I want to add the link around the selected text when the ok button is clicked. It all works, except i can't get the selected text.
I have tried using the answer supplied here:
http://stackoverflow.com/questions/2385609/getting-selected-text-win-ckeditor-plugin
so like this:
var okListener = function(ev) { console.log(CKEDITOR); var mySelection = CKEDITOR.editor.getSelection(); if (CKEDITOR.env.ie) { mySelection.unlock(true); selectedText = mySelection.getNative().createRange().text; } else { selectedText = mySelection.getNative(); } console.log(selectedText);
Re: Getting selected text in an iframe plugin
I think you should look at - http://dev.ckeditor.com/ticket/8435#comment:3. User had similar problem in this ticket.