Commit Graph
62 Commits
Author SHA1 Message Date
Jos van den Oever 2ccfde5fa4 Simplify loading of classes.
runtime.js is now 100.0% typed. The contents of packages.js moves to runtime.js. manifest.js files now use JSON format.
2013-11-26 16:56:00 +01:00
Aditya Bhatt 5bb266e84c Added OT for UpdateMetadata.
Add capabilities to OperationTests.js
and to TransformationTests.js,
test for <office:meta> elements.

Add corresponding tests for
OpUpdateMetadata.
2013-11-25 14:49:34 +01:00
Aditya Bhatt bcc460eb2d Changes related to MemberData w.r.t Annotations:
* Remove old artifacts from AnnotationViewManager.
 * Make OpUpdateMember updated all dc:creator elements
 that have been labelled with an editinfo:memberid attribute.
 * Add tests for member data operations in conjunction with
 annotations.
 * Add a member "Alice" by default in OperationTests.js,
 so that annotations in tests can also have an author name.
2013-11-20 18:56:47 +01:00
Friedrich W. H. Kossebau 248e35ad8b Rename AnnotationManager to AnnotationController
also call do not call AnnotationViewManager objects not annotationManager
2013-11-19 19:56:15 +01:00
Friedrich W. H. Kossebau 7ed71d4825 Add TransformerTests (to test directly resulting opspecs, not execution consistency)
Useful for ApplyDirectStyling vs. ApplyDirectStyling, as that in the current
simple implementation will result in inconsistent DOMs (e.g. names of automatic styles)
2013-11-15 15:30:32 +01:00
Philip Peitsch 9f93032a4e Add support for pasting plain text with line breaks
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).
2013-11-15 18:42:17 +11:00
Philip Peitsch 4a11179b23 Extract StepsTranslator interface to allow a safe interface to start caching improvements 2013-11-14 20:28:32 +11:00
Philip Peitsch 1d9826fed3 Extract TextPositionFilter into standalone class for easier tuning and testing 2013-11-14 20:28:31 +11:00
Friedrich W. H. Kossebau ea1db30669 Add ops.TransformationTests 2013-11-07 10:51:01 +01:00
Friedrich W. H. Kossebau 8eeb0366c9 Add client-side OT 2013-11-07 10:51:01 +01:00
Philip Peitsch eeac880f46 Improve mouse selection peformance by throttling shadow cursor redrawing
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.
2013-10-31 23:07:02 +11:00
Friedrich W. H. Kossebau 22570d0dfe Remove outdated gui.XMLEdit and webodf/xmledit 2013-10-18 20:14:23 +02:00
Friedrich W. H. Kossebau 49950b1daf Remove outdated gui.PresenterUI 2013-10-18 17:21:25 +02:00
Jos van den Oever f6885f812f Add missing include in tests.html. 2013-10-18 15:36:01 +02:00
lli 7580166fec Support image selection
*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
2013-10-15 21:42:20 +11:00
Philip Peitsch 2dd0a4963f Add missing entries to the browser based test harness 2013-10-08 01:30:32 +11:00
Philip Peitsch 84e221082f Allow event focus to be returned to SessionController without scrolling to the top of the ODF canvas
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
2013-10-04 19:24:13 +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 3b5b28afd5 refactor StyleNameGenerator into ObjectNameGenerator
- moved getAllStyleNames from Formatting to ObjectNameGenerator
- renamed StyleNameGeneratorTest to ObjectNameGeneratorTest and added a couple of more unit tests
2013-10-02 13:39:35 +10:00
Philip Peitsch 06be7045ec Extract text manipulation functions from SessionController 2013-09-27 18:30:07 +02: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
Philip Peitsch a6a4973218 Extract combined Odf & SelectionMover tests into separate file
Adapted tests to use real Odf fragments and a real TextPositionFilter
2013-09-16 14:23:21 +02:00
Friedrich W. H. Kossebau de1103fcfe Add gui.DirectParagraphStyler, a UI-less tool specialized on direct styling of paragraphs 2013-09-10 15:52:39 +02:00
Friedrich W. H. Kossebau eb57ef2def Add gui.DirectTextStyler, a UI-less tool specialized on direct styling of text 2013-09-10 13:02:28 +02:00
Philip Peitsch 108809dd0b Replace click handler with equivalent event.detail property
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.
2013-09-09 09:22:54 +10:00
Philip Peitsch 9d1aa531d5 Extract re-usable concepts
* The extracted style name generator and logic for creating derived
styles will ease the implementation of paragraph direct-format support.
2013-09-06 03:53:09 +10:00
Philip Peitsch caf0fbe549 Refactored style modification ops to use Formatting.updateStyle
* Added missing operation to test harness
2013-09-06 02:33:39 +10:00
Friedrich W. H. Kossebau f2b56083e6 add a ops.Server interface + a ServerFactory interface, move Nowjs-based server stuff into programs/editor/server/nowjs
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.
2013-08-28 16:33:49 +02:00
Friedrich W. H. Kossebau f4d293645d Rename OpDeleteParagraphStyle to OpRemoveParagraphStyle 2013-08-08 16:26:03 +02:00
Friedrich W. H. Kossebau 4322b22858 Rename everything with "[Uu]ser|[Ppeople]" to "[Mm]ember"
consolidates the terms used a little
2013-08-07 18:03:19 +02:00
Philip Peitsch 5affedf3b9 Add missing dependencies into tests.html 2013-08-06 14:12:25 +10:00
Philip Peitsch 15a65b71ea Migrate tests for migrated StyleHelper => OdfUtils functions
* Added instructions on how to create new test classes, as this involves
a myriad of small file changes that can easily be missed overlooked :(
2013-08-05 16:33:05 +10:00
Philip Peitsch 240ae21566 Add new annotation manager classes to browser-based tests 2013-08-02 09:14:44 +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 f25d936355 Removing a cursor will now cause the associated caret to be removed
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.
2013-07-26 22:26:11 +10:00
Jos van den Oever 64d57c96cf Fix issues exposed by latest JSLint. 2013-07-24 21:41:56 +02:00
Philip Peitsch 15effae773 Prevent range boundaries from being incorrectly reset during split
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
2013-07-24 01:20:29 +02:00
Philip Peitsch a790a85cad Clipboard now excludes webodf-related elements from the copied XML and text
This prevents a problem where cutting a modified paragraph from a document
was including the modification date & time in the resulting text.
2013-07-23 16:42:01 +10:00
Philip Peitsch 1be8a951fe Fixed compilation order of new StyleHelper 2013-07-23 01:31:16 +10:00
Lu Li 0eff2c6a0a Refactor odf.Formatting class
* move getTextNode from OdfUtils to StyleHelper
* move some of the unit tests under FormattingTests to StyleHelperTests
2013-07-22 16:47:42 +02:00
Lu Li fea0502aed refactor keyboard handling 2013-07-15 12:13:22 +02:00
Philip Peitsch 2af09cc034 Refactored out common DOM utility methods 2013-07-15 09:40:50 +02:00
Philip Peitsch 1d6637acc8 Created undo states to revert clumps of operations
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.
2013-07-09 15:03:53 +02:00
Lu Li 6a3b2075df refactor click related functionalities to ClickHandler.js 2013-07-08 15:25:22 +02:00
Philip Peitsch a471ee42da Added basic cut support for Chrome and Safari
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.
2013-07-05 11:04:18 +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
Philip Peitsch ea8c135546 PositionIterator.setUnfilteredPosition automatically advances to the next valid position
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
2013-06-19 16:58:13 +02:00
Philip Peitsch 415ec18ec3 Removed obselete SelectionManager class 2013-06-19 13:43:46 +02:00
Philip Peitsch f76257c81a Avoid issues with lists in fodt files
Extra whitespace nodes throw off any logic depending
on the node's firstChild being a non-whitespace element
2013-06-17 13:08:47 +10:00