- Add
addEventListener
which supportsselectionchange
event. #9 - Add
isDocumentActive
: check if document is focused and active. - Add
focusDocument
: make document focused and active. - Add
remove
namespace which includesPrevWord
,NextWord
,Selection
methods. Using these methods you can remove document objects. - Add
moveCursorTo
namespace which includesPrevCharacter
,NextCharacter
,PrevLine
,NextLine
,PrevWord
,NextWord
,PrevParagraph
,NextParagraph
,LineStart
,LineEnd
,DocumentStart
,DocumentEnd
methods. Using these methods you can move cursor over the document. - Add
select
namespace which includesAll
,PrevCharacter
,NextCharacter
,PrevWord
,NextWord
,PrevLine
,NextLine
,PrevParagraph
,NextParagraph
,TextBetweenCursorAndLineStart
,TextBetweenCursorAndLineEnd
,TextBetweenCursorAndDocumentStart
,TextBetweenCursorAndDocumentEnd
methods. Using these methods you can select text content in document. #3 deleteSelection
: BREAKING CHANGES: moved intoremove.Selection
.pressOn
: BREAKING CHANGES:SelectAll
moved toselect.All
. Added:Home
,End
,Bold
,Italic
,Underline
.Character
,Delete
,Backspace
,ArrowLeft
,ArrowRight
,ArrowUp
,ArrowDown
can accept optional modificator flag (Ctrl or Shift).
- WARNING: this library may no longer work after July 2021. See
README
for more. #10
getWordElements()
: fixed a bug when text of line with different formatting not handled correctly. BREAKING CHANGES: now it will return array of arrays. See documentation for more. #4getSelection()
: fixed a bug when text of line with different formatting not handled correctly. BREAKING CHANGES: now it will return array of arrays. See documentation for more.getCaret()
: BREAKING CHANGES:positionIndex
renamed topositionIndexRelativeToWord
. See documentation for more.getCaretWord()
: fixed a bug when this method not worked with other languages but English. WARNING: it still not work with languages which doesn't have upper and lower symbols (Chinese, Japanese, Arabic, Hebrew, etc.).getLinesTextElements()
,getLinesText()
,getCaret()
: fixed a bug when text of line with different formatting not handled correctly.- Added documentation about known limitations.
- Improve documentation for
getTextEventTarget()
method.
- Add
pressOn.PrintDialog
: call print dialog.
- Add
pressOn
namespace which includesCharacter
,Space
,Delete
,Backspace
,Enter
,Tab
,ArrowLeft
,ArrowRight
,ArrowUp
,ArrowDown
,Undo
,Redo
,SelectAll
methods. Using these methods you can imitate physical key presses. - Add
typeText
: type text at current caret position. - Add
isTextSelected
: indicates what text is selected (at least on one line). - Add
deleteSelection
: remove current selection. - Add type definitions.
Complete refactoring of old code. Now this library can be used as both IIFE and CJS. Starting from 2.0.0
version the code have nothing common with 1.x.x
versions, excepts some core concepts.
- Remove
selectedText
. - Add
selectionText
: array (mapped to lines count) of selected text. - Add
selectionRect
: array (mapped to lines count) ofDOMRect
of selected text. - Add
selectionNode
: array (mapped to lines count) ofHTMLElement
of selected text.
Forked from JensPLarsen/ChromeExtension-GoogleDocsUtil.
- Added NPM support.