The new logic no longer provides special behaviour for the requested member's
cursor. Instead, all inserted data will occur after any cursors occupying
that particular step.
and obey it to explicitly move the cursor to the
desired resultant position.
When doing this, take care to specify the correct
textnode position for text insertion (i.e. before
or after the cursor).
* Adapt the rest of the code that uses OpInsertText
to pass the correct moveCursor flag (true).
* Remove the 'return null' from the transform of
InsertText vs InsertText.
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.
The new implementation should be equivalent in every way, except
it now is able to benefit from the cached step information to be
significantly more faster.
This patch also addresses parts of issue #3.
The final character of inserted text must always be upgraded
on insertion, and conditionally downgraded post-insertion.
This covers the situation where a space is inserted as the last
character in a paragraph. In this instance, the space must be
a space character so it isn't discarded as trailing insignificant
whitespace.
Under various conditions inserting or removing text should cause existing
whitespace to be upgraded, or allow it to be downgraded. Note, OpSplitParagraph
doesn't require downgrade checks as a split paragraph always requires
any leading or trailing spaces to be upgraded.
Overuse of space elements when pasting text causes the "justified"
paragraph alignment to appear to not function. Both LO and a standard
web browser do not expand the spacing inside space elements when the
paragraph is justified, resulting in it appearing to be simply left-aligned.
* Documentation++
* Enable annotations by default in editor and viewer.
* Detach range in highlighter after use
Also: Annotation handling is broken when annotations overlap. Add TODO for
that.
annotation in html containers, adds connector elements, and a text
highlight.
Trigger OdfCanvas's anntationManager instance whenever any text
modification operation occurs.
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
specified in getPositionInTextNode. Also, if there is a preferred cursor
node, then return the empty text node as immediately to the left of that
cursor.
* Add the memberid argument to it's call in OpInsertText. Now if many
cursors are at the same position and one cursor inserts text, the others
don't move along.
The root node element of the flat ODF, <document>, is not a direct child of the
variable "sizer" in the odf.OdfCanvas code) which is used to implement the
zooming feature, by using the scale() transformation via the styles.
Problem is that this scaling does not also scale the actual space used by the
element. To fix this there is a method fixContainerSize() which is used to adapt
the size of the canvas element to the actual rendering size of the document
content. This code then sets the width and height properties to fixed values.
But all this results in another problem: the canvas element is not resized
automatically by the usual DOM behaviour if the content below the <document>
node or the CSS applied to it parts is changed.
The initial plan was to use DOMSubtreeModified & friends, to have the
odf.OdfCanvas care for updates itself. But as it seems outdated and has quite
some overhead on larger changes to the document, in the end it was decided to go
for now with the approach that was chosen for the style changes, to rely on the
document modifying ops to trigger the needed canvas updates themselves. Not
perfect, but seemed consistent at least.
Also:
* merge paragraphEdited event of ops.OdtDocument into paragraphChanged event of ops.Session
* remove any event subscription/emitting from ops.OdtDocument
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.