4960 Commits

Author SHA1 Message Date
Tim van der Meij
44a63549b0
Merge pull request #20831 from calixteman/internal_viewer
Add a new internal viewer to explore the structure of PDF files.
2026-03-10 20:48:40 +01:00
Tim van der Meij
bf20d3c7e8
Merge pull request #20838 from calixteman/bug2021886
Avoid to have a thumbnail with two paste buttons (bug 2021886)
2026-03-10 20:21:34 +01:00
Tim van der Meij
99dcb88dac
Merge pull request #20834 from calixteman/update_context_menu
Update the context menu after copying thumbnails
2026-03-10 20:15:51 +01:00
Tim van der Meij
0dce6f40d2
Merge pull request #20839 from calixteman/bug2020698
Fix the border & background colors of the placeholder for a dragged thumbnail (bug 2020698)
2026-03-10 20:14:05 +01:00
Jonas Jenwald
bfa2753f3c Remove the "abort" listener, on the globalAbortSignal, in the web/sidebar.js file
This is consistent with a bunch of other viewer code, since an `AbortSignal` can only be aborted once any "abort" listeners can thus be removed when invoked.
2026-03-10 15:51:10 +01:00
Calixte Denizet
ad7a415220
Fix the border & background colors of the placeholder for a dragged thumbnail (bug 2020698) 2026-03-09 20:47:39 +01:00
Calixte Denizet
645ef08764
Avoid to have a thumbnail with two paste buttons (bug 2021886) 2026-03-09 19:10:12 +01:00
Calixte Denizet
210b859a54
Update the context menu after copying thumbnails 2026-03-09 15:36:22 +01:00
Calixte Denizet
18a05354fb
Fix the label and tooltip on the paste buttons 2026-03-09 14:21:15 +01:00
calixteman
9d81fafa8c
Add a new internal viewer to explore the structure of PDF files.
The one from pdf.js.utils is a bit too old: a lot of bugs have been fixed
in the code that parses PDF files since then.
It's just an internal development tool, so it doesn't need to be perfect,
but it should be good enough to be useful.
2026-03-09 14:16:12 +01:00
Calixte Denizet
0e48c16c3c
Add a UI to undo cut/delete and cancel a copy (bug 2021352, bug 2010832)
This happens in a bar on top of the thumbnails sidebar.
The label depending on the selected thumbnails is fixed.
2026-03-09 10:44:11 +01:00
Jonas Jenwald
1f69cf964c Ensure that percent === NaN is consistently reported by the onProgress callback
With these changes `0`, `NaN`, `null`, and `undefined` in the `total`-property all result in `percent === NaN` being reported by the callback, since previously e.g. `0` would result in `percent === 100` being reported unconditionally which doesn't make a lot of sense.

Also, remove the "indeterminate" loadingBar (in the viewer) if the `PDFDocumentLoadingTask` fails since there won't be any more data arriving and displaying the animation thus seems wrong.
2026-03-08 10:21:55 +01:00
Calixte Denizet
d489ad0b5b
Once a page has been deleted or pasted, make sure the focus stays in the sidebar (bug 2020731) 2026-03-05 21:52:12 +01:00
Tim van der Meij
d3e04d29ac
Merge pull request #20798 from calixteman/bug2016437
Fix the position of the thumbnails on the last line (bug 2016437)
2026-03-05 21:19:39 +01:00
Tim van der Meij
874ba23afc
Merge pull request #20802 from calixteman/rm_sidebar_resize_observer
Remove the sidebar resize observer when killing the UI
2026-03-05 20:39:28 +01:00
Tim van der Meij
60a0e24605
Merge pull request #20792 from calixteman/bug2020758
Add some aria-labels to the paste button in order to know where the buttons are (bug 2020758)
2026-03-05 20:32:20 +01:00
Tim van der Meij
a8d1aa9db8
Merge pull request #20797 from calixteman/bug2020774
Fix few colors in the Manage menu in HCM (bug 2020774)
2026-03-05 20:29:44 +01:00
Tim van der Meij
2463f4dc73
Merge pull request #20794 from calixteman/bug2020737
Move the heading role on the sidebar label (bug 2020737)
2026-03-05 20:29:07 +01:00
Tim van der Meij
cbc0362357
Merge pull request #20787 from Snuffleupagus/improve-PdfTextExtractor
Improve and simplify the `PdfTextExtractor` implementation
2026-03-05 20:23:23 +01:00
Calixte Denizet
dd52343d58
Fix downloading the current pdf 2026-03-05 13:05:03 +01:00
Calixte Denizet
1ac5dfeba8 Remove the sidebar resize observer when killing the UI 2026-03-05 09:51:35 +01:00
Calixte Denizet
7f76a111c4
Fix the position of the thumbnails on the last line (bug 2016437)
The original issue can only be reproduce when the thumbnails are on two lines.
The fix is just a matter of computing the number of elements on the last line once we've
finished the first line.
2026-03-04 17:30:10 +01:00
Calixte Denizet
f9c50bb7ce
Fix few colors in the Manage menu in HCM (bug 2020774) 2026-03-04 16:47:48 +01:00
Calixte Denizet
f6401e4344
Move the heading role on the sidebar label (bug 2020737) 2026-03-04 15:25:11 +01:00
Calixte Denizet
18bafeb1c6
Add some aria-labels to the paste button in order to know where the buttons are (bug 2020758) 2026-03-04 10:32:57 +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
calixteman
68cca32e20
Merge pull request #20785 from calixteman/extract_pages
Add a way to extract some pages from a pdf (bug 2019682)
2026-03-04 08:44:13 +01:00
Calixte Denizet
27aea732a2
Fix the paste button position and add a button before the first thumbnail 2026-03-03 21:46:51 +01:00
Calixte Denizet
a474e81b8a
Add a way to extract some pages from a pdf (bug 2019682)
The user has to select some pages and then click on the "Save As" menu item in the Manage menu.
If they modify the structure of the pdf (deleted, moved, copied pages), they have to use the usual
save button.
2026-03-03 21:39:13 +01:00
calixteman
973add845f
Merge pull request #20779 from calixteman/fix_sidebar_css
Fix layout of thumbnails when split/merge is disabled
2026-03-03 16:19:03 +01:00
Jonas Jenwald
c70ff5a7c0 Improve and simplify the PdfTextExtractor implementation
Working on PR 20784, I couldn't help noticing that this code can be improved a little bit.

 - Only initialize `PdfTextExtractor` in development mode and MOZCENTRAL builds, since it's unused elsewhere.

 - Re-factor how `PdfTextExtractor` waits for the viewer to be available/ready, by using existing (internal) events.
   This simplifies the `PdfTextExtractor` class and removes its `setViewer` method, which improves general consistency since normally the viewer-components don't use such a method in that way (here it was effectively used as a stand-in for a `setDocument` method).

 - Finally, while slightly unrelated, rename the `#getAllTextInProgress` field in the `PDFViewer` class to `#copyAllInProgress` to clearly indicate what it's for since the `getAllText` method is used more generally now.
