Hi,
I'm trying to allow people to drag and drop elements from the surrounding web page in to CKEditor. This functionality is already available in firefox but not in IE. What I plan to do is:
It's the last step which I am not quite clear about. Does anyone have any ideas on how to do this?
Thanks,
Joe
I'm trying to allow people to drag and drop elements from the surrounding web page in to CKEditor. This functionality is already available in firefox but not in IE. What I plan to do is:
Make element draggable.
Detect drop over CKEditor's iframe.
Adjust coordinates of drop so that if an element is dropped on the top left hand corner of CKEditor's iframe then the coordinates are 0x0.
Use the coordinates to find the correct range within the editor and add the element to it.
It's the last step which I am not quite clear about. Does anyone have any ideas on how to do this?
Thanks,
Joe
Re: How can I get the nearest range to a set of coordinates?
I am having exactly same requirement. Just wanted to check if anyone has achieved this functionality and how?
I am tried using insertHtml but it inserts the element where the cursor / caret is currently placed in the editor and not where (exactly on this line) the element is dropped!
Thanks in advance...
Regards,
Monish.
Re: How can I get the nearest range to a set of coordinates?
I don't know any method that will meet all your needs, but there's a very interesting one that may help: https://developer.mozilla.org/en-US/doc ... tFromPoint
e.g.:
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+