hi
im running into a couple problems that i would really like some help with, i have looked through the forums and in google but not found answers to these issues so far.
1. a cross-browser solution to get the currently selected text and any elements in the selection.
something i can call from inside a plugin's iframe to get what i need. Selections could be:
some text
<img src="image.jpg" alt="" />
some text with <img src="image.jpg" alt="" />
var selection = oEditor.window.$.window.getSelection(); works if only text is selected but breaks on images (it doesnt include the image in the selection).
2. a solution to stop ckeditor from breaking flash <object inserts, (its removing params and the <embed part) i have tried putting the <object tag in the protected code thing but then you cant see it in the editor anymore, and that is something that needs to stay so the user can move it arround when needed. wrapping it in a div looked nice but again the user cant drag a div arround.
UPDATE for those running into the same problem i have solved this:
Add a div arround the contents of the object like this:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="300" height="200"> <div class="protectedCode"> <param name="movie" value="flash.swf"> <param name="quality" value="high"> <param name="wmode" value="transparent"> <embed src="flash.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="200"></embed> </div> </object>
then add the div to the protectedSource in config.js like this:
config.protectedSource.push( /<div class="protectedCode">[\s\S]*?<\/div>/g );
3. how to position a new dialog plugin, is there some kind of position style you can pass with the dialog when creating it from plugin.js ? or a way to move it after its been called?
Help would be very much apreciated as these are the last things i need to get working for this project ....