This re-implementation also addresses problems when navigating passed
annotations as identified in issue #65 & #65.
This also fixes a large performance issue with extending or moving the
cursor via short-cut keys.
SessionController had some internal confusion about whether to work in
selection or range+bool. This cleans these up to ensure the direction is
properly preserved throughought.
Step translation from a DOM point to a step usually results in some
rounding. The existing interface provided a simple bool flag to control
this, but this does not provide help for a caller that doesn't know
ahead of time which step is "closer" to the desired node (e.g., asking
for steps at paragraph boundaries should round within the paragraph).
This extension now allows a custom delegate that will be called with the
prev and next position to choose between rounding options.
selection.
* Modify OdtDocument.convertDomPointToCursorStep(),
which takes a node, an offset, and a boolean, and returns the steps to
that position from the root, rounded to the next allowed
position if the boolean is true, otherwise to the previous.
* Use this method in EditorSession.setCurrentParagraphStyle().
to make life easier by avoiding the need to listen
to various signals or look at optypes when you just
want to know whether any edits have taken place.
* New operations: OpAddMember, OpRemoveMember,
OpUpdateMember.
* Member data is now handled in a memberDataManager
instance inside OdtDocument.
* Any operations must be executed only if a member
is present within this model.
* All polling code for member data has been removed;
colors, names, and images now instantly update
whenever a member data operation is executed.
* Added relevant entries to the OT Matrix.
and programs/editor/Translator.js which is a reference
implementations of a translator.
The programs/editor/Translator code is used entirely in
localeditor.js/collabeditor.js and the editor itself, or webodf,
and need not know anything about the translation mechanism.
Translate all strings within the editor and all
user-facing strings in webodf core itself using
runtime.tr();
In various parts of the code, the magical empty-string cursor id is used
to determine whether the object is a shadow cursor or not. Converting
this into a constant instead and removing the constructor arg prevents
some mistakes being made with this.
hold the 'selected range' fed to it, like with any other OdtCursor. It
provides a minimal OdtCursor-like interface, with only the methods
absolutely required to make it work. It does not modify the DOM in any
way.
* Make the shadowCursor object an instance of ShadowCursor, not
OdtCursor. This is ideal because ShadowCursor does not modify anything
in the DOM, and therefore is safer and faster to use for tracking
browser selections. This makes backwards-selections work finally,
because now there are no anchor nodes to interfere with the selection
whilst dragging.
* With the introduction of the ShadowCursor, we no longer have the
selection range's endpoints coinciding the with beginning and end of the
respective startContainer and endContainer. Therefore, modify
getExtremeRanges to reflect this. If an endpoint of the selection range
does not lie within a TextNode, we latch on to the nearest text node
within.
* In the SessionController, call maintainShadowSelection() if the
selection might leak outside the allowed local root, so that the
window selection object remains root-confined.
* Clone ranges if they may be later modified.
Properly detach ranges once they are used in SelectionView, less
memory leaks.