Commit Graph
186 Commits
Author SHA1 Message Date
Philip Peitsch daff6484cf Enabled direct text styling only if current selection is a text range
Prevents the controller advertising things such as bold and underline
are valid operations for an inline image (they are not!).
2014-09-11 12:00:06 +10:00
Philip Peitsch 1ba2887e4f Provide "real" selection content to aid text2speech tools
Text-to-speech and screen readers use the browser's selection to determine
what the current selected text is. Some browsers (e.g., Safari on OSX) think
the text content of the event trap is the currently selected content, and
only vocalise the letter "b".

Cope with this by serialising the currently selected text to the input
field on redraw. On a 1000 page text-only document, this can add sizeable
performance impact (400ms to execute synchronizeWindowSelection), but
as this only occurs when the cursor is updated, and only once per redraw,
the actual end user impact is reasonably minimal.
2014-08-01 01:07:04 +10:00
Philip Peitsch 7fd4c040dc Split screen editing app
Creates two editor instances within a single web-page, and allows live
collaboration between them.

Key features:
* EASY TO USE (requires no additional setup to run)
* supports client disconnection
* simplistic latency simulation
2014-07-24 23:26:15 +10:00
Philip Peitsch 83adef477c Allow multiple instances of the editor to be created in a single page
Mangle HTML ids in a predictable fashion in dialog widgets to ensure they
do not clash if multiple instances are loaded.
2014-07-24 12:53:06 +10:00
Friedrich W. H. Kossebau 41f8b18ac6 Make sure all toolbar elements are disabled without a session
(and merge any require calls into one per class definition)
2014-07-10 18:19:11 +02:00
Philip Peitsch 6e87083a20 Use the current hyperlink as a placeholder for the display text
This helps clarify that if no display text is specified, the link text
will be used instead.
2014-06-20 23:06:35 +10:00
Philip Peitsch 010dca4f88 Expand selection to cover newly inserted hyperlink
Mimicking LibreOffice's behaviour here, when a new link + associated
display text is inserted, immediately expand the selection to these
bounds.

This change makes add & edit link behaviours consistent, as the complete
hyperlink is always selected after the edit dialog is closed.
2014-06-20 22:22:40 +10:00
Philip Peitsch 41f1491ffc Select and update the current hyperlink when selection is collapsed
When the current selection is collapsed within a hyperlink and an update
occurs, the selection will now be expanded to the hyperlink bounds and
updated.

Fixes #490.
2014-06-20 22:22:39 +10:00
Philip Peitsch 32855365b0 Only calculate hyperlink text just prior to displaying edit dialog
Calculating hyperlink text is extremely expensive. To avoid a lot of
unnecessary work, only calculate the text prior to displaying the edit
dialog.
2014-06-20 22:22:39 +10:00
Philip Peitsch 1edc07bbc4 Re-arrange editorHyperlinks widget code 2014-06-20 22:22:38 +10:00
Philip Peitsch 575fb64ffc Show complete hyperlink text when selection is collapsed 2014-06-20 22:22:38 +10:00
Aditya Bhatt ba180c73b7 Rename isEnabled to enabledFeatures inside DirectFormattingController. 2014-06-18 14:00:37 +02:00
Aditya Bhatt 3d1234aa71 Generate and cache style summary for selections that do not
contain text.

This divides the `isEnabled` information of DirectFormattingController
into two parts, `directTextStyling` and `directParagraphStyling`.

The widgets are accordingly updated.
2014-06-18 13:55:49 +02:00
Friedrich W. H. Kossebau 78a47e0588 Fix hyperlink editor to no longer extract non-odf text for the display text 2014-06-13 11:44:07 +02:00
Friedrich W. H. Kossebau 9d52a5cfec Fix font picker in Editor wrongly keeping fonts of old documents 2014-06-12 13:53:16 +02:00
Aditya Bhatt ed863dcb51 Change widgets that access controllers to cleanly
unsubscribe and subscribe to signals.
2014-06-06 15:11:32 +02:00
Aditya Bhatt b02e11f1cc Make image insertion respect review mode constraints. 2014-06-06 15:11:31 +02:00
Aditya Bhatt 052a3cf04a Move image insertion code from EditorSession to ImageInserter.
This allows access to controllers directly in the widget, as is
the convention.
2014-06-06 15:11:31 +02:00
Aditya Bhatt 58cbeabf19 Make hyperlink editing respect review mode constraints. 2014-06-06 15:11:31 +02:00
Aditya Bhatt 1467ea6d2a Introduce "Review Mode".
Let DirectFormattingController obey this "edit.reviewMode"
constraint by not creating any operations or processing any
action to format text when the cursor is not within the local
user's annotation.

