111 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau b5728f962a Use single-quotes in CSS to save a few escaping bytes after css2js.js 2014-08-23 21:12:50 +02:00
Philip Peitsch f1db519be2 Improve horizontal alignment of caret between characters 2014-08-18 23:05:46 +10:00
Philip Peitsch 988691d7ce Alternative approach to preventing empty paragraphs from collapsing
Using the ::after pseudo-element with text content provides a more
consistent box height with non-empty paragraphs. This prevents table
cell heights from shifting when the caret iterates through them.
2014-08-18 22:50:50 +10:00
Philip Peitsch 85d3d09fee Use a multi-line text input trap so text2speech pauses for paragraphs
Screen readers tend to read input text elements as single lines, and do
not pause on new lines. Using a text area instead encourages some of these
to pause more naturally on paragraph boundaries.
2014-08-01 01:07:05 +10:00
Philip Peitsch 169aa091a9 Remove unnecessary eventTrap CSS rules
The event trap is no longer made visible during composition. As a result,
the overflow and width settings are no longer required, and the height is
never overridden.
2014-07-30 22:31:33 +10:00
Philip Peitsch 01299999b0 Keep IME character selection menu in one place during composition
f78a30a introduced a regression that caused the IME menu to appear to
follow the caret across the screen as new characters are entered, rather
than remaining anchored at the beginning of the composed text.

This patch adds some width calculations, and aligns parts of the caret
overlay to either left or right side of the container. As the caret
overlay is widened, the event trap will remain fixed to the left, and the
caret + avatar handle will remain fixed to the right.
2014-07-30 22:31:32 +10:00
Philip Peitsch 3f259ca0b6 Clean up Avatar styling and remove !important tags from webodf.css
Historically, the avatar styling was split between the avatar class,
webodf.css and the editor's own CSS. This now all lives within WebODF,
so the !important tags are no longer necessary as the style attributes
being set on the handle and image elements can simply be removed.
2014-07-30 22:31:32 +10:00
Satvik Kumar e9d57841a2 Support multi level list numbering
Implemented a changed list counter setup where each list level has its own
counter. This is to support behaviour defined where you can display only a
subset of the list numbers.

This is defined here:
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1418890_253892949
2014-07-12 02:58:19 +10:00
Friedrich W. H. Kossebau 8c350e927b Add license header also to all CSS and big test data xml files 2014-06-03 12:37:12 +02:00
Philip Peitsch f24fd54516 Remove another unnecessary inline-block
The cursor element is now only visible when it contains either text
or the caret-size helper. In addition, there are no longer any fixed
widths being applied to the cursor element, so the inline-block is not
necessary.
2014-05-27 00:15:50 +10:00
Philip Peitsch 35c461b7f5 Provide a better caret position fallback when no visible rects are found
In the specific situation where there are no visible rectangles nearby
from which to calculate the caret position and size, the cursor node itself
will be made visible with some hidden internal text as a substitute.

This ensures the caret is correctly aligned in empty paragraphs that are
not left-aligned, or in an area surround by non-visible rects such as near
multiple annotations.
2014-05-27 00:15:49 +10:00
Philip Peitsch 93916916b8 Simplify CSS rules for cursor and composer element
The cursor node is now completely hidden when not in use, so there is no
need to touch the height or width properties of the composer or cursor.

In addition, the new overlay caret no longer requires the composer to be
displayed as an inline-block in order to function.
2014-05-26 14:59:42 +10:00
Friedrich W. H. Kossebau 353becb4db Restore opacity: 0.3; as default for avatar handles
accidentally removed in 234380ef33
2014-05-20 17:17:34 +02:00
Aditya Bhatt d7dc1972e5 Do not let the caret overlay grab pointer events. 2014-05-19 15:51:55 +02:00
Philip Peitsch f78a30a505 Fix caret placement when composing text via the IME
If the cursor node itself is visible, use the bounding rectangle from that
as the highest priority for the caret position.
2014-05-17 00:43:42 +10:00
Philip Peitsch c0332ed1f9 Make caret and avatar overlays rather than inline content
Having the caret and avatar display inside the cursor node causes text
wrapping and other element shifts to occur in some browsers (mainly FF)
due to there being layout impacts from the almost-but-not-quite 0-width
cursor element.

Moving to non-inline overlays for these bits of chrome allows the cursor
to be hidden completely.

TODO
This commit introduces a regression when composing text using an IME
as the overlay doesn't advance properly during composition.

