Some functions to make textarea manipulation easier
- pos Index to place caret at
- options
- range Characters to select (default: 0)
- options
- ofLine Get index of caret on its line (default: false)
- returns Index
- returns Absolute XY position of caret in pixels as { top:, left: }
- returns Line height in px
- pos Index within the line to get. (default: line of current caret position)
- options
- getBeforeOnly Get all text on line before pos (default: false)
- getAfterOnly Get all text on line after pos (default: false)
- When both options are true, will return ""
- returns Text on one line
- text String to insert
- pos Index to insert at (absolute). (default: current caret position)
- options
- caretAtOriginal Leave cursor at original position after inserting (default: false)
- adjustCaret Adjust cursor position after text is inserted (default: 0)
See header of textarea-plus.js
for complete license.