31 Commits
Author SHA1 Message Date
Philip Peitsch bb56bc684c Convert odf.OdfUtils into a static singleton 2014-09-12 10:33:27 +10:00
Philip Peitsch 3172ad8dec Convert core.DomUtils into a static singleton 2014-09-12 10:17:09 +10:00
Satvik Kumar a714866c52 Removed getParagraphElement from OdtDocument
This function only redirected to the OdfUtils version and many callers
already had an existing instance of OdfUtils to use. Any callers who did
not have an instance of OdfUtils now create one to continue using the
function.
2014-08-13 23:15:50 +10:00
Philip Peitsch 5b7cd7c543 Re-implement up/down movements caching the last caret X position
When navigating vi the up/down arrow keys, the user often wants to move
multiple lines in sequence (e.g., to visually place the caret in one of
the following lines). To stop the caret suddenly jumping to the left
side of the page when crossing an empty paragraph, the caret's X position
will be stored and re-used by subsequent up/down movement for up to 2s
after navigating by line.

Any other operations performed by the local user (e.g., cursor movement
to the left or right), or edit operations by collaborative users will
immediately clear the stored X position.
2014-07-23 02:17:20 +10:00
Philip Peitsch 615f592473 Re-implement navigate-by-line cursor movement 2014-07-23 02:17:20 +10:00
Philip Peitsch adc5a08759 Re-implement navigate-to-line-boundary cursor movement 2014-07-23 02:17:19 +10:00
Philip Peitsch 3c1f13db24 Ensure various places always have a valid root element
There is a small edge between the canvas border and the office:text
element that the user can click in. Doing this returns null for the root
element (as it is the container that contains the office:text element),
causing an unhandled null reference exception to occur in some
circumstances.

Fixes #664.
2014-06-20 23:14:50 +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 4c28ce91a0 Refactoring left/right cursor movement to use simplified concepts 2014-05-28 21:57:18 +10:00
Philip Peitsch b31501219c Extract re-usable step direction concept 2014-05-28 21:57:16 +10:00
Philip Peitsch 6b4ef28caa Extract re-usable concept to easily move the cursor's focus point 2014-05-28 21:54:36 +10:00
Philip Peitsch 5a4086feb9 Don't crash if the requested range is outside the any document root
Fixes a crash when running the benchmark.
2014-03-31 22:48:09 +11:00
Philip Peitsch 48d06917b9 Use the start node rather than cursor for word boundary expansion
The SelectionController interfaces allow word-expansion to occur on
arbitrary ranges that may not be tied directly to the cursor (e.g., when
used via the selectRange interface). This means the correct root to use
in all circumstances is the starting node & offset.
2014-03-26 10:14:45 +11:00
Philip Peitsch 2af751acdd Crop range selection to the anchor root
Fix an unhandled case if the anchor and focus points of a range were in
two separate roots. The select range logic will now clip the range to
the closest valid edge within the anchor's root.
2014-03-26 10:14:45 +11:00
Philip Peitsch 4a07688662 Use named constants for movement direction rather than magic numbers 2014-03-26 10:14:42 +11:00
Philip Peitsch 3cd6d6a5d1 Re-implement paragraph & document selection using step iterators
Changes in adjustSelectionByNode logic fixes extend-by-paragraph
problem (issue #335).
2014-03-24 19:08:05 +11:00
Friedrich W. H. Kossebau dd6f6fa2eb Fix file headers missing AGPL copy note & @source not yet pointing to github 2014-02-12 15:58:15 +01:00
Philip Peitsch 1c10e8bc14 Move WordBoundaryFilter to the ODF namespace to allow for wider reuse 2014-02-12 13:03:17 +11:00
Philip Peitsch 14f92e09fe Rewrite range-based word boundary expansion to use step iterators 2014-02-12 13:03:17 +11:00
Philip Peitsch f2bcb12be7 Rewrite move & select via word boundaries to use a step iterator 2014-02-12 13:03:17 +11:00
Philip Peitsch 67a35e28b0 Split the word boundary filter out of SelectionController
Primary intent is to reduce the size of the selection controller class,
in preparation for some additional fixes to aid word boundary detection
in non-english languages.
2014-02-12 13:03:16 +11:00
Jos van den Oever bed3b62469 Make DirectFormattingController and SessionController 100% typed. 2014-02-08 14:48:22 +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
Philip Peitsch 283b407b33 Remove non-existent parameter from API dox 2014-01-31 15:10:13 +11:00
Andreas Obergrusberger 45ebc8e02a Add ctrl+arrow per-word cursor movement 2014-01-30 21:33:39 +01:00
Philip Peitsch 1eb23dc159 Simplify PositionFilterChain to not use named filters
PositionFilterChains no longer have any need to allow adding or removal
of named filters. In practice, filters are only ever added just after
construction, and remain unchanged beyond this point. This allows a
slight simplification of the PositionFilterChain interface.
2014-01-22 23:29:04 +11:00
Philip Peitsch 4428ddfee1 Rewrite some cursor move & extend actions to use a StepIterator 2014-01-22 23:29:03 +11:00
Philip Peitsch d8076620dc Rewrite image selection to use StepIterators
OdtDocument.getDistanceFromCursor is no longer used by any code.
2014-01-22 23:29:03 +11:00
Philip Peitsch 38fda06f78 Don't expand paragraph boundaries outside the current root
The surround paragraph found by traversing the start or end container may
be outside of an inline root. OdtUtils.getParagraphElements has logic that
prevents traversal out of the current root into a new root.

Fixes issue #300
2014-01-13 21:34:11 +11:00
lli 66e25e096d Move selection related operations into the new SelectionController.js 2013-12-18 23:26:30 +11:00