-
Notifications
You must be signed in to change notification settings - Fork 366
New Features In One Point Three
Character and word-based Range and Selection manipulation, relative to the visible text on the page. This is a major new module with some powerful features:
-
moveStart(),moveEnd(),move()andexpand()Range methods inspired by IE'sTextRangeobject - Page text search, using a string or a regular expression
- Character offset-based selection save and restore, immune to changes in
innerHTML - Selection snap to words
- Cross-browser
innerTextimplementation - Selection and range trimming
API to allow creation, removal, serialization and deserialization of highlights within a page. It uses either character offsets relative to the page's textContent or the TextRange module's character-based features to keep track of highlight positions. This should be an improvement on the approach of the previous, unofficial Highlighter module, whose performance worsened exponentially as the number of highlights increased.
The file name in the latest Rangy build is now rangy-classapplier.js rather than rangy-cssclassapplier.js.
-
AMD support
-
Rangy's main entry functions are now much more permissive. For example,
rangy.createRange()andrangy.getSelection()and all related methods now accept aWindow,Documentor iframe element -
Added
setStartAndEnd()convenience method to Range -
Added
getBookmark()andmoveToBookmark()methods to Range -
Added new
useExistingElementsoption to class applier options object (issue 111) -
Selection
setSingleRange()now accepts an additional second parameter,direction -
Every
backwardsBoolean API parameter replaced with stringdirectionparameter -
Added
applyToRanges(),unapplyToRanges()andtoggleRanges()to class applier -
Added
removeEmptyElementsoption to class applier. When true, empty elements generated by (or appearing to be generated by) the applier are removed when applying or unapplying to a range or selection -
Added
getNativeTextRange()method to selection -
Module loading improved: module script include order no longer matters, so long as rangy-core.js comes first. Modules now initialize automatically if Rangy has initialized. Also, the console now provides more helpful warning messages when modules fail to load.
-
New config option to allow control over whether Rangy automatically initializes when the page loads
-
Build script now works on non-Windows platforms
- issue 75
- issue 80
- issue 92
- issue 99
- issue 101
- issue 104
- issue 107
- issue 108
- issue 111
- issue 174
- issue 176
- issue 177
- issue 184
- issue 186
- issue 188
- issue 189
- issue 190
- issue 199
- issue 202