Range has been a part of the W3C specification for a while but has
been a bit tricky to work with because of total lack of IE support. IE
however has it's own TextRange implementation.

I've created a new MooTools Native that provides a unified way of
working with ranges and selections. I figured this would be a create
complement to Element.Forms which works with ranges and selections in
input boxes. This Range works with the DOM.

http://clientside.svn.calyptus.se/JavaScript/Native/Range.js
http://clientside.svn.calyptus.se/JavaScript/Native/Selection.js

The Selection API should probably add support for the new HTML 5
specification which also covers multiple range selections (no browser
supports this yet though).

This new native opens up possibilities to create various extensions to
ranged such as DOM modifications:

http://clientside.svn.calyptus.se/JavaScript/Native/Range.Edit.js

This in turn can be used to create WYSIWYGs using ContentEditable
without the messing ExecCommand API:

http://clientside.svn.calyptus.se/JavaScript/Editable/Editable.js
http://clientside.svn.calyptus.se/JavaScript/Editable/Editable.Exec.js

While Range.Edit and Editable aren't fully complete yet... Range and
Selection has been stable for about a year now. They provide the basis
for a lot of new possibilities so it could be worth adding these to
MooTools More. Thoughts?

Reply via email to