Jonas Jenwald
68366e31e4
Move the MathClamp helper function to its own file
...
This allows using it in the `src/scripting_api/` folder, without increasing the size of the scripting-bundle by also importing a bunch of unused code.
2026-04-02 11:22:28 +02:00
Calixte Denizet
04272de41d
Add the possibility to save added annotations when reorganizing a pdf (bug 2023086)
2026-03-20 10:55:47 +01:00
Jonas Jenwald
8bbb7c88d3
Change the AnnotationLayer.prototype.getEditableAnnotations method to return an iterator
...
This method is only used with loops, and it should be a tiny bit more efficient to use an iterator directly rather than first iterating through the underlying `Map` to create a temporary `Array` that we finally iterate through at the call-site.
2026-03-09 16:11:21 +01:00
Jonas Jenwald
0c514b008b
Use Response.prototype.bytes() more in the code-base (PR 20651 follow-up)
2026-03-07 15:50:36 +01:00
calixteman
ce5f34ba13
Merge pull request #20780 from wooorm/wooorm/dismiss-popups
...
Add support for dismissing comment popups with click outside
2026-03-04 15:24:29 +01:00
Calixte Denizet
d90530b86c
Add the pages organization actions in the Firefox context menu (bug 2018138)
2026-03-04 09:02:39 +01:00
Titus Wormer
8b4f9048cf
Add support for dismissing comment popups with click outside
...
This solves [bug 1989406](https://bugzilla.mozilla.org/show_bug.cgi?id=1989406 ).
(“The user should be able to dismiss the in-content message displayed by clicking somewhere else in the PDF”)
There’s a good gif there that shows the problematic behavior.
In the thread, there are also mentions of 2 similar but slightly separate problems:
* clicking on another highlight should also dismiss
* the mention that hitting the escape key does not dismiss
I found the last point, the escape key, to work already (first test case here).
But this PR solves the main bug (second test case) and the adjacent one
(third test case).
It works by using the existing `unselectAll` handling.
2026-03-03 11:14:22 +01:00
Calixte Denizet
d755fba96a
Add support for deleting, cutting, copying and pasting pages (bug 2010830, 2010831)
2026-02-18 16:43:00 +01:00
calixteman
45c7805daf
Fix types to make "gulp typestest" succeeding
2026-02-13 22:34:04 +01:00
calixteman
1b20ba5c3f
Ends the current drawing session when closing the tab (bug 2015385)
2026-02-12 22:21:55 +01:00
Jonas Jenwald
50a12e3e67
Remove the IL10n interface
...
Given that we either use the `L10n` class directly or extend it via `GenericL10n`, it should no longer be necessary to keep the interface-definition.
This should help reduce the maintenance burden of the code, since you no longer need to remember to update separate code when touching the `L10n` class.
2026-02-01 17:53:45 +01:00
Tim van der Meij
471adfd023
Merge pull request #20596 from Snuffleupagus/FileSpec-fixes
...
Simplify the `FileSpec` class, and remove no longer needed polyfills
2026-01-29 22:03:38 +01:00
Jonas Jenwald
5b368dd58a
Remove the Uint8Array.prototype.toHex(), Uint8Array.prototype.toBase64(), and Uint8Array.fromBase64() polyfills
...
(During rebasing of the previous patches I happened to look at the polyfills and noticed that this one could be removed now.)
See:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toHex#browser_compatibility
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64#browser_compatibility
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64#browser_compatibility
Note that technically this functionality can still be disabled via a preference in Firefox, however that's slated for removal in [bug 1985120](https://bugzilla.mozilla.org/show_bug.cgi?id=1985120 ).
Looking at the Firefox source-code, see https://searchfox.org/firefox-main/search?q=array.tobase64%28%29&path=&case=false®exp=false , you can see that it's already being used *unconditionally* elsewhere in the browser hence removing the polyfills ought to be fine (since toggling the preference would break other parts of the browser).
2026-01-29 17:27:43 +01:00
Calixte Denizet
806133379e
Refactor a bit page mapping stuff in order to be able to support delete/copy pages
2026-01-26 16:53:52 +01:00
Marco Castelluccio
bdc9323b15
Hide comment popup after redo action
2026-01-22 13:12:13 +01:00
Marco Castelluccio
84d15dc453
Restore date too
2026-01-21 17:06:13 +01:00
Marco Castelluccio
d9f67bd8ee
Bug 1999154 - Add the ability to undo comment deletion
2026-01-21 15:15:40 +01:00
calixteman
8abfd9a797
Avoid exception after having moved an annotation
...
It fixes #20571 .
2026-01-18 21:01:40 +01:00
calixteman
8e2963ccad
Merge pull request #20226 from lab-core/pointer-type-initialization
...
[Editor] Pointer type initialization only when the user changes the mode
2025-12-02 20:55:39 +01:00
calixteman
029cae2ad4
Don't use firstChild/lastChild when getting elements (follow-up of #20447 )
2025-11-22 21:10:32 +01:00
Sachin Iyer
464dae11ac
fix: deleteAnnotationElement takes a full editor object
2025-11-21 11:32:29 -08:00
legraina
396cff5652
Pointer type initialization only when the user changes the mode
...
Clear the pointer type of CurrentPointers outside of the DrawingEditor to always keep the same, until the user changes the mode.
One of the goal is to keep the same pointer type in case of a refresh of the page or if the user changes the pdf document.
2025-11-02 08:56:18 -05:00
calixteman
2cc809ade2
Merge pull request #20213 from lab-core/pointer-type
...
[Editor] A new CurrentPointers class to store current pointers used by the editor
2025-11-01 19:17:32 +01:00
Calixte Denizet
19cbdba434
[Editor] Avoid to have several Undo entries in the context menu (bug 1995705)
2025-10-22 19:45:52 +02:00
legraina
a932804fb5
A new CurrentPointers class to store current pointers used by the editor
...
Move current pointer field of DrawingEditor to CurrentPointer class in tools.js: The pointer types fields have been moved to a CurrentPointer object in tools.js. This object is used by eraser.js and ink.js.
Only reset pointer type when user select a new mode: Clear the pointer type when changing mode, instead of at the end of the session. It seems more stable, as the method is not called this way when the user changes pages. Also, clear the pointer type when the mode is changed by an event (the user changes the editor type), otherwise, the same pointer type is kept (the document is changed for example)
2025-10-21 17:00:08 -04:00
Calixte Denizet
9205305dbb
Add a highlightSpan function in order to simplify a bit the integration tests
2025-10-19 19:37:41 +02:00
Tim van der Meij
bd0bf03a68
Merge pull request #20375 from calixteman/fix_color_copy_paste
...
[Editor] Make sure the color picker has the right color when pasting an editor
2025-10-17 21:05:44 +02:00
Calixte Denizet
97fec3ab81
[Editor] Make sure the color picker has the right color when pasting an editor
2025-10-17 19:37:05 +02:00
Calixte Denizet
18a7a82c29
[Editor] FreeText annotations aren't supposed to have an attached popup so disable commenting for them (bug 1995028)
2025-10-17 18:33:15 +02:00
Calixte Denizet
54ffd860ec
[Editor] Fix the tooltip of the comment button when in the editor toolbar (bug 1994958)
2025-10-17 15:47:55 +02:00
Calixte Denizet
16d0077387
[Editor] Avoid to have a null button in the DOM when there's no comment manager
2025-10-09 09:25:43 +02:00
Calixte Denizet
41dea1e38b
[Editor] Make sure that annotation positions in the DOM respect the visual order (bug 1992770)
2025-10-08 15:11:09 +02:00
Calixte Denizet
5c28346abc
[Editor] Make sure all editors are focusable with the keyboard (bug 1992868)
2025-10-07 21:15:26 +02:00
Calixte Denizet
be987f2fbf
[Editor] Make sure that comment stuff is removed when an editor is deleted (bug 1992987)
2025-10-07 19:09:48 +02:00
Tim van der Meij
68ed5be9ac
[Editor] Remove obsolete arguments for setDims calls in the highlight code
...
The `width` and `height` arguments for `setDims` have been removed in
PR #20285 , but for two calls in the highlight code they remained. This
commit removes them as they are no longer used in the method itself.
Fixes 0722faa9.
2025-10-05 13:52:09 +02:00
Calixte Denizet
12066af578
[Editor] Add a fake annotation (in the annotation layer) associated with an editor in order to be able to show the comment button (bug 1989420)
2025-10-01 09:08:57 +02:00
Calixte Denizet
02ddf277ab
[Editor] Add some telemetry for the commenting feature (bug 1991172)
2025-09-26 21:04:09 +02:00
calixteman
7051fd0215
Merge pull request #20307 from calixteman/bug1990872
...
[Editor] Make sure the selected editor is correctly focused after switching editing mode (bug 1990872)
2025-09-26 09:17:48 +02:00
Calixte Denizet
888df7c319
[Editor] Make sure the selected editor is correctly focused after switching editing mode (bug 1990872)
2025-09-25 22:42:32 +02:00
Calixte Denizet
442932f0b3
[Editor] Move the focus to the comment button once editing is done (bug 1990820)
2025-09-25 20:17:52 +02:00
Calixte Denizet
90e56b706e
[Editor] Add a title to the comment buttons (bug 1990813)
2025-09-25 18:47:49 +02:00
Calixte Denizet
0b40bf1743
[Editor] Update the color and the position of the comment button in reading mode they've been modified
2025-09-24 09:45:37 +02:00
calixteman
48c10d8938
Merge pull request #20285 from calixteman/editor_remove_useless_dim_stuff
...
[Editor] Remove useless computations when setting the dimensions of an editor
2025-09-23 20:26:12 +02:00
calixteman
225b07aa29
Merge pull request #20283 from calixteman/bug1989304
...
[Editor] Make sure the comment dialog is visible on the screen (bug 1989304)
2025-09-23 19:30:28 +02:00
Calixte Denizet
0722faa9ce
[Editor] Remove useless computations when setting the dimensions of an editor
...
And remove an unused functions AnnotationEditor::setAspectRatio/fixDims.
2025-09-19 18:08:56 +02:00
Calixte Denizet
623d422ddb
[Editor] Make sure the comment dialog is visible on the screen (bug 1989304)
2025-09-18 21:23:42 +02:00
Calixte Denizet
cbc5241b53
[Editor] Make sure to not add extra editors when showing again a destroyed page
2025-09-18 15:18:50 +02:00
Tim van der Meij
d85fd12437
Merge pull request #20274 from calixteman/save_comment_reading_mode
...
[Annotation] Save the comment changes made in reading mode (bug 1987427)
2025-09-15 23:32:51 +02:00
Calixte Denizet
764c2e639c
[Editor] Fix the position of the comment popup and its dialog
...
Only fix the popup position if the user didn't change it.
And don't adjust the dialog position since it should have the same as the popup.
2025-09-15 21:26:36 +02:00
Calixte Denizet
5feb4674d6
[Annotation] Save the comment changes made in reading mode (bug 1987427)
2025-09-15 19:49:49 +02:00