Fixes #86
2014-05-17 00:43:42 +10:00
Philip Peitsch 718a8938f1 Stabilise annotation connector rendering in FF
Firefox makes the connector line and associated note wrapper float around
when the cursor is nearby if the top value is not fixed.

Fixes issue #49
2014-05-14 10:07:26 +10:00
Philip Peitsch ff0e7f8898 Improve avatar alignment to centre better with relation to the caret
The avatar was not staying well centred over the caret, and wouldn't move
vertically when the caret grew to match the text size. The easiest way to
ensure these stay properly aligned is to wrap both inside a sub-container.
2014-05-13 18:38:20 +10:00
Philip Peitsch 234380ef33 Migrate avatar CSS rules from editor to webodf.css
Each css file contained some of the rules required for the avatar display.
There are enough stylistic elements in webodf.css the avatars look strange
if the editor.css rules are not present.

Clean up this problem by merging all the rules into webodf core.
2014-05-13 18:38:19 +10:00
Philip Peitsch 08276e065c Hide the cursor anchor element
This is not a visible element. It is used only to track selection
ranges inside the document.
2014-05-09 17:39:20 +10:00
Aditya Bhatt 8b78047061 Unbreak master page rendering in ODPs.
Restricted the `z-index: 1` hack for draw|frame to
frames within office|text, since it was intended for
ODTs in the first place.
2014-04-10 12:14:14 +02:00
Aditya Bhatt d60958e816 Hide native selections only when virtual
selections are used.
2014-04-01 17:32:11 +02:00
Friedrich W. H. Kossebau 7cf3a54b81 Do not display <text:bibliography-source/> 2014-03-28 13:32:45 +01:00
Satvik Kumar a2f631774a Implement label-width-and-position mode for list layout
Remove the partial handling of list indentation and implement the default
option for list-level-position-and-space-mode.

Also added px as a conversion unit in CSSUnits.

http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#property-text_list-level-position-and-space-mode
2014-03-26 13:54:57 +11:00
lli cba658f622 Add tooltip support for hyperlink 2014-03-17 22:39:09 +11:00
Philip Peitsch 80b94262d4 Toggle hyperlink active state via classes rather than custom XML attrs
Toggling a custom attribute on a custom XML element doesn't properly
update the visual state on some browsers (e.g., WebKit on OSX). Using
CSS classes instead seems to be better handled in these browsers,
correctly updating the mouse cursor icon on the fly.
2014-03-11 22:52:58 +11:00
Friedrich W. H. Kossebau 071dc4ae91 prefix "annotationHighlight" element classname with "webodf-" 2014-03-10 15:43:48 +01:00
Friedrich W. H. Kossebau 6232bd0917 prefix "draggable" element classname with "webodf-" 2014-03-10 15:43:48 +01:00
Friedrich W. H. Kossebau 83e50d37ed prefix "selectionOverlay" element classname with "webodf-" 2014-03-10 15:43:48 +01:00
Friedrich W. H. Kossebau b9ce8bef60 prefix "customScrollbars" element classnames with "webodf-" 2014-03-10 12:41:22 +01:00
Aditya Bhatt 50c6f3c194 Make EventManager adds a class touchEnabled
to the canvas element when it detects a touch
event (because simply sniffing for the existence
of touch events is not reliable).
2014-03-07 18:45:52 +01:00
Aditya Bhatt b811f715ee Add two handles to a selection's endpoints.
These are meant to be draggable.
2014-03-07 18:45:49 +01:00
Aditya Bhatt 86d28fb008 Show custom scrollbars in touch mode.
This is required because webkit on mobile
does not seem to show any scrollbars if
`-webkit-overflow-scrolling: touch` is not
enabled -- and we cannot enable that because
it's kinetic scrolling is not controllable
or trackable.

Enable virtual scrollbars when in scroll mode,
othwerwise disable them. This is done because
the scrollbar size/position makes no sense
immediately after a removeScroll() call, because
the perceived panning is done through CSS.
2014-03-03 22:46:51 +01:00
Aditya Bhatt e8a3643b28 Do not grab click events on the eventTrap.
Fixes an issue where clicking on the middle of
the character to the right of the caret would
cause the cursor to move to the start or end
of the document.
2014-02-28 15:29:52 +01:00
Aditya Bhatt 352142d0e3 Set pointer-events: none on the cursor,
so that the mouse pointer remains caret-shaped
when hovering over it.
2014-02-20 17:35:09 +01:00
Aditya Bhatt 3ebb3ed1e1 Introduce a 'composer' element in the cursor.
The composer reflects the text inside the eventTrap
and styles it with an underline to match other native
IMEs.
2014-02-20 17:35:09 +01:00
Aditya Bhatt 94d26139ac Overlay the eventTrap outside and over the cursor.
This commit pulls the event trap outside the cursor,
and as a child of the canvas,
and makes the Caret track the cursor's position and
position the trap above the cursor.

