Class for monitoring / changing the selection (typically highlighted text) in a given window
Parameter | Type | Description |
---|---|---|
win | Window | The window to monitor/adjust the selection on. |
Function to collapse (clear), the current selection
Parameter | Type | Description |
---|---|---|
beginning | Boolean | Indicates whether to collapse the cursor to the beginning of the selection or end. |
Return the parent element of the current selection which is of type tagName (or one of the other specified tagName)
Parameter | Type | Description |
---|---|---|
tagName | String | The tag name to determine if it has an ancestor of. |
Retrieves a bookmark that can be used with moveToBookmark to reselect the currently selected range.
Function to locate a parent node that matches one of a set of tags
Parameter | Type | Description |
---|---|---|
node | DomNode | The node to inspect. |
tags | String[] |
Retrieves the selected element (if any), just in the case that a single element (object like and image or a table) is selected.
Return the html text of the current selection or null if unavailable
Return the text (no html tags) included in the current selection or null if no text is selected
Check whether current selection has a parent element which is of type tagName (or one of the other specified tagName)
Parameter | Type | Description |
---|---|---|
tagName | String | The tag name to determine if it has an ancestor of. |
This function determines if 'node' is in the current selection.
Parameter | Type | Description |
---|---|---|
node | undefined |
Function to determine if a node is one of an array of tags.
Parameter | Type | Description |
---|---|---|
node | DomNode | The node to inspect. |
tags | String[] |
Moves current selection to a bookmark.
Parameter | Type | Description |
---|---|---|
bookmark | Object | This should be a returned object from getBookmark(). |
Function to delete the currently selected content from the document.
clear previous selection and select element (including all its children)
Parameter | Type | Description |
---|---|---|
element | DOMNode | The element to select. |
nochangefocus | Boolean |
Optional Boolean indicating if the focus should be changed. IE only. |
clear previous selection and select the content of the node (excluding the node itself)
Parameter | Type | Description |
---|---|---|
element | DOMNode | The element you wish to select the children content of. |
nochangefocus | Boolean |
Optional Indicates if the focus should change or not. |