Is there a way that you can do a file drag and drop operation into the DOM and detect the cursor position/range in the DOM where the mouse pointer is during the drop operation?
I can easily capture the Drop and get the file and content, but I can't seem to figure out how to drop custom HTML markup into the page at the drop location. The drop provides a mouse position, but the question is how to convert that (or anything else) into a cursor position and range into which I can paste a new link for the file (after I've saved it dynamically).
My use case is that I'm using Ace Editor (or any contentEditable area) and am trying to drag a file into the document at the location the mouse cursor is dropped. I then want to capture the file, and insert a link that references the capture file data which in this case is captured using the file API and stored on disk using a Web Browser control. I can get everything to works except for detecting the drop location in my text document.
So, any ideas how to acquire a selection range from a drop operation? I have the mouse coordinates, but I'm not sure how to correlate those to a text position from which a range can be created to insert my link into.