Implemented support for range selection in edit mode
Works similarly to the existing cursor. A node is
placed in for the start and end positions of a cursor.
The window selection is updated based on cursor moved events.
The selection sync logic really belongs in SessionView. However,
as only a single selection is supported in the current
implementation, this has been temporarily put into SessionController.
A new function OdtDocument.getCursorSelection has been added
to make it trivial to support range-selection operations.
Fixed lost-in-translation
Works similarly to the existing cursor. A node is
placed in for the start and end positions of a cursor.
The window selection is updated based on cursor moved events.
The selection sync logic really belongs in SessionView. However,
as only a single selection is supported in the current
implementation, this has been temporarily put into SessionController.
A new function OdtDocument.getCursorSelection has been added
to make it trivial to support range-selection operations.
* Move responsibility for setting the memberId into Cursor to
allow proper hiding of anchor node
Sometimes a selection would appear when the cursor was moved by clicking. This is fixed by explicitly collapsing the selection which effectively makes it invisible. In addition the onmouseup event is also registered to move the cursor. The onclick event does not suffice to catch all user actions intended to move the cursor.
is zero, *delete* that textNode. So that we can avoid multiple textNodes
after backspacing.
Important: SessionController allowed removeText operations to be fired
if the position was -1. This caused a lot of nodes *after* the cursor to
be deleted in 'bulk' if you pressed backspace at the first position of the
document. Disallow that.
the semantic of a negative length for a delete operation is
to encode the "direction" of the delete or put in other words
the cursor position before the remove operation.
a length of -1 means backwards delete of 1 character;
length of 1 means forward-delete of 1 character
delete did not work because the to-be-deleted text was always
out of the avatar's textnode (because it is RIGHT AFTER it, in
the next textnode sibling)
also removed "text" property of OpRemoveText, as it is incorrect
after the second operation when not playing operations locally
(before receiving them back from the server)
Idea here is to create abstraction as much as possible for all ODF-related
objects, e.g. the cursor objects now belong to and know the ODF document model
they run around in.
Some avatar tests still need fixing/adaption, but from manually testing it
looks good, so commiting now to prevent too much differences.