2026-03-03 15:51:08 +01:00
Jonas Jenwald
54a8c049fd Prevent PdfTextExtractor.prototype.extractTextContent from failing intermittently
Given that extracting all text can take a while to complete, especially in long PDF documents[1], it's technically possible for the user to "select all", copy, and finally abort copying (with the `Esc` key) while `PdfTextExtractor.prototype.extractTextContent` is still running.
If that happens the `PDFViewer.prototype.getAllText` code would be interrupted, and text-extraction would thus fail in an intermittent and (likely) hard to debug way. To avoid this we replace the current "global" interrupt handling with an optional `AbortSignal` instead.

---

[1] See e.g. `pdf.pdf` in the test-suite.
2026-03-03 11:55:33 +01:00
Calixte Denizet
cdc1c8af40
Fix layout of thumbnails when split/merge is disabled 2026-03-02 15:16:16 +01:00
calixteman
d859d78bb5
Merge pull request #20775 from Snuffleupagus/hide-select-pages
Hide the "Select pages" label, in the thumbnails sidebar, when split-merge is disabled
2026-03-02 14:53:15 +01:00
Jonas Jenwald
0d131f0957 Use L10n.prototype.getDirection rather than querying the DOM, when initializing the CommentManager instance
Hopefully I'm not misunderstanding why it was written like that, however using an existing method should be a tiny bit more efficient than querying the DOM.
2026-03-02 11:33:34 +01:00
Jonas Jenwald
a0e70eb6aa Hide the "Select pages" label, in the thumbnails sidebar, when split-merge is disabled
Currently there's a "pointless" label displayed, thus taking up vertical space, when `enableSplitMerge = false` is set.
2026-03-02 11:19:02 +01:00
Tim van der Meij
5279646985
Merge pull request #20751 from calixteman/bug2016693
Avoid to scroll too much when the thumbnail is at the bottom of the sidebar (bug 2016693)
2026-03-01 21:14:44 +01:00
Tim van der Meij
e0ea84fdac
Merge pull request #20761 from calixteman/tweak_dims
Tweak few elements: dimensions and the checkbox color in the new sidebar
2026-03-01 20:01:07 +01:00
Tim van der Meij
9dfcc62bb9
Merge pull request #20758 from calixteman/fix_sidebar_height
Fix the page sidebar height
2026-03-01 19:58:18 +01:00
calixteman
00d9d3a6ea
Merge pull request #20742 from Snuffleupagus/tree-viewer-scrollIntoView
Fix scrolling of outline item into view (PR 20495 follow-up)
2026-03-01 13:01:21 +01:00
Calixte Denizet
c272cbdf5a
Tweak few elements: dimensions and the checkbox color in the new sidebar 2026-02-27 18:36:38 +01:00
Calixte Denizet
aa928105b4
Fix tooltips on thumbnails and checkbox (bug 2019714)
And fix an issue with some integration tests where the manage button was disabled (hence not in the tab cycle).
2026-02-27 17:43:27 +01:00
calixteman
45b0f8b05e
Merge pull request #20748 from calixteman/add_file_button
Make the 'add file' button not hidden but just not visible in order to fix the layout
2026-02-27 17:34:53 +01:00
Calixte Denizet
a251b99e2b
Make the 'add file' button not hidden but just not visible in order to fix the layout
The feature will be plugged later.
2026-02-27 16:53:30 +01:00
Calixte Denizet
79942b7720
Fix the page sidebar height
It has to be the viewer height but with a padding of 8px.
2026-02-27 16:13:14 +01:00
Calixte Denizet
4b7fa1c003 Avoid to scroll too much when the thumbnail is at the bottom of the sidebar (bug 2016693) 2026-02-26 22:30:13 +01:00
Tim van der Meij
f626a368a5
Merge pull request #20743 from calixteman/bug2010822
Tweak the background color of the sidebar (bug 2010822)
2026-02-26 22:01:50 +01:00
Tim van der Meij
52efe65f12
Merge pull request #20741 from calixteman/fix_resizer_position
Slightly move the resizer on the sidebar (bug 2019585)
2026-02-26 22:00:32 +01:00
Tim van der Meij
f05caaf5e9
Merge pull request #20731 from calixteman/remove_page_id
Remove useless page-id attribute in thumbnails
2026-02-26 21:58:36 +01:00
calixteman
881f9779e6
Don't check for surrogates when verifying the chars to normalize 2026-02-26 16:46:34 +01:00