-
Notifications
You must be signed in to change notification settings - Fork 366
New Features In One Point Three
Tim edited this page Jul 18, 2014
·
10 revisions
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 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.
- 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 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 - Module loading improved: module script include order no longer matters, so long as rangy-core.js comes first. Also, the console now provides more helpful warning messages when modules fail to load.
Issue 75, issue 80, issue 92, issue 99, issue 101, issue 104, issue 107, issue 108, issue 111