6338 Commits

Author SHA1 Message Date
calixteman
fb9e438442
Merge pull request #17781 from calixteman/stamp_altext_button_cp
[Editor] Make sure the alt-text button is there when pasting an image from an other tab
2024-03-07 21:44:53 +01:00
Calixte Denizet
0f8dda1af0 [Editor] Make sure the alt-text button is there when pasting an image from an other tab 2024-03-07 18:24:34 +01:00
Calixte Denizet
39aeea3e94 [Editor] Add a toggle button to show/hide all the highlights (bug 1867740) 2024-03-07 13:16:59 +01:00
calixteman
9ee4c6528d
Merge pull request #17776 from calixteman/bug1883609
[Annotations] Widget annotations must be in front of the other ones (bug 1883609)
2024-03-06 10:53:11 +01:00
Calixte Denizet
4e1b96c781 [Annotations] Widget annotations must be in front of the other ones (bug 1883609) 2024-03-05 19:04:58 +01:00
Calixte Denizet
bd5875d066 [Editor] Let a free highlight be clipped when its bounding box exceeds the page limits (bug 1883632) 2024-03-05 16:47:07 +01:00
calixteman
c451b6d684
Merge pull request #17764 from calixteman/telemetry_null_stats
[Editor] Use a null instead of an empty stats object when sending the telemetry
2024-03-04 19:16:57 +01:00
calixteman
a55f976e2e
Merge pull request #17766 from calixteman/escape_color_picker
[Editor] Unselect highlight editor when pressing Escape when the focus is on the color picker without a dropdown menu
2024-03-04 19:16:34 +01:00
Calixte Denizet
ecb4262b13 [Editor] Set the creation method for free highlights to 'main_toolbar' (bug 1883394) 2024-03-04 16:58:50 +01:00
Calixte Denizet
1859412507 [Editor] Unselect highlight editor when pressing Escape when the focus is on the color picker without a dropdown menu 2024-03-04 16:32:09 +01:00
Calixte Denizet
d096dc79b2 [Editor] Use a null instead of an empty stats object when sending the telemetry 2024-03-04 10:18:24 +01:00
calixteman
29c493d36b
Merge pull request #17760 from calixteman/fix_quadpoints
[Editor] Fix the quadpoints value when serializing an highlight annotation
2024-03-01 13:08:44 +01:00
Calixte Denizet
30101cbb31 [Editor] Fix the quadpoints value when serializing an highlight annotation
The coordinates of each point in a box are in the page coordinates system.
2024-03-01 11:36:16 +01:00
Jonas Jenwald
61036383b5
Merge pull request #17710 from Snuffleupagus/pr-17277-followup
Simplify the `XMLHttpRequest`-branch in the `fetchData` helper function (PR 17277 follow-up)
2024-03-01 10:23:02 +01:00
Calixte Denizet
7af90bb8bc [Editor] Enable the thickness input when no editors are selected (bug 1881219) 2024-02-29 23:05:33 +01:00
Calixte Denizet
f52bf2836f [Editor] Make the delete button clickable with the space key (bug 1882248) 2024-02-29 19:05:38 +01:00
Calixte Denizet
a9f47e87d5 [Editor] Add the possibility to move the caret with the keyboard once an highlight has been made (bug 1881684) 2024-02-29 18:18:13 +01:00
Jonas Jenwald
a92b38e71c Inline the HighlightEditor.#telemetryType getter at its only call-site (PR 17748 follow-up) 2024-02-28 20:47:01 +01:00
Calixte Denizet
3a7e638fce [Editor] Count the colors used when highlighting whatever the highlight kind is 2024-02-28 18:24:24 +01:00
calixteman
07abd647f4
Merge pull request #17737 from calixteman/highlight_telemetry
[Editor] Add some telemetry for the highlight feature (bug 1866437)
2024-02-28 15:20:57 +01:00
Calixte Denizet
65342d2bee [Editor] Add some telemetry for the highlight feature (bug 1866437) 2024-02-28 10:17:11 +01:00
Calixte Denizet
e0b843d991 Always add links in the annotation layer
Fixes #17730.
2024-02-27 22:48:08 +01:00
calixteman
ca4ab064e5
Merge pull request #17720 from calixteman/editor_simplify_highlighting
[Editor] In caret browsing mode, allow to select in pressing shift and arrow down (bug 1881802)
2024-02-25 17:52:11 +01:00
Calixte Denizet
0520f2f0cb [Editor] In caret browsing mode, allow to select in pressing shift and arrow down (bug 1881802)
In implementing caret browsing mode in pdf.js, I didn't notice that selectstart isn't always triggered.
So this patch removes the use of selectstart and rely only on selectionchange.
In order to simplify the selection management, the selection code is moved in the AnnotationUIManager:
 - it simplifies the code;
 - it allows to have only one listener for selectionchange instead of having one by visible page
   for selectstart.
