Useful for ApplyDirectStyling vs. ApplyDirectStyling, as that in the current
simple implementation will result in inconsistent DOMs (e.g. names of automatic styles)
Pasting plain text with line breaks allows intelligent
merging into lists as well as multiple paragraphs.
Currently does not do the right thing on undo/redo,
as the undo manager does not respect operation groups
(yet).
Drawing the cursor on every mouse move event badly impacts the responsiveness
of the application, because the move events buffer in the browser until
every single event is processed. By setting these on a background timer,
the cursor is updated asap, but is able to aggregate multiple move events
received in this time period.
*Added a ImageSelector class to draw and clear image selection
Known issue:
The selection box is moving up and down when using browser's zooming functionality. but it is working fine with the slider zoom
Element.focus() has additional logic that attempts to bring the top of
the element into view. This causes the a document that has been vertically
scrolled to reset back to the top of the document each time an Editor
button is clicked.
This redesign abstracts the event management away, and uses an invisible
div as the primary event trap. Because the div is always visible and
centred, the browser does not perform any scrolling. Non-bubbling events
are automatically forwarded from the event trap to subscribers.
Fixes Issue #44
- moved getAllStyleNames from Formatting to ObjectNameGenerator
- renamed StyleNameGeneratorTest to ObjectNameGeneratorTest and added a couple of more unit tests
As per http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseup,
event.detail records the number of clicks in the same way ClickHandler
was attempting to.
This has the happy side-effect of fixing an issue where double or triple
clicking on the editor's toolbar would result in the selection expanding
to word or paragraph boundaries.
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.
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.
When splitting text nodes, a more stable point will need to be found
for the end point if the start point is split, as DOM modifications
can potentially cause the end point to be lost
These undo rules attempts to implement undo/redo behaviour similar to
how LibreOffice behaves.
An undo state starts on an edit Operation. An undo state can be:
- One or more text inserts in the same direction
- One or more text removes in the same direction
- Any other individual edit operation (e.g., split paragraph, style
text, modify paragraph style)
-An undo state includes any trailing non-edit operations such as cursor
move.
There are challenges going backwards and forwards on separate op stacks
and generating identical states each time. As such, this has been implemented
by storing the operation into the state it's relevant to upon execution (rather
than traversal), and never splitting or modifying these during movements forwards
and backwards.
The one caveat with this is that Paste in Safari is still
unsupported as Safari blocks the command on
read-only elements (a security feature perhaps?).
Neither cut or paste work on Firefox.
Applying a direct style to a range will result in new
automatic styles being created for each unique style
block with the desired text properties.
Formatted text is contained within a span element just
above each text node that is within an ODF container
element.
TODO
* Styles should be validated before being applied
* Empty spans should be removed when modifying styles
This makes the result of next & previous always a node that will pass
the filter. Previous implementations could return entirely unexpected
nodes
* Corrected module load order for tests
This provides better encapsulation and clarifies the usage slightly.
Hopefully, it will decrease the ways to cause the selection & actual
cursor position can get out of sync.
As this was the only use of the Selection stack, the whole class is
now removed