Commit graph

20 commits

Author SHA1 Message Date
Roan Kattouw 27ddd1263f In selectNodes(), also set globalRange for fully-covered nodes. There is no sane value for range in this case, but there sure is a sane value for globalRange so we might as well return it. I also use this in my prepareRemoval() fixes in my next commit 2011-11-16 19:02:23 +00:00
Roan Kattouw 9060cd6161 Fix stupid mistake that broke traverseLeafNodes() in IE 2011-11-16 12:51:31 +00:00
Trevor Parscal 4f1f6699ee Tweaks to make jshint happy 2011-11-15 18:42:34 +00:00
Trevor Parscal 79ef19da42 Fixed documentation and use of es.arrayIndexOf to match the actual API of $.inArray (value, array, fromIndex). Renamed function to inArray to reduce confusion about how the function works. 2011-11-15 18:17:26 +00:00
Trevor Parscal a4e3b3922d Using jQuery.inArray implementation of indexOf instead of our own
Fixed a wrong class name bug
2011-11-15 17:54:52 +00:00
Roan Kattouw eff198ff1d Move .indexOf() from es.DocumentModelBranchNode to es.DocumentBranchNode and use it in .traverseLeafNodes() 2011-11-15 16:24:33 +00:00
Roan Kattouw ec8e92029a Followup r103161: make reverse work 2011-11-15 13:23:04 +00:00
Roan Kattouw f7ef40fb7a Rewrite traverseLeafNodes() with an iterative traversal, and add support for from. Support for reverse is not implemented yet. 2011-11-15 12:55:31 +00:00
Roan Kattouw fee2d48b2b Add very basic implementation of traverseNodes(), with tests. This doesn't respect the from parameter (so tests 3-6 fail); I will rewrite it from recursive to iterative so it can support that. 2011-11-15 11:12:06 +00:00
Trevor Parscal a7c1524fe0 Added empty method to es.DocumentBranchNode called traverseLeafNodes 2011-11-15 01:31:46 +00:00
Trevor Parscal 2494c40297 Moved transaction processing code to new class, es.TransactionProcessor 2011-11-14 23:04:36 +00:00
Trevor Parscal 713a80596d Added es.DocumentLeafNode, which like es.DocumentBranchNode is a mixin-like class (we may want to switch to using a more natural composition mechanism than es.extendClass in the future) - now es.DocumentNode also has an abstract method called hasChildren which returns a boolean and can indicate if a node is a leaf or a branch. 2011-11-10 19:26:02 +00:00
Roan Kattouw 14b56c1202 Fix selectNodes(), can't recurse into leaf nodes because they aren't DocumentBranchNodes and don't have the selectNodes function. The pattern of certain functions just not existing for leaf nodes is starting to annoy me, I'll discuss this with Trevor. 2011-11-10 13:51:01 +00:00
Roan Kattouw aa7a6e2605 Add globalRange property to the output of selectNodes(), which translates the range property to be relative to the root rather than to the node. Update tests for this, and fix the test case numbering for selectNodes 2011-11-10 13:15:55 +00:00
Roan Kattouw 69d2fe7dfe Fix selectNodes() behavior for structural offsets (i.e. offsets between two openings/closings). There are no test cases for this yet but I'll write some after Trevor finishes his massive test data change 2011-11-09 21:15:01 +00:00
Roan Kattouw 124a36b942 Add a metric ton of (mostly generated) selectNodes tests, and change selectNodes a little bit to make them pass 2011-11-04 20:27:23 +00:00
Trevor Parscal fcb3644f35 Reorganized a few methods to reduce duplication, improved documentation 2011-11-04 17:07:44 +00:00
Trevor Parscal f327ebf39f Line breaks 2011-11-03 22:03:28 +00:00
Trevor Parscal 8058b454a5 Fixed some documentation 2011-11-03 21:52:06 +00:00
Trevor Parscal 764f2b0e65 Reorganized model nodes into branches and leafs 2011-11-03 21:48:40 +00:00