I have discovered some usefull attributes of CKEDITOR selection object (get via editor.getSelection()
editor.getSelection()
editor.getSelection()):
e.getSelection().getRanges()[0].startOffset
e.getSelection().getRanges()[0].endOffset
e.getSelection().getRanges()[0].startOffset
e.getSelection().getRanges()[0].endOffset
This returns the start and end position of the selected text - but only in relation to startContainer (element) and endContainer (element). I would like to get the absolute position in relation to the whole document or something else to identify the selected html (some intern id of the start or end element?). I would like to read this attributes on the server side and modify the selected html there. Is there some universal way to move the information about position of the selected text from the client side to the server side?
Maybe this: e.getSelection().getRanges()[0].startContainer.getUniqueId() - but is it really some universal attribute, which I could read on the server-side too?
Or this: e.getSelection().getRanges()[0].startContainer.getAddress() - and then find it via DOM XML?
Thanks a lot.