I had to add a delay in the integration tests for highlighting (there's a comment with an explanation),
it isn't really nice, but it's the only way I found and in real life there always is a delay between
press and release.
2024-02-25 15:35:30 +01:00
Calixte Denizet
fe41e789de Fix the string GlobalConstants.IDS_INVALID_DATE 2024-02-23 21:39:06 +01:00
Jonas Jenwald
346efe919a
Merge pull request #17718 from Snuffleupagus/hexNumbers-tweak
Tweak how the `hexNumbers` Array, used by `Util.makeHexColor`, is built
2024-02-23 18:17:10 +01:00
Calixte Denizet
e1f6f5179f [Editor] Add the possibility to create an highlight from the context menu when some text is selected (bug 1867739) 2024-02-23 16:18:03 +01:00
Jonas Jenwald
49a2aff532 Tweak how the hexNumbers Array, used by Util.makeHexColor, is built
*Please note:* This is a micro optimization, hence I fully understand if the patch is rejected.

Currently we create two temporary Arrays and have to iterate twice in total when building the final `hexNumbers` Array.
With this patch there's only one temporary Array and a single iteration required to build the final `hexNumbers` Array.
2024-02-23 14:20:53 +01:00
Jonas Jenwald
33c5ef349e Simplify the XMLHttpRequest-branch in the fetchData helper function (PR 17277 follow-up) 2024-02-21 23:00:24 +01:00
calixteman
72b8b29147
Merge pull request #17701 from calixteman/alt_text_ai
[Editor] Add the possibility to query some ML stuff to guess an alt text for an image
2024-02-21 10:14:40 +01:00
Calixte Denizet
46416bb131 [Editor] Add the possibility to query some ML stuff to guess an alt text for an image
It's only for an experimental purpose.
2024-02-20 21:29:33 +01:00
Calixte Denizet
95f9bedc7c [Editor] Disable annotation layer when highlighting (bug 1868759)
When highlighting, the annotation editor layer is disabled to get pointer events
from the text layer, but the annotation layer must be then disabled either in
order to avoid bad interactions.
2024-02-20 21:17:05 +01:00
calixteman
70015ffe6b
Merge pull request #17688 from calixteman/editor_no_scroll_unselect
[Editor] Avoid to scroll when an editor is unselected
2024-02-20 17:00:43 +01:00
Calixte Denizet
a6eadf8150 Avoid to access to a missing cidSystemInfo property
Fixes #17689.
2024-02-19 09:55:23 +01:00
Calixte Denizet
c2fcc66302 [Editor] Avoid to scroll when an editor is unselected 2024-02-18 19:21:45 +01:00
Jonas Jenwald
a7bcc81eb1 Add a dummy beginMarkedContentProps operator when optional content parsing fails (issue 17679) 2024-02-17 13:45:16 +01:00
calixteman
a83a8d7e4f
Merge pull request #17674 from calixteman/issue17671
Fix the endoffset of the last glyph when it's followed by a null offset in the loca table
2024-02-15 10:19:55 +01:00
Calixte Denizet
fcad3718f0 Fix the endoffset of the last glyph when it's followed by a null offset in the loca table
It fixes #17671.
2024-02-14 17:20:04 +01:00
Calixte Denizet
2133da166e When updating, write the xref table in the same format as the previous one (bug 1878916)
The specs are unclear about what kind of xref table format must be used.
In checking the validity of some pdfs in the preflight tool from Acrobat
we can guess that having the same format is the correct way to do.
The pdf in the mentioned bug, after having been changed, wasn't correctly
displayed in neither Chrome nor Acrobat: it's now fixed.
2024-02-13 14:14:37 +01:00
Jonas Jenwald
e60329cea1
Merge pull request #17666 from Snuffleupagus/issue-17665
Skip any whitespace after the first object in linearized PDFs (issue 17665)
2024-02-13 12:39:36 +01:00
Jonas Jenwald
37e98e39f6 Skip any whitespace after the first object in linearized PDFs (issue 17665)
This way the code is now consistent with the non-linearized branch in the `PDFDocument.startXRef` getter.
2024-02-12 22:05:36 +01:00
calixteman
05b035602e
Merge pull request #17664 from calixteman/bug1879281
[Editor] Ends a free highlight where the mouse pointer is (bug 1879281)
2024-02-12 18:39:18 +01:00
Calixte Denizet
750b8e328a [Editor] Ends a free highlight where the mouse pointer is (bug 1879281) 2024-02-12 17:26:33 +01:00
Calixte Denizet
de1985abbb [Editor] Set rotated free highlight at the right position after having changed its thickness (bug 1879108) 2024-02-11 21:06:56 +01:00
calixteman
f15b4b34fd
Merge pull request #17650 from calixteman/editor_highlight_keyboard
[Editor] Add a way to highlight text in using the keyboard (bug 1877426)
2024-02-11 18:52:37 +01:00
Calixte Denizet
b5e446213e [Editor] Disable the thickness slider for non-free highlight 2024-02-09 22:54:53 +01:00
Calixte Denizet
8fc6c5c8a6 [Editor] Add a way to highlight text in using the keyboard (bug 1877426) 2024-02-09 22:52:24 +01:00
Calixte Denizet
8d61fc1fde [Editor] Compute the position of the last point before applying rotation (bug 1879113) 2024-02-08 21:08:24 +01:00
Calixte Denizet
c4ac7eef95 [Editor] Correctly rotate the mask when rotation a free highlight (bug 1879102) 2024-02-08 15:29:29 +01:00
Jonas Jenwald
06cd278808 Simplify the signature of the PDFDataTransportStream constructor
Given that we need to pass in a `PDFDataRangeTransport`-instance a number of the needed parameters can be obtained from it, rather than having to specify them manually.
2024-02-03 13:10:42 +01:00