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.
Various editors have inconsistent behaviour on this front.
* LibreOffice (Mac) - always blinks even with range select
* Firefox, Chrome, Word (Mac) - hides the caret on range
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
these days only results in AvatarStyleInfo missing after replay for those members
whose cursors are added during the replay and for which the userdata arrives
already before the replay is finished, so that setAvatarInfoStyle() is never
called for them (unless there is an update on the userdata, but that rarely
happens)
There is a remark in the CMake documentation that says:
Do not list the output in more than one independent target that may build in parallel or the two instances of the rule may conflict (instead use add_custom_target to drive the command and make the other targets depend on that one).
This patch makes sure that that advice is followed in many more places in the WebODF build.
Also:
* merge paragraphEdited event of ops.OdtDocument into paragraphChanged event of ops.Session
* remove any event subscription/emitting from ops.OdtDocument
* Removed some unused variables and methods
* Removed redundant variable initialisation
* cursorNode in OdtCursor and Cursor is always set to a valid DOM element. Updated jsdoc accordingly
* Ignore WebStorm project-related files
most notable: untangle init_gui_and_doc:
provide clean chain of callbacks,
separate collaborative/network hookup from document loading,
changeSomeNames, comments and declarations
In webodf, the handle's image's border is set with the user's color
instead of the handle background. Also, the cursor span is changed to
2px width for better visibility.
In editor.css, custom CSS overrides are applied to make the handles look
very much like the avatar 'thumbnails' in the people sidebar.