Signals are exposed to toolbar widgets so they may
enable/disable themselves on the fly depending on the cursor
context.
2014-06-06 15:11:29 +02:00
Aditya Bhatt 7c98fbaa8a Do not disable paragraph alignment buttons on image selection. 2014-06-05 14:20:19 +02:00
Friedrich W. H. Kossebau 7f80e8e163 Normalize license headers of editor/benchmark/tests/firefox-addon/viewer source files
* remove @license tag, for consistency with library source files
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released stuff
* separate license header by empty line from following content
2014-06-02 17:49:46 +02:00
Friedrich W. H. Kossebau fb4b2b7ca4 Add about dialog to editor component 2014-05-16 14:57:40 +02:00
Friedrich W. H. Kossebau 27b533e10e attribute style:display-name is only optional, use style:name as fallback for display 2014-04-30 12:03:14 +02:00
Aditya Bhatt 01b3bf5ff2 Fix return type annotation of mappedProperties 2014-04-04 11:39:00 +02:00
Aditya Bhatt 8eee65c2ec Only save style properties which have actually
been modified by the user in the dialog, upon
pressing "OK".
2014-04-04 11:36:44 +02:00
Aditya Bhatt 4e3b2bbc08 Use setStyle whenever selecting a new
style in the dialog.

This requires directly selecting a style
when cloning it, without waiting for onAdd.
2014-04-02 13:03:28 +02:00
Philip Peitsch 82d1d7cd85 Cope with non-cm image dimensions
Style-related operations are slowly being moved towards px as the
default unit to improve consistency. Standardising getContentSize to
work in px rather than cm provides better re-use of CSSUnits as well.
2014-03-27 22:57:44 +11:00
Friedrich W. H. Kossebau 63371ad9dc define size of paragraphstyle dialog internally, not by general css rule on .dijitDialogPaneContent 2014-03-10 18:09:59 +01:00
Aditya Bhatt 887e248b9a Do not fire the zoom slider's onChange
event when programmatically setting the
slider position.
2014-03-04 02:13:12 +01:00
Aditya Bhatt 40158417a7 Make the zoom slider's zoomLevel=1
position centered.
2014-03-04 02:12:56 +01:00
Aditya Bhatt f428ff008f Link the zoom slider to the current zoom level
of the ZoomHelper.
2014-03-03 22:46:51 +01:00
Philip Peitsch 90c5402add Restore focus back to the event trap after clicking the undo button
Partially fixes issue #426.
2014-02-27 13:33:11 +11:00
Philip Peitsch a5011a501f Update undo/redo widget coding style
Widgets no longer use the nested callback approach to instantiation.
2014-02-27 11:12:11 +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
lli 32f148930a Preserve the text style when splitting at the end of paragraph.
At the moment, splitting at the end of the following paragraph
<p style-name="standard">hello <span style-name="bold">world|</span></p>
will create a new paragraph like below
<p style-name="standard">|<span style-name="bold"></span></p>

The cursor is moved out of the span due to empty span is not considered as
a valid cursor position in the current design. this causes newly entered
text are not formatted correctly.

Merged DirectTextStyler and DirectParagraphStyler into
DirectFormattingController. These have become closely related concepts as
a result of changes in this patch.
2014-01-20 22:32:24 +11:00
Aditya Bhatt 5f056eb079 Fix hyperlink UI translations for english. 2013-12-17 13:19:47 +01:00
Friedrich W. H. Kossebau 60626b01dc Fix widget js files to only call runtime.loadClass(...) in the setup method, not at definition time 2013-12-16 23:52:59 +01:00
Philip Peitsch 9ed4ac0db4 Renamed HyperlinkManager to HyperlinkController 2013-12-13 23:35:51 +11:00
lli 353b4b68f1 Added editor buttons for applying or deleting hyperlinks 2013-12-13 17:40:22 +11:00
Aditya Bhatt ca3cb713e7 Do not fire onChange in paragraph styles
dropdown when setting the value programmatically.
2013-11-26 12:23:48 +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
Aditya Bhatt 6a4f0e69ab Add translations support to runtime.js,
and programs/editor/Translator.js which is a reference
implementations of a translator.
The programs/editor/Translator code is used entirely in
localeditor.js/collabeditor.js and the editor itself, or webodf,
and need not know anything about the translation mechanism.

Translate all strings within the editor and all
user-facing strings in webodf core itself using
runtime.tr();
2013-11-05 18:38:41 +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
Friedrich W. H. Kossebau 80e75c6b73 Separate annotation handling logic into a tool class AnnotationManager and UI into a editor/widgets/annotation.js
Also enable "Add annotation" button only if not inside annotations
2013-10-16 17:20:14 +02:00
lli 94ceb41a03 Disable font and paragraph formating toolbar items on the editor when image is selected.
LO/AOO actually hides those options.
2013-10-15 21:42:21 +11:00
Friedrich W. H. Kossebau 094151847f Improve ImageInserter: use img.onload, drop hidden image helper after usage, call onToolDone only when really done 2013-10-07 11:50:36 +02:00
Philip Peitsch 3f6790ef5f Add insert image button to the editor 2013-10-02 16:37:49 +10:00
Aditya Bhatt 30d8bff132 Stop handling keyboard input on the font size picker because dojo does
not yet afford enough control and we want to not let it steal focus.
2013-09-24 16:57:10 +02:00