Commit Graph

586 Commits

Author SHA1 Message Date
Calixte Denizet
31ae3a4ba0 Change 'Current View' to 'Current Page' in the secondary toolbar
Content Design team (UX) proposed this change.
2023-01-19 09:54:25 +01:00
Jonas Jenwald
cbf9843a79 Update l10n files 2023-01-15 10:43:46 +01:00
Jonas Jenwald
3b02d23ce2 Update l10n files 2022-12-25 12:59:37 +01:00
Jonas Jenwald
6aa8c3bd3f Update l10n files 2022-11-27 10:22:14 +01:00
Jonas Jenwald
b85ce7f761 Update l10n files 2022-11-13 21:32:12 +01:00
Jonas Jenwald
571a986496 Update l10n files 2022-10-29 11:34:45 +02:00
Jonas Jenwald
03775917db Update the l10n-strings for the download-buttons (bug 1662416)
According to https://bugzilla.mozilla.org/show_bug.cgi?id=1662416#c8
2022-10-24 18:29:44 +02:00
Jonas Jenwald
db215fe289 Update l10n files 2022-10-16 09:39:00 +02:00
Jonas Jenwald
2f238a11c1 Stop localizing error *details* in the viewer (PR 15533 follow-up)
While it can't hurt to localize the main error-messages, also localizing the error *details* has always seemed somewhat unnecessary since those are only intended for debugging/development purposes. However, I can understand why that's done since the GENERIC viewer used to expose this information in the UI; via the `errorWrapper` UI that's removed in PR 15533.

At this point, when any errors are simply logged in the console, it no longer seems necessary to keep localizing the error *details* in the default viewer.
2022-10-06 13:09:39 +02:00
Tim van der Meij
beff913813
Merge pull request #15533 from Snuffleupagus/rm-errorWrapper
[GENERIC viewer] Remove the `errorWrapper` UI
2022-10-01 19:07:28 +02:00
Tim van der Meij
9525bfaa66
Update translations to the most recent versions 2022-10-01 18:07:44 +02:00
Jonas Jenwald
75e06fddf1 [GENERIC viewer] Remove the errorWrapper UI
In the Firefox PDF Viewer this has never been used, with the error message simply printed in the web-console, and (somewhat) recently we've also updated the viewer code to avoid bundling the relevant code there. Furthermore, in the Firefox PDF Viewer we're not even display the *browser* fallback bar any more; see https://bugzilla.mozilla.org/show_bug.cgi?id=1705327.