This means that there is no need to manually
blur and focus the eventManager whenever an
operation is executed.
2014-02-20 17:35:09 +01:00
Friedrich W. H. Kossebau 52bb0618d7 Fix annotation date being wrongly colored in the color of the annotated text 2014-02-20 13:38:56 +01:00
Jos van den Oever 87872aaccd Make sure frames are visible above the body text. 2014-02-11 12:01:46 +01:00
Philip Peitsch 7732dfae2d Allow selection of empty lists by making editinfo elements inline blocks
Elements that are simply display:inline, but have no visible content can
do strange things to the browser selections in Chrome. They will actually
stop other preceding nodes in the same container from being selectable,
instead causing the selection to climb to the parent container.

Fixes issue #30
2014-02-07 23:54:17 +11:00
Philip Peitsch 121e614e3d Ensure the event trap has a minimum height
0px height elements are not able to receive an active selection in most
browsers. Setting a minimum height ensures the event trap is still able
to be selected when in an empty paragraph.
2014-02-05 21:24:01 +11:00
Philip Peitsch fb6bdda28d Keep event-trap non-inline unless composing text
Inline blocks will cause the browser to allow word-wrapping to occur
either side of the node, an effect that is VERY undesirable for a
caret.

Making the event trap absolute, but expanded to the full height of the
cursor shows the composition menu displays in the same place as if
the trap was an inline-block. The cursor and trap are switched to inline
blocks during composition so the contained characters take up space in
the document.
2014-02-04 00:38:23 +11:00
lli cde721f758 Updated the SessionController to use the same virtual selection in both edit and read only mode. 2013-12-19 10:39:42 +11:00
Philip Peitsch 8b6ef8f6ff Support text input using the OS’s IME system
This change extends the use of the event trap to allow in-line character addition
using the OS's IME. The event trap will now be moved to within the local user's
cursor block, and will become visible when a composition start event is detected.

This has been tested on Chrome, FF & Safari on all platforms. In addition, this
enables support in FF on Android.

Known issues
- No IME support on Chrome under Linux. The compositionend event emitted by Chrome
contains no data, so the input character can't be detected.
2013-12-18 11:05:32 +11:00
Philip Peitsch d38824ad80 Make cursor sub-element CSS styles component-specific
Previous implementation was using the element type (span or div) to
determine if the element was a handle or caret. This is problematic if
additional elements are placed inside the cursor node (as necessary for
proper IME support)
2013-12-18 11:05:31 +11:00
lli dca79408b0 Hyperlink usability improvement
Current behaviour:
Left click causes navigation in both edit and view mode

After the change:
Same as current behaviour in view mode.
In edit mode, left click will just move the cursor to desired position. In order to navigate, user need to hold control key and then click
2013-12-17 17:59:17 +11:00
Aditya Bhatt 30794a6253 Switch to SVG polygons for drawing a SelectionView.
Adds an SVG overlay that takes no pointer-events,
and uses a polygon element inside to it draw
selections with stroke and fill of the user's
color.
Removes the 3 divs used previously.
2013-12-13 00:37:13 +01:00
lli 96cf60649a Make the text:line-break elements behave like <br>
Problem with the dipslay:block.
If we don't set a height for text:line-break, then there is no gaps
between sentences. As block element with no height doesn't take any space.
On the other hand if we do set a height for text:line-break, then all the
line breaks takes an empty line which is not exactly what we like. The
very first one should just end the line.
2013-10-18 16:47:50 +11:00
Friedrich W. H. Kossebau bf6369f63b Use new namespace "urn:webodf:names:helper" also for attribute "containsparagraphanchor" 2013-10-16 18:43:01 +02:00
Philip Peitsch ed80b875ea Only hide the browser selection once edit-mode is enabled
The recent shadow cursor implementation hides the native browser selection
highlights. However, the shadow cursor itself only starts being drawn
after edit-mode is enabled, meaning for a readonly document the selection
is invisible (#119)

This is a simple workaround that allows the native selection to be drawn
in circumstances where the shadow cursor is not active. Long term, the
shadow cursor should be also used on non-editable documents as detailed
in solution ideas for #119.
2013-10-16 21:42:59 +11:00