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().
* 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.
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.
SelectionViewManager that maintains SelectionView instances, and a
shadow cursor object that is an invisible caret-less cursor, fed to both
SessionController and SessionView, which follows the selection as it
changes.
Selections by each cursor are colored according to their memberid
Taking a sequence of ops also enables to give the guarantee that all
contained operations will be executed directly after each other,
in the given order. So creator of the ops can calculate the spec of each op
by relying on the known effect of the other ops.
* EditorSession gets a bit of abstraction which allows smoothly
using the same functions to handle paragraph styles, where an empty
styleName means the default style.
* The paragraphStyles widget now names the default style as ":default"
internally, because dojo could not handle "" properly as an entry value.
* OpUpdateParagraphStyle now knows to treat "" as default style.
* Translations for defaultStyle
* Editor can have three states: without a document/session, with a document/session, destroyed
* Editor is created without any document/session initially
* document/session has to be closed before loading another one
* EditorSession/Session are bound to a document/session, recreated for another one
* all other objects are reused with another document/session
* destroy() cleans up the Editor from the webpage it is embedded (at least good enough for now)
* startEditing/endEditing have to be done by the user of Editor
MemberModel, SessionList, and OperationRouter are proxy classes which use
the server object to communicate with the server, while the server does
not always need to know about them
e.g. some server could not provide a SessionList, while another could have
that and more, while sharing the same basic server protocol.
Thus the serverfactory instance is separated from the server instance.
annotation-end node if the length of the selection > 0.
* Adds a button to the editor to add an annotation at the given cursor position
or selection
* A bad hack in AnnotationViewManager: The dc:creator of
a created annotation is initially empty because the operation has no
way to access the user model even if it knows the memberid. The
SessionView has a new rule for editinfo:memberid attributes that sets
the CSS content: attribute to the user name. AnnotationViewManager,
for now, will read this CSS property and set the text of dc:creator to
that; at least till we have a better way to access the usermodel in
the future
* Rerenders annotations when an annotation is added for tracking (like upon creation)
* SessionView gets a way to concretely specify the CSS pseudo-class for a rule (:before, :after, etc)
* enableAnnotations only allows handles annotations if the allow value
changes
* Add translation strings for annotate
Removing the local cursor (e.g., calling SessionController.endEditing)
previously left behind an orphaned caret that would continue to receive
focus/blur commands and attempt to remain visible. This would cause an
error to be thrown after most operations.
This change turns CaretFactory into a manager that is responsible for
proper disposal of carets unpon the corresponding cursor's removal from
the document.
Consumers of the SessionController would all need to check if and how
undo was supported. As a result, it makes more sense to simply expose
the necessary signals for UI purposes, and encapsulate how the signals
are bound inside SessionController
This manager supplies really simple undo and redo behaviour. Undo is
achieved by resetting the document back to the initial state, and
replaying all operations on top of it.
This undo mechanism is not suitable for a networked operation sessions
as there is no attempt to communicate the resetting of the document
state.
Initial undo state for a document is set when startEditing is called on
a session. This state is effectively a clean document with the local
cursor added to it.
* Added undo/redo buttons to the editor