Helper function for canonicalizing a position inside a textfield in IE.
Deals with the issue that \r\n counts as 2 characters, but
move('character', n) passes over both characters in one move.
|
code » | ||||
Returns the place where the selection ends inside a textarea or a text input
|
code » | ||||
Returns the start and end points of the selection inside a textarea or a
text input.
Arguments:
Returns: !Array.<number>
An array with the start and end positions where the
selection starts and ends or [0,0] if it was unable to find the
positions or no selection exists. Note that we can't reliably tell the
difference between an element that has no selection and one where
it starts and ends at 0.
|
code » | ||||
Returns the start and end points of the selection within a textarea in IE.
IE treats newline characters as \r\n characters, and we need to check for
these characters at the edge of our selection, to ensure that we return the
right cursor position.
Arguments:
Returns: !Array.<number>
An array with the start and end positions where the
selection starts and ends or [0,0] if it was unable to find the
positions or no selection exists. Note that we can't reliably tell the
difference between an element that has no selection and one where
it starts and ends at 0. If getOnlyStart was true, we return
-1 as end offset.
|
code » | ||||
Returns the start and end points of the selection inside a textarea or a
text input.
Arguments:
Returns: !Array.<number>
An array with the start and end positions where the
selection starts and ends or [0,0] if it was unable to find the
positions or no selection exists. Note that we can't reliably tell the
difference between an element that has no selection and one where
it starts and ends at 0. If getOnlyStart was true, we return
-1 as end offset.
|
code » | ||||
Helper function for returning the range for an object as well as the
selection range
|
code » | ||||
Returns the selected text within a textarea in IE.
IE treats newline characters as \r\n characters, and we need to check for
these characters at the edge of our selection, to ensure that we return the
right string.
Arguments:
Returns: string
Selected text in the textarea.
|
code » | ||||
Return the place where the selection starts inside a textarea or a text
input
|
code » | ||||
Returns the selected text inside a textarea or a text input
|
code » | ||||
![]()
Sets the cursor position within a textfield.
|
code » | ||||
![]()
Sets the place where the selection should end inside a text area or a text
input
|
code » | ||||
![]()
Sets the place where the selection should start inside a textarea or a text
input
|
code » | ||||
![]()
Sets the selected text inside a textarea or a text input
|
code » | ||||
Helper function to determine whether it's okay to use
selectionStart/selectionEnd.
|
code » |