Constructor
new Highlighter(textarea, tokens, color)
Create a Highligher
- Source:
Parameters:
Name | Type | Description |
---|---|---|
textarea |
node
|
The textarea the highlighter will be attached to |
tokens |
Array.<string>
|
The tokens (character sequences) to highlight |
color |
string
|
The 6 digit hexcode color string used for highlighting tokens |
Methods
_isWholeWord()
_isWholeWord - private wrapper of isWholeWord
- Source:
- See:
_offset(targetNode, offsetNode) → {object}
_offset - returns the absolute position and inner size of an element
- Source:
Parameters:
Name | Type | Description |
---|---|---|
targetNode |
node
|
The element whos absolute position we want to calculate |
offsetNode |
node
|
The element whos position we offset by the targetNode |
Returns:
- Type:
-
object
- An object containing the size and coordinates measured in pixels