35 Commits
Author SHA1 Message Date
Philip Peitsch 06ecc7d8c8 Implement OpMergeParagraph
In order to improve the OT-ability of text and paragraph removal
with other operations, the merge behaviour has been extracted.

The logic for building up the necessary remove operations has
been encapsulated in TextController for now as all uses pass
through this point still.
2014-06-17 03:13:00 +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 6dcb606e98 Revert OperationFactory interface changes made in a1f86ac
By specifically invoking a new when creating an operation instance
makes it quite difficult for external operation constructors, as there
is no easy way for external ops to share non-document state.

All WebODF ops don't have this issue as new functions can easily be
added to the OdtDocument interface to support the new requirements.
2014-04-03 22:13:51 +11:00
Jos van den Oever a1f86ac7b6 Make OperationFactory 100% typed. 2014-02-08 10:38:04 +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 d2671e2a00 @returns -> @return 2014-01-31 15:33:43 +01:00
lli 05f41bac2f Added hyperlink support for text elements 2013-12-13 17:40:21 +11:00
Aditya Bhatt 9a12663336 Add a new odf.MetadataManager to lib/odf.
This handles setting and getting of various metadata
 fields, by providing methods setMetadata and getMetadata
 which take and return flat mappings between strings.

 This has been limited to work with only a few
 blessed metadata fields for now.

 ops.OpUpdateMetadata can be issued by either the server
 or a client once a gui for editing things like title
 is implemented.
2013-11-25 14:37:47 +01:00
Aditya Bhatt e16cc38edb == Op-ify member data handling ==
* 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.
2013-11-20 18:56:47 +01: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
Lu Li f295b71cf8 add support for inserting inline images into text document
TODO: eliminating duplicates, resize image to fit in table cell
2013-10-02 16:37:48 +10:00
Lu Li 3f80a1517d Add OpSetBlob and OpRemoveBlob 2013-10-02 13:39:36 +10:00
Lu Li bbb5ecef8a Refactoring: changed Op(Add|Remove)ParagraphStyle to Op(Add|Remove)Style, so they can handle all style families NOT just paragraph 2013-09-20 17:36:41 +02:00
Aditya Bhatt d17e0a1c02 * Add a cicrular button to the annotation note in AnnotationViewManager
to delete the annotation
* Add click-handling for such buttons in SessionController
* Add OdfCanvas.forgetAnnotations() to untrack annotations
* Add OpRemoveAnnotation that takes a position within the
 annotation, and deletes that annotation. It also takes the
 walkable length of the annotation node for OT purposes.
 Any cursors inside are moved to the left of the annotation.
2013-08-14 13:49:33 +02:00
Friedrich W. H. Kossebau f4d293645d Rename OpDeleteParagraphStyle to OpRemoveParagraphStyle 2013-08-08 16:26:03 +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
Friedrich W. H. Kossebau cce094b2c1 turn OpCloneParagraphStyle into OpAddParagraphStyle
having all the data in the spec not only helps/enables OT, but also
makes it possible to create styles in documents without any prior existing
2013-08-01 20:00:44 +02:00
Friedrich W. H. Kossebau b10f41de7b Rename "OpApplyStyle" to "OpApplyDirectStyling" and its spec elemnt "info" to "setProperties" 2013-07-30 12:05:09 +02:00
Philip Peitsch 58ed969130 Provide ability to register custom operations with the OperationFactory
This starts to allow custom operations to be added to webodf core that
can be routed via the undo, OT and main processing run loop.
2013-07-15 09:07:48 +02:00
Philip Peitsch c3a28b3ce3 Implemented support for direct formatting of selection
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
2013-07-02 21:19:36 +02:00
Friedrich W. H. Kossebau c0a9a1e99f Remove unused session argument from ops.OperationFactory constructor 2013-05-07 11:42:27 +02:00
Philip Peitsch f709b07228 Implemented OpInsertTable
* No GUI access to feature yet
* New tables are inserted after the current paragraph
2013-04-17 21:28:45 +10:00
Friedrich W. H. Kossebau 6e7e3fe55f Rename OpCloneStyle to OpCloneParagraphStyle, OpDeleteStyle to OpDeleteParagraphStyle 2013-04-10 12:15:07 +02:00
Friedrich W. H. Kossebau 263002f70f Update Copyright years of ops code files 2013-04-09 13:45:33 +02:00
Friedrich W. H. Kossebau 6f5ced4d1e Do not pass session as parameter to the ops contructors, pass odtDocument instead of domroot in the execute method 2013-04-09 13:45:33 +02:00
Aditya Bhatt 76c36b72ad Add OpDeleteStyle to webodf, in the same fashion as OpCloneStyle 2013-02-11 14:29:30 +05:30
Aditya Bhatt 8d26c25dde Add a new operation, OpCloneStyle.js, and use it in the editor 2013-02-01 23:30:53 +05:30
Aditya Bhatt 146bb8d58d Add a new operation for Updating a paragraph style element 2012-12-28 12:05:06 +01:00
Jos van den Oever 9f1658a806 Add boilerplate for the operation to split a paragraph. 2012-11-16 17:51:49 +01:00
Jos van den Oever 155bf9a4d3 Whitespace fixes. 2012-11-10 11:35:21 +01:00
Friedrich W. H. Kossebau 549dd93381 Turn setting the style of a paragraph into an operation (dirty initial hack) 2012-11-09 12:24:35 +01:00
Friedrich W. H. Kossebau af07d10ef4 Use term "cursor" instead of "member" when it is just about a cursor 2012-11-09 12:19:55 +01:00
Friedrich W. H. Kossebau a788288991 Create a simple RemoveText operation on backspace 2012-11-09 12:13:04 +01:00
Tobias Hintze 3653e13a42 implement OperationFactory and NowjsOperationRouter; add spec() to ops 2012-11-09 12:00:43 +01:00