Hence it seems slightly strange to keep this UI around in the GENERIC viewer, and this patch proposes that we simply remove it to simplify/unify the relevant code in the viewer. In particular this also allows us to remove a couple of l10n-strings, which have always been unused in the Firefox PDF Viewer.
2022-10-01 17:35:35 +02:00
Jonas Jenwald
1a04a38a06 Update l10n files 2022-09-18 10:34:53 +02:00
Jonas Jenwald
a65cc8d26d Update l10n files 2022-09-04 10:16:40 +02:00
Calixte Denizet
b8fa789022 [Editor] Update some strings (bug 1787299) 2022-09-01 18:02:17 +02:00
Jonas Jenwald
19182d5f25 [editor] Remove the editorNone toolbar button (bug 1787295) 2022-08-26 09:25:05 +02:00
Jonas Jenwald
635db46b0d Update l10n files 2022-08-21 10:04:47 +02:00
Jonas Jenwald
38cf588eee Update l10n files 2022-08-07 10:22:40 +02:00
Jonas Jenwald
635bd12050 Update l10n files 2022-07-31 10:23:00 +02:00
Calixte Denizet
a85359b031 [Editor] Simplify the strings for the tools in the UI 2022-07-28 10:02:59 +02:00
Calixte Denizet
7831a100b3 [Editor] Add the possibility to change line opacity in Ink editor 2022-07-27 18:46:25 +02:00
Jonas Jenwald
ca9172ddec Update l10n files 2022-07-24 08:56:47 +02:00
Calixte Denizet
624b26e1de [Editor] Improve a11y for newly added element (#15109)
- In the annotationEditorLayer, reorder the editors in the DOM according
  the position of the elements on the screen;
- add an aria-owns attribute on the "nearest" element in the text layer
  which points to the added editor.
2022-07-19 18:52:17 +02:00
Jonas Jenwald
e4a7264564 Update l10n files 2022-07-10 10:45:22 +02:00
Calixte Denizet
ae2cf7e1e7 [Editor] Update the id for a l10n string 2022-07-04 10:18:42 +02:00
Jonas Jenwald
44a75c2a0f [editor] Slightly shorten the en-US freetext_default_content placeholder text
Now that it's possible to change the font-size, this placeholder string feels a little bit long (especially for larger font-sizes).

Given that Editing is not enabled/released yet, I hope that it should be fine to update this without changing the l10n-id.
2022-06-29 11:40:54 +02:00
Calixte Denizet
1a3ef2a0aa [editor] Add some UI elements in order to set font size & color, and ink thickness & color 2022-06-28 12:05:04 +02:00
Tim van der Meij
f7d69aab15
Update translations to the most recent versions 2022-06-25 15:45:55 +02:00
Jonas Jenwald
17d2380824 Update l10n files 2022-06-12 14:05:41 +02:00
Calixte Denizet
c161a86ba1 [editor] Add an Ink editor
- Approximate the drawn curve by a set of Bezier curves in using
  js code from https://github.com/soswow/fit-curves.
  The code has been slightly modified in order to make the linter
  happy.
2022-06-09 19:35:59 +02:00
Jonas Jenwald
51bf928061 [editor] A couple of small FreeText-related fixes (PR 14976 follow-up)
- Ensure that the modified-warning won't be displayed, when navigating away from the viewer, if the user has added custom Annotations and then *removed all* of them.
 - Ensure that the *initial* editor-buttons state, i.e. the `toggled`-class, is correctly displayed in the toolbar when then viewer loads.
 - Tweak the CSS-classes for the editor-buttons, such that they use the correct focus/hover-rules (similar to the sidebar-buttons).
 - Remove a no longer accurate comment from the `BaseViewer.annotationEditorMode`-setter.
 - Address a couple of *smaller* outstanding review comments, including some re-formatting changes, from PR 14976.
2022-06-04 21:48:11 +02:00
Calixte Denizet
be1aa11986 [edition] Add a FreeText editor (#14970)
- add a basic UI to edit some text in a pdf;
- an editor can be moved, suppressed, cut, copied, pasted, selected;
- add an undo/redo manager.
2022-06-04 18:20:11 +02:00
Jonas Jenwald
db029e17b3 Update l10n files 2022-05-29 09:48:14 +02:00
Jonas Jenwald
54080b6884 Update l10n files 2022-05-15 09:12:37 +02:00
Tim van der Meij
58fed00bc3
Update translations to the most recent versions 2022-05-01 13:10:20 +02:00
Jonas Jenwald
0c086467a9 Update l10n files 2022-04-17 10:25:20 +02:00
Tim van der Meij
312595eb47
Update translations to the most recent versions 2022-04-02 19:43:34 +02:00
Jonas Jenwald
579ff9459e Update l10n files 2022-03-20 10:59:15 +01:00
Jonas Jenwald
114d5e68af Update l10n files 2022-03-06 10:45:24 +01:00
Jonas Jenwald
21f1d1ace2 Update l10n files 2022-02-20 10:10:21 +01:00
Jonas Jenwald
86949cc930 Update l10n files 2022-02-06 11:34:26 +01:00
Jonas Jenwald
cd7fe27468 [GENERIC viewer] Use consistent casing, for the labels, in the findbar
Note that the *browser* findbar in Firefox uses "Title Case" for the labels, and it thus seem like a good idea to ensure that `PDFFindBar` in consistent with that.
Furthermore, the new label added in PR #13261 uses the "Title Case" format which means that currently the default viewer findbar looks inconsistent.

*Please note:* Based on the official Firefox localization docs, see https://firefox-source-docs.mozilla.org/l10n/overview.html#string-updates, changing only the casing should *not* require updating the key:
> 1) If the change is minor, like fixing a spelling error or case, the developer should update the en-US translation without changing the l10n-id.
2022-02-05 11:18:20 +01:00
Calixte Denizet
1f41028fcb Support search with or without diacritics (bug 1508345, bug 916883, bug 1651113)
- get original index in using a dichotomic seach instead of a linear one;
  - normalize the text in using NFD;
  - convert the query string into a RegExp;
  - replace whitespaces in the query with \s+;
  - handle hyphens at eol use to break a word;
  - add some \s* around punctuation signs
2022-02-03 15:42:55 +01:00
Jonas Jenwald
4f03f2a3a7 Update l10n files 2022-01-23 11:00:06 +01:00
Jonas Jenwald
365538a383 Update l10n files 2022-01-09 11:32:34 +01:00
Jonas Jenwald
ea55e8bf41 Update l10n files 2021-12-26 11:19:19 +01:00
Tim van der Meij
c5847141b4
Update translations to the most recent versions 2021-12-11 19:44:52 +01:00
Jonas Jenwald
37bed4ea45 Update l10n files 2021-11-28 11:14:03 +01:00
Jonas Jenwald
c47f5e81fe Update l10n files 2021-11-14 10:48:50 +01:00
Jonas Jenwald
822856e044 Update l10n files 2021-10-31 09:56:41 +01:00
Jonas Jenwald
ee800a064a Update l10n files 2021-10-17 11:49:08 +02:00
Jonas Jenwald
511458fbbc Add a new Page scrolling mode (issue 2638, 8952, 10907)
This implements a new Page scrolling mode, essentially bringing (and extending) the functionality from `PDFSinglePageViewer` into the regular `PDFViewer`-class. Compared to `PDFSinglePageViewer`, which as its name suggests will only display one page at a time, in the `PDFViewer`-implementation this new Page scrolling mode also support spreadModes properly (somewhat similar to e.g. Adobe Reader).

Given the size and scope of these changes, I've tried to focus on implementing the basic functionality. Hence there's room for further clean-up and/or improvements, including e.g. simplifying the CSS/JS related to PresentationMode and implementing easier page-switching with the mouse-wheel/arrow-keys.
2021-10-12 13:45:15 +02:00
Jonas Jenwald
65118bc04d Update l10n files 2021-10-03 08:33:21 +02:00
Jonas Jenwald
32ad677f9c Update l10n files 2021-09-19 09:43:15 +02:00
Jonas Jenwald
a6f8591cc2 Update l10n files 2021-09-05 10:01:23 +02:00
Jonas Jenwald
ab06773758 Update l10n files 2021-08-22 10:43:02 +02:00
Jonas Jenwald
d24476e02c Update l10n files 2021-08-08 10:52:26 +02:00
Jonas Jenwald
aad0316137 Update l10n files 2021-07-25 10:31:40 +02:00
Jonas Jenwald
c9ed65a0c4 Update l10n files 2021-07-11 12:25:54 +02:00
Jonas Jenwald
0326c05db0 Update l10n files 2021-06-27 10:31:06 +02:00
Jonas Jenwald
59f72bbde1 Update l10n files 2021-06-13 10:35:58 +02:00
Jonas Jenwald
0bfd99ae98 Update l10n files 2021-05-30 08:02:55 +02:00
Jonas Jenwald
30908451b4 Update l10n files 2021-05-16 11:44:05 +02:00
Jonas Jenwald
809cb1de4d Update l10n files 2021-05-02 09:38:15 +02:00
Jonas Jenwald
d3ed3761bc Update l10n files 2021-04-18 11:24:51 +02:00
Jonas Jenwald
7d7a8a1a3c [GENERIC viewer] Don't display the errorWrapper, for documents with signatures (PR 13217 follow-up)
According to a decision by UX and PM, please see https://bugzilla.mozilla.org/show_bug.cgi?id=1705060#c2, in Firefox we should first of all *not* display the notification-bar for signatures. Secondly, as can also be seen there, we shouldn't display the notification-bar *at all* and it's thus disabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1705327.

If we purposely don't display a notification, for documents with signatures, in the *built in* Firefox PDF Viewer then it cannot be necessary in the GENERIC viewer either.
2021-04-16 09:53:59 +02:00
Jonas Jenwald
52494be545 [GENERIC viewer] Display a warning message, using the errorWrapper, for documents with signatures (PR 13214 follow-up, issue 13215)
To simplify the overall implementation, given that it only applies to the GENERIC-viewer, this patch purposely re-uses the existing `errorWrapper`-functionality to display the message.
While that one is mostly intended for actual *errors*, by re-using it here we considerably reduce the amount of code/complexity necessary for supporting this new warning. It's obviously possible to re-factor/improve this later on, but the patch should do just fine here since it'll indeed inform users (of the GENERIC-viewer) about unverified signatures.

Finally this patch also tweaks the background-color of the `errorWrapper`, making it 20 percent lighter respectively darker (depending on the theme) to make it "stand out" a little bit *less*.[1] While it may perhaps be useful to re-style/re-factor the `errorWrapper`, this patch probably isn't the right place for doing that.

---
[1] Note how in the MOZCENTRAL-viewer, which instead uses the browser notification-bar, we're purposely using a neutral colour to not draw too much attention to the notification-bar.
2021-04-11 12:46:17 +02:00
Calixte Denizet
5875ebb1ca Display widget signature
- but don't validate them for now;
  - Firefox will display a bar to warn that the signature validation is not supported (see https://bugzilla.mozilla.org/show_bug.cgi?id=854315)
  - almost all (all ?) pdf readers display signatures;
  - validation is done in edge but for now it's behind a pref.
2021-04-10 19:13:28 +02:00
Jonas Jenwald
3d9f6ec0f9 Update l10n files 2021-04-04 11:04:05 +02:00
Jonas Jenwald
4814e23310 Add (temporary) Swedish localizations for the page_landmark/loading strings (PR 13118 follow-up)
I'm adding these temporary l10n strings, so that I don't have to stare at a bunch of warning messages in the web-console when using the development viewer.
2021-03-21 11:12:20 +01:00
Jonas Jenwald
36e79edfaf Update l10n files 2021-03-21 11:12:18 +01:00
Brendan Dahl
9fb0f3b0da Add landmark region and aria-label for each page.
Allows screen readers to jump landmarks and announce
the page. Since landmarks must have content, I also added
aria labels for the loading images.
2021-03-19 14:13:51 -07:00
Jonas Jenwald
d4cf751f91 Update l10n files 2021-03-07 12:05:10 +01:00
Jonas Jenwald
476230bd17 Update l10n files 2021-02-21 12:07:32 +01:00
Jonas Jenwald
6e2ae2264b Remove the unused "loading_error_indicator" l10n string (PR 2719 follow-up)
This l10n string has been completely unused ever since PR 2719, which is now *eight* years ago.
2021-02-12 13:12:37 +01:00
Jonas Jenwald
32a4a30f3a Remove the contentmenu usage, from PresentationMode, since it's no longer working
This feature was Firefox-specific, and it's now been removed from the HTML specification and it's disabled by default starting with Firefox 85. Hence it seems completely unnecessary to keep this code in the default viewer.

Please refer to https://groups.google.com/g/mozilla.dev.platform/c/tc11BCenm2c and the resources that it links to.
2021-02-09 14:29:48 +01:00
Jonas Jenwald
1d56785b6b Update l10n files 2021-02-07 12:04:23 +01:00
Jonas Jenwald
09442351b8 Update l10n files 2021-01-24 08:43:09 +01:00
Jonas Jenwald
3210b91cf8 Update l10n files 2021-01-10 13:34:49 +01:00
Jonas Jenwald
5729c0b32f Add support for finding/highlighting the outlineItem, corresponding to the currently visible page, in the sidebar (issue 7557, bug 1253820, bug 1499050)
This implementation is inspired by the behaviour in (recent versions of) Adobe Reader, since it leads to reasonably simple and straightforward code as far as I'm concerned.
*Specifically:* We'll only consider *one* destination per page when finding/highlighting the current outline item, which is similar to e.g. Adobe Reader, and we choose the *first* outline item at the *lowest* level of the outline tree.

Given that this functionality requires not only parsing of the `outline`, but looking up *all* of the destinations in the document, this feature can when initialized have a non-trivial performance overhead for larger PDF documents.
In an attempt to reduce the performance impact, the following steps are taken here:

 - The "find current outline item"-functionality will only be enabled once *one* page has rendered and *all* the pages have been loaded[1], to prevent it interfering with data regular fetching/parsing early on during document loading and viewer initialization.

 - With the exception of a couple of small and simple `eventBus`-listeners, in `PDFOutlineViewer`, this new functionality is initialized *lazily* the first time that the user clicks on the `currentOutlineItem`-button.

 - The entire "find current outline item"-functionality is disabled when `disableAutoFetch = true` is set, since it can easily lead to the setting becoming essentially pointless[2] by triggering *a lot* of data fetching from a relatively minor viewer-feature.

 - Fetch the destinations *individually*, since that's generally more efficient than using `PDFDocumentProxy.getDestinations` to fetch them all at once. Despite making the overall parsing code *more* asynchronous, and leading to a lot more main/worker-thread message passing, in practice this seems faster for larger documents.

Finally, we'll now always highlight an outline item that the user manually clicked on, since only highlighting when the new "find current outline item"-functionality is used seemed inconsistent.

---
[1] Keep in mind that the `outline` itself already isn't fetched/parsed until at least *one* page has been rendered in the viewer.

[2] And also quite slow, since it can take a fair amount of time to fetch all of the necessary `destinations` data when `disableAutoFetch = true` is set.
2021-01-09 16:09:44 +01:00
Jonas Jenwald
689e3e9732 Update l10n files 2020-12-27 11:13:54 +01:00
Jonas Jenwald
ad91972eb2 Update l10n files 2020-12-13 11:43:49 +01:00
Jonas Jenwald
cd2e6d803a Update l10n files 2020-11-29 09:50:36 +01:00
Jonas Jenwald
237c2f7832 Update l10n files 2020-11-15 13:57:28 +01:00
Jonas Jenwald
ab31f95cb4 Update l10n files 2020-10-18 11:01:06 +02:00
Jonas Jenwald
ffb0bb885c Update l10n files 2020-10-04 15:30:24 +02:00
Jonas Jenwald
fcfbc06a9c Update l10n files 2020-09-20 11:43:35 +02:00
Jonas Jenwald
54eeaba014 Update l10n files 2020-09-06 11:51:34 +02:00
Jonas Jenwald
66aabe3ec7 [api-minor] Add support for toggling of Optional Content in the viewer (issue 12096)
*Besides, obviously, adding viewer support:* This patch attempts to improve the general API for Optional Content Groups slightly, by adding a couple of new methods for interacting with the (more complex) data structures of `OptionalContentConfig`-instances. (Thus allowing us to mark some of the data as "private", given that it probably shouldn't be manipulated directly.)

By utilizing not just the "raw" Optional Content Groups, but the data from the `/Order` array when available, we can thus display the Layers in a proper tree-structure with collapsible headings for PDF documents that utilizes that feature.

Note that it's possible to reset all Optional Content Groups to their default visibility state, simply by double-clicking on the Layers-button in the sidebar.
(Currently that's indicated in the Layers-button tooltip, which is obviously easy to overlook, however it's probably the best we can do for now without adding more buttons, or even a dropdown-toolbar, to the sidebar.)

Also, the current Layers-button icons are a little rough around the edges, quite literally, but given that the viewer will soon have its UI modernized anyway they hopefully suffice in the meantime.

To give users *full* control of the visibility of the various Optional Content Groups, even those which according to the `/Order` array should not (by default) be toggleable in the UI, this patch will place those under a *custom* heading which:
 - Is collapsed by default, and placed at the bottom of the Layers-tree, to be a bit less obtrusive.
 - Uses a slightly different formatting, compared to the "regular" headings.
 - Is localizable.

Finally, note that the thumbnails are *purposely* always rendered with all Optional Content Groups at their default visibility state, since that seems the most useful and it's also consistent with other viewers.
To ensure that this works as intended, we'll thus disable the `PDFThumbnailView.setImage` functionality when the Optional Content Groups have been changed in the viewer. (This obviously means that we'll re-render thumbnails instead of using the rendered pages. However, this situation ought to be rare enough for this to not really be a problem.)
2020-08-30 16:28:40 +02:00
Jonas Jenwald
ba8c5bde5f Update l10n files 2020-08-23 10:10:38 +02:00
Jonas Jenwald
7afcdbeebe Update l10n files 2020-08-09 11:05:40 +02:00
Jonas Jenwald
ca61910a2c Update l10n files 2020-07-26 11:18:56 +02:00
Jonas Jenwald
8256981aca Update l10n files 2020-07-13 11:08:28 +02:00
Jonas Jenwald
93b1887512 Update l10n files 2020-06-27 11:37:41 +02:00
Jonas Jenwald
960d639dee Update l10n files 2020-06-13 10:39:20 +02:00
Jonas Jenwald
f2cbd5de42 Update l10n files 2020-05-30 11:01:34 +02:00
Jonas Jenwald
c12c92e598 Update l10n files 2020-05-16 11:47:08 +02:00
Jonas Jenwald
30bd3b24c2 Update l10n files 2020-05-02 13:25:28 +02:00
Jonas Jenwald
cf58f787f1 Update l10n files 2020-04-18 11:11:19 +02:00
Jonas Jenwald
9a3b52f52b Update l10n files 2020-04-02 12:22:18 +02:00