31 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau 1d24d462c8 In OpAddAnnotation support annotated ranges with 0 length
Before 0 length was assumed to be an annotation without a range
2015-03-26 13:42:23 +01:00
Philip Peitsch 6aa01c682e Optimize all existing uses of getElementsByTagNameNS
Transformed all read-only uses to use node.getElements*. Any loop that
immediately modifies the nodes in the list has been updated to use the
DomUtils.getElements* version.
2014-09-11 15:10:41 +10:00
Philip Peitsch 26ede808f3 Only scroll to *locally* inserted annotation
Reimplement logic to fix #486
2014-08-07 20:59:03 +10:00
Philip Peitsch c68d36573c Reset the cursor selection type back to text after adding an annotation
If an annotation is created while the user has selected an image, the
selection type was not being correctly reset back to text range. This
prevents the caret from displaying properly and disables typing commands.

Fixes #634.
2014-06-07 01:28:19 +10:00
Friedrich W. H. Kossebau 1e2a4a8323 Normalize license headers of the webodf.js source files
* remove @license tag (to prevent Closure compiler keeping the comment)
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released webodf.js
* separate license header by empty line from following content
2014-06-02 12:19:05 +02:00
Philip Peitsch 4f631ac8f1 Remove obsolete length parameter from step insert/remove cache signals
The length parameter is incorrect under many circumstances, and has
proven so difficult to get correct that the cache implementation now
ignores it entirely. Remove this tech debt to simplify future ops.
2014-05-23 00:44:06 +10:00
Jos van den Oever b3c77bf307 Move signals CursorAdded, CursorRemoved and CursorMoved to ops.Document.
This makes SvgSelectionView independent from ops.OdtDocument.
2014-02-24 15:13:13 +01:00
Jos van den Oever ddcb6009eb Add a number of more precise types and remove unneeded casts. 2014-02-10 15:59:37 +01:00
Jos van den Oever ff013b1759 Make the operations OpAddAnnotation, OpAddCursor, OpAddMember, OpAddStyle, OpApplyDirectStyling, OpApplyHyperlink and OpInsertImage 100% typed. 2014-02-08 10:37:23 +01:00
Jos van den Oever ed7270442f Remove loadClass calls from class files. The load system reads the dependencies from the manifest.json files now. 2014-02-07 15:38:09 +01:00
Friedrich W. H. Kossebau b9beecaf9f Create direct linking between matching annotation and annotation-end elements 2014-02-06 12:44:44 +01:00
Jos van den Oever 8a171bb30f Make gui.TrivialUndoManager and gui.UndoStateRules 100% typed. 2014-02-05 15:28:06 +01:00
Jos van den Oever a9e64e645f Remove circular dependency between OdtDocument and OdtCursor.
OdtCursor does not depend on OdtDocument any more. In fact, it is not specific
to ODF any more so at some point it could be renamed.
2014-02-05 14:24:25 +01:00
Aditya Bhatt e28e8f85b8 Change type annotatiosn from Node -> Element
in OpAddAnnotation.js
2013-11-26 19:18:47 +01:00
Aditya Bhatt 43d15d17da Fix OpAddAnnotaton to guarantee that the
cursor will always be moved inside the
newly created annotation.
This is done by calling cursor.setSelectedRange
with the range covering the paragraph contained
inside the annotation node.
2013-11-26 19:12:46 +01:00
Aditya Bhatt bfdc14b907 Add isEdit properties to all operation classes
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.
2013-11-22 20:35:29 +01:00
Aditya Bhatt cb8ff428cd Remove terrible hack for setting the dc:creator
field's text in an annotation; now that we
have first-class access to member data,
we can set this value directly within
OpAddAnnotation.
2013-11-20 18:56:47 +01:00
Philip Peitsch dd166cb00c Refactor getPostionInTextNode to use cached step information
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.
2013-11-14 20:28:36 +11:00
Philip Peitsch 410280fe14 Add signals necessary to keep a caching implementation in sync with the document 2013-11-14 20:28:33 +11:00
Philip Peitsch 553739907b Condensed countBackwardSteps & countForwardSteps into countSteps on SelectionMover
Most consumers of this interface were re-implementing a "countSteps"
equivalent.
2013-10-25 22:12:09 +11:00
Friedrich W. H. Kossebau c2a795e668 Update link to repo: now https://github.com/kogmbh/WebODF/ 2013-10-23 18:20:30 +02:00
Friedrich W. H. Kossebau 508570dab8 Add copy of the AGPL3 to sources (+ add to created zip files) 2013-10-21 17:55:16 +02:00
lli d7a1dbc2f5 Refactoring a few classes for supporting selection type
CaretManaer - hide caret if it is image selection; otherwise show and refresh cursor blinking
OdtCursor - introduce seletion type
OpAddAnnotation - reset seletion type to default after moved into annotion
area
OpMoveCursor - set the cursor's selection type
OpRemoveText - reset selecton type to default after deletion
2013-10-15 21:42:20 +11:00
Philip Peitsch 1e874e07c9 Remove unnecessary local member id parameter
All consumers of this event check the memberid associated with the cursor
regardless. This filter therefore does nothing.
2013-10-14 11:09:24 +11:00
Philip Peitsch 4e7e440405 Move the cursors back into valid positions after inserting an annotation
OdtDocument.getPositionInTextNode relies on the cursors being in
accepted positions in the document. After adding an annotation, any
trailing cursors should be reset to valid positions.
2013-10-08 02:04:01 +11:00
Friedrich W. H. Kossebau aa6e53a223 Remove odf.Namespaces.webodfns 2013-10-01 14:57:04 +02:00
Friedrich W. H. Kossebau 07a8cf97dc Clean up any empty text nodes created on insertion of annotation elements 2013-09-23 13:34:51 +02:00
Aditya Bhatt 35fcd018f6 Preserve positions of other cursors present at the same position when
inserting an annotation. Also, tests for that.
2013-08-14 19:38:38 +02:00
Aditya Bhatt 67b91bbe44 * OpAddAnnotation: Move the cursor inside the newly created annotation 2013-08-14 19:38:33 +02:00
Friedrich W. H. Kossebau decaaeaf4e use OdtDocument.getDOM() consistently 2013-08-13 00:22:22 +02:00
Aditya Bhatt 825a44affc * OpAddAnnotation that lets you create annotations. This only creates an
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
2013-08-05 19:16:32 +02:00