Adam,
Open it and go to Line 373: function MozillaSelection(document) {
It contains everything we need to get and set the focus using Mozilla browsers and start/end integers. We've figured out almost everything except the final piece of the puzzle - calling focus to display the cursor at its new position.
Have a look at the code below and see if you can figure out the final piece:
var editor1 = document.getElementById('');
var editwin = editor1.GetWindow();
var editwinsel=editwin.getSelection();
//get the range
var range;
try { range=editwinsel.getRangeAt(0); } catch (e) { }
//notify the start and end offsets
alert(range.startOffset);
alert(range.endOffset);
and how to collapse the range and set the focus:
//collapse to a single point
try { editwinsel.collapseToStart(); } catch (e) {}
try { editwinsel.collapseToEnd(); } catch (e) {}
//and set the focus
editwin.focus();
//get the container
var startNode = range.startContainer;//This is probably where the error is
And this resets the range to absolute positions 15 and 30
//reset the range positions
range.setStart(startNode,15);
range.setEnd(startNode,30);
//report the new range:
alert(range.startOffset);
alert(range.endOffset);
??? How to now set the focus in the window?
Can you give us the answer, please?