Inez Korczynski
31585463ed
get rid of console.logs
2011-12-02 01:37:23 +00:00
Inez Korczynski
21d78b3c3e
getAnnotationsFromRange should return list of annotations even if there are elment offset in between of them
2011-12-02 01:36:12 +00:00
Inez Korczynski
874e8aa40a
Missing changes for FormatDropdownTool support
2011-12-02 00:02:16 +00:00
Trevor Parscal
380f016840
* Split the result of getAnnotationsFromRange to provide full, partial and all lists
...
* Fixed tools to use this data correctly
2011-12-01 23:25:56 +00:00
Inez Korczynski
2686b383d9
Added FormatDropdownTool, so now you can switch leaf nodes from paragraphs to pres for instance
2011-12-01 23:24:21 +00:00
Inez Korczynski
1db55a8242
Added pretty solid implementation of prepareLeafConversion method
2011-12-01 22:45:32 +00:00
Inez Korczynski
02f2e47e91
Very early version of convertLeafs method (still does not work perfect due to problems wiht selectNodes method)
2011-12-01 21:10:37 +00:00
Neil Kandalgaonkar
71542b45d7
no longer track selections in states. Also makes the 'combine' parameter obsolete
2011-12-01 19:08:28 +00:00
Neil Kandalgaonkar
0f12bd9b59
get rid of separate undoState function
2011-12-01 19:08:24 +00:00
Neil Kandalgaonkar
b7cc76acd8
hasTransaction -> hadTransaction
2011-12-01 19:08:18 +00:00
Neil Kandalgaonkar
d82a706170
undoes changes, cursor still does not move properly
2011-12-01 19:07:40 +00:00
Trevor Parscal
0f123a6d2f
Removed unneeded condition
2011-12-01 01:03:34 +00:00
Trevor Parscal
85526a7d46
Normalize selection before use!
2011-12-01 01:01:27 +00:00
Trevor Parscal
049b82fb98
Moved images to es
2011-11-30 23:54:12 +00:00
Trevor Parscal
12a20a5fe7
Limited select event emitting to when selection changes
2011-11-30 23:50:32 +00:00
Trevor Parscal
d2d73166a8
Removed soft undo stuff
2011-11-30 22:06:19 +00:00
Trevor Parscal
edd7e6e76d
Added support for RegExp when using the clear method in prepareContentAnnotation
2011-11-30 19:21:33 +00:00
Trevor Parscal
9c98969fa9
Removed setting contentLength from data.length - adding nodes adjusts the contentLength automatically
2011-11-28 22:38:30 +00:00
Roan Kattouw
5ac817a6f4
Fix bugs in prepareContentAnnotation() related to structural offsets, and add a test. Also add parenthesis to the if statement mixing || and &&, for clarity
2011-11-24 16:27:40 +00:00
Roan Kattouw
815029f6db
Fix the prepareContentAnnotation test cases added in r104102
2011-11-24 16:13:19 +00:00
Roan Kattouw
d98a7bd373
Refacor things to use getCommonAncestorPaths()
2011-11-24 15:55:54 +00:00
Trevor Parscal
c1a3d4095f
Got rid of optimize() - now performing consecutive-type operation merging on the fly
2011-11-23 23:54:36 +00:00
Inez Korczynski
1cdd4ed0d3
Fix off by one bug in getRelativeContentOffset
2011-11-23 09:04:06 +00:00
Trevor Parscal
9beda20191
Routed selection through the SurfaceModel
2011-11-23 00:36:46 +00:00
Trevor Parscal
20da830a26
Rewrite of undo/redo - now completely implemented in es.SurfaceModel
2011-11-22 22:59:05 +00:00
Trevor Parscal
df88d82181
Using the full word Difference instead of Diff
2011-11-22 22:57:23 +00:00
Trevor Parscal
631323b9bd
* Refactored es.HistoryModel to always be working from a single array rather than a buffer and an array
...
* Added support for associating a selection with a state
2011-11-21 23:51:37 +00:00
Inez Korczynski
392d911c3d
States is an array of array of transaction, so one more iteration is needed.
2011-11-21 23:10:31 +00:00
Trevor Parscal
e0f746d3d5
Installed HistoryModel into SurfaceView
2011-11-21 22:59:40 +00:00
Trevor Parscal
779a63f486
* Switched to using JSON for hashing, allowing us to use the native JSON.stringify where available, which is much faster
...
* Added a bunch of utility functions for working with character data and annotations
* Got toolbar button states to follow selection of more than one character
2011-11-21 22:32:22 +00:00
Trevor Parscal
48e7f4c3c6
Initial checkin of new es.HistoryModel (needs tests)
2011-11-17 22:44:11 +00:00
Trevor Parscal
6fded56cec
Renamed es.Transaction to es.TransactionModel
2011-11-17 22:42:18 +00:00
Roan Kattouw
117c785d85
Improve the merging logic in prepareRemoval() to also allow merging nested nodes, e.g. by deleting </p></li><li><p>
2011-11-17 19:23:15 +00:00
Trevor Parscal
284082b5d3
Simplified documentation
2011-11-17 18:26:00 +00:00
Trevor Parscal
5784d5f6f5
Added some new documentation for the new merging rules
2011-11-17 18:23:53 +00:00
Trevor Parscal
43de57840e
Commented out some console.log statements
2011-11-17 17:59:15 +00:00
Roan Kattouw
41ace08026
Replace prepareRemoval() with a fixed-up version of my rewrite (which was commented out previously)
2011-11-17 16:44:44 +00:00
Trevor Parscal
566ff61283
Reduced (dramatically) the number of re-renders on insert (but there's still more duplication being done atm, especially on load)
2011-11-17 08:03:14 +00:00
Trevor Parscal
a55f52c2c7
Made it so <p>|</p> is not considered to be a structural offset
2011-11-16 23:57:12 +00:00
Roan Kattouw
5de3778803
Drop droppable (oh, how meta!) attribute introduced in r103211. Will convert prepareRemoval() later
2011-11-16 19:28:13 +00:00
Roan Kattouw
17df2a174a
Fix breakage in prepareRemoval() from r103271 and demonstrated by the tests in r103356. Also add, in a comment, a somewhat functional rewrite of prepareRemoval() to be used after we drop droppability
2011-11-16 19:17:58 +00:00
Trevor Parscal
e559922da0
Fixed incorrect symbolic name being used for nodeRules registration on tableCell and tableRow model nodes. Roan noticed this in r103211
2011-11-16 18:17:24 +00:00
Inez Korczynski
ace69887ee
Fix typo: "annotation" => "annotations"
2011-11-16 06:13:17 +00:00
Trevor Parscal
8a2e8b4aab
Rewrote prepareRemoval to support dropping nodes that are considered droppable (not tableCells) and are covered completely by the range - otherwise nodes are stripped of content
2011-11-16 00:03:17 +00:00
Trevor Parscal
455afe25be
Added a "droppable" bit to each model so that prepareRemoval can avoid dropping table cells (for instance) when removing nodes that are completely covered (which it can't do yet)
2011-11-15 19:01:47 +00:00
Roan Kattouw
c484afe87a
Fix IE-specific test breakages. Two tests were broken because Array.prototype.indexOf() was used, another one because Array.prototype.splice() is broken in IE:
...
>>[1,2,3].slice(0).length
3
>>[1,2,3].slice(0, undefined).length
0
2011-11-15 16:21:45 +00:00
Trevor Parscal
ff07930171
Added test for prepareRemoval which fails atm, because strip doesn't drop nodes that are covered completely. Also cleaned up some comments in prepareRemoval
2011-11-15 01:15:21 +00:00
Trevor Parscal
2494c40297
Moved transaction processing code to new class, es.TransactionProcessor
2011-11-14 23:04:36 +00:00
Trevor Parscal
96a8598ec5
Added scope function to transaction processing so inserting </p></li><li><p> works
...
Fixed off-by-one in splicing dom nodes into view branches
2011-11-14 21:54:53 +00:00
Trevor Parscal
773d97cb1d
Using splice.apply because it's faster and actually works (the loop was incorrect anyways)
2011-11-14 19:51:00 +00:00