Mark McNally wrote:
Cheers mate thats got me going in the right direction now, all I need to
know now is, how do I set the ID for the image when the tag is inserted by
midas ? ?

Or alternatively can I "Select" the image and set its Attributes using DOM ?
? been trying to play around with this one n jus keep being told, that the
object doesn't support this property


Hi Mark,


You're wright, Midas doesn't insert an ID attribute.
What you should do instead is, after inserting your image, select the image, then retreive the selection and its range object the out of the range get the image element. You can now set the align attribute of this image element.


See also my previous answer to Fabrice Esti�venart in this mailing-list to know how to get the range object.

var midasWindow = document.getElementById('editor_widget_ID').contentWindow;
var midasDocumentBody = midasWindow.contentDocument.body;
var range = midasWindow.getSelection().getRangeAt(0);
var imgElement = range.selectNode(midasDocumentBody);
imgElement.setAttribute('align', 'center');

Cheers,

Daniel




Reply via email to