Commit Graph

75 Commits

Author SHA1 Message Date
Jonas Jenwald
36c2791296 Unify handling of various cursor tools, e.g. the current Hand Tool and a possible future Zoom Tool, in a new PDFCursorTools module
With the current way that the `HandTool` is implemented, if someone would try to also add a Zoom tool (as issue 1260 asks for) that probably wouldn't work very well given that you'd then have two cursor tools which may not play nice together.
Hence this patch, which attempts to refactor things so that it should be simpler to add e.g. a Zoom tool as well (given that that issue is marked as "good-beginner-bug", and I'm not sure if that really applies considering the current state of the code).

Note that I personally have no interest in implementing a Zoom tool (similar to Adobe Reader) since I wouldn't use it, but I figured that it can't hurt to make this code a bit more future proof.
2017-05-22 00:51:01 +02:00
Jonas Jenwald
c79e5b3f17
Viewer: replace find label with placeholder/tooltip
This is common in the rest of the UI and helps us prevent responsiveness
issues for different length strings in different locales.
2017-03-08 23:54:14 +01:00
Jonas Jenwald
616e5fadff Display a notification on the sidebarToggle button for PDF documents with outline/attachments
A longstanding issue with the viewer is that you cannot tell if a PDF document includes an outline and/or attachments without actually opening the sidebar.
This patch contains a suggested solution for that, by displaying an hide-on-interaction notification on the `sidebarToggle` button (and the relevant sidebar view buttons). Note that this was inspired by e.g. the update notification that is displayed on the menu button in Firefox.

For an initial implementation, I've tried to do this in such a way that the notification isn't too distracting. Without being an UX expert, I don't think that we'd want something too in-your-face, in order to keep the viewer toolbars reasonable clean. (We probably do *not* want e.g. an entire notification bar in these situations, since that would take up unnecessary screen space and require actions from the user to close.)

However it's certainly possible that the current notification might simply be *too* inconspicuous to be truly helpful to users, but we could probably iterate on that if the feature itself is deemed useful.
2017-01-30 15:39:04 +01:00
Jonas Jenwald
077e644437 Fix a typo in the page_of_pages l10n ID for the en-US locale 2016-10-31 23:14:22 +01:00
Jonas Jenwald
f461fd64aa Add support for PageLabels in the viewer
This patch implements the page label functionality in a similar way as Adobe Reader.
For documents with page labels, if a non-existent page label is entered we'll try to fallback to the page number instead.
The patch also includes a preference (`disablePageLabels`), to make it easy to opt-out of using page labels if the user/implementor so wishes.

The way that `get/set currentPageLabel` is implemented in `PDFViewer`, is as wrappers for the corresponding `get/set currentPageNumber` functions, since that seemed like the cleanest solution.
The page labels are purposely *only* added to the page controls in the viewer UI, and not stored in e.g. the `ViewHistory`. Since doing so would mean adding unnecessary code complexity, without any real added value, and would also mean delaying the inital loading of PDF documents.

Note that this patch will ignore page labels if they are identical to standard page numbering, since in this case displaying the page labels adds no value (but only UI noise). The reason for handling this case specially, is that in practice a surprising number of PDF files include "pointless" page labels.
2016-10-26 13:30:36 +02:00
Jonas Jenwald
23ec02bb93 Remove the "Page: " label and replace it with a tooltip
The following reasoning was used for deciding to remove the "Page: " label, and replace it with a tooltip, from the main toolbar:
 - We have no other visible labels in the *main* toolbar (e.g. the Zoom dropdown doesn't have a label, but only a tooltip).
 - We already hide the "Page: " label when the viewer is narrow.
 - The varying width of the "Page: " label in different locales is already causing issues for many languages, with overlap in the main toolbar as a result.
Trying to create responsive CSS styles that works well in all locales is already difficult, and if we add support for page labels that will only further compound the issues.
 - Some PDF viewers (e.g. Adobe Reader, pdfium in Chrome) doesn't show labels in the UI by default.
2016-10-26 13:30:26 +02:00
Jeenu Viswambharan
f2dcacd164 Explain double-click behaviour on tool tip
The outline toggle button has a feature where it can be double-clicked
to expand/collapse all items shown therein. Although this is described
in the FAQ, can go potentially unnoticed. This, however, being a useful
feature, advertise on the tool tip itself.

l10n translation for en-US and IDs updated.

Signed-off-by: Jeenu Viswambharan <jeenuv@gmail.com>
2016-10-16 09:22:48 +01:00
Yury Delendik
1a056caf88 Localization of the print dialog. 2016-10-11 10:08:13 -05:00
Brendan Dahl
8cf32cde6c Upstream l10n changes from Bug 1259859. 2016-08-24 09:47:36 -07:00
Sebastian Hengst
27577a714f Issue #6569 - document_colors_disabled shouldn't escape quotes (compare-locales warning) 2015-11-22 10:14:25 +01:00
Jonas Jenwald
d1411fabfd Add locatization notes for the DocumentProperties strings with parameters
This should hopefully help prevent localizers from translating the actual parameters.
2015-08-19 13:22:52 +02:00
Collin Anderson
54e984c763 cleaned whitespace 2015-02-17 11:07:37 -05:00
Jonas Jenwald
2505c8613b Allow localization of the placement of percent signs in the zoom box 2014-10-21 21:41:06 +02:00
Jonas Jenwald
ed5fc43510 Add |UnexpectedResponseException| to fix the exception handling when file loading fails because the server responds with a non 404 status message 2014-09-14 11:52:33 +02:00
Samuel Chantaraud
25ee0e8572 Preliminary attachments support
Added a partial Filespec support
Added getAttachments in API
Added a new attachments view in UI (with a new icon by @shorlander)
2014-04-18 12:11:00 -04:00
Tim van der Meij
c952b6fb85 Miscellaneous improvements for the document properties dialog 2014-01-23 00:30:48 +01:00
Tim van der Meij
5f7ded4ff6 Document properties 2014-01-22 00:07:07 +01:00
Brendan Dahl
5d080a03bb Show a different warning for PDF’s with forms. 2014-01-07 16:03:45 -08:00
Rob Wu
3914768085 Implement hand tool
The logic for the hand tool is implemented in a separate project,
maintained at https://github.com/Rob--W/grab-to-pan.js

Integration notes
- Added toggle as an entry under the Secondary toolbar
- Added shortcut "h" to toggle hand tool (to-do: document this in wiki
  after merge). This shortcut is also used in Adobe's Acrobat Reader.

To-do: localizations for:
hand_tool_enable.title=
hand_tool_enable_label=
hand_tool_disable.title=
hand_tool_disable_label=

To-do (wish): persistence of hand tool preference, preferably a global setting.

secondaryToolbarButton-handTool.png created by Stephen Horlander <shorlander@mozilla.com>
2013-12-03 15:51:41 +01:00
Tim van der Meij
63233fa8c2 Improved password prompt 2013-09-24 17:46:54 +02:00
Tim van der Meij
9d6ec2ea6f Revert language string changes 2013-09-15 22:50:50 +02:00
Tim van der Meij
3c0ac37292 Secondary toolbar 2013-09-04 23:48:31 +02:00
Mack Duan
f8f4b3f45d Refactor code for annotations 2013-05-07 14:22:13 -04:00
Brendan Dahl
e5b5c94925 Merge pull request #3060 from saebekassebil/fixpassword
Ask for password on failed decryption
2013-05-07 09:27:38 -07:00
Jakob Miland
297c305150 Ask for password on failed decryption 2013-05-07 18:24:59 +02:00
Jonas
40718bdb7b Fixes bug 863591 2013-05-06 17:39:22 +02:00
Jakob Miland
6b4f72a2c3 Disable outline button when unavailable 2013-04-11 18:27:35 +02:00
Jonas
ee83df1338 Detect and add fallback if document colors are disabled in Firefox - address comment 2013-04-03 18:49:03 +02:00
Mack Duan
4782a3acb9 Changes to viewer to support progressive loading 2013-03-29 11:51:10 -07:00
Yury Delendik
c53fa62e58 Merge pull request #2644 from SSk123/edit_slider_name
Bug #767698 Slider Rename
2013-01-31 06:06:06 -08:00
Srishti
a80234fee9 Bug #767698 Slider Rename
Bug #767698 Slider Rename
2013-01-31 19:25:02 +05:30
Bill Walker
12af2f9431 fix for #2219, "provide a better error message when file= not found/accessible"
summary: create a new Exception class for missing PDF's, use it in place of generic

add new MissingPDFException to util.js
handle MissingPDF in api.js
handle MissingPDF in viewer.js, using new missing_file_error message
add new missing_file_error to l10n/en-US/viewer.properties
send MissingPDF from WorkerMessageHandler's loadDocument
send MissingPDF from GetDocRequest handler
2013-01-29 13:17:04 -08:00
Yury Delendik
7b70710565 Traces pdf.js version 2013-01-04 11:01:31 -06:00
Yury Delendik
5dc87a7fca Detecting if web fonts are disable in Firefox. 2012-11-30 17:08:19 -06:00
Brendan Dahl
67f3b38245 Change keys and update wording for find wrapped strings. 2012-11-20 09:19:17 -08:00
Brendan Dahl
942f879a5d Add license headers to properties files. 2012-11-07 13:05:50 -08:00
Yury Delendik
1f8be3fdc3 Fixes find_wrapped_to_bottom string 2012-10-29 08:01:36 -05:00
Piotr Zalewa
812bc6795d * InvalidPDFException added
* Act on throwing an Exception and InvalidPDFException by rejecting the worker
instead of throwing
* changed message for all builds
* alerting and closing window only for B2G builds
* invalid_file_error added to l10n (en and pl)
* UnknownErrorException added and used for every error()
2012-10-25 11:15:19 +02:00
Tim van der Meij
637efe9dde Fixing capital letters 2012-10-10 21:54:05 +02:00
Tim van der Meij
83a236484b Improved the Dutch and English strings for the first and last page context menu items 2012-10-10 21:41:38 +02:00
Yury Delendik
06f9b70f07 Merge pull request #2206 from timvandermeij/first-last-page-context-menu
Converted the first and last page buttons to context menu items
2012-10-10 10:36:21 -07:00
Tim van der Meij
6e13e3dd73 Final commit squash 2012-10-10 19:26:41 +02:00
Yury Delendik
ade5f96787 Add pilot find next/prev icons; localization 2012-10-05 19:15:06 -05:00
Yury Delendik
baf3e1fb83 Adds localized en-US string for find_not_found 2012-10-05 10:05:46 -05:00
Brendan Dahl
1f85b8b4ed Update the l10n for the html find bar. 2012-10-02 17:08:47 -07:00
Artur Adib
6864a07221 Use "find" instead of both find & search 2012-09-25 16:17:27 -04:00
Yury Delendik
12a0faadad Renames fullscreen to presentation mode 2012-09-21 09:35:18 -05:00
Yury Delendik
7766894c1a Fix l10n labels ids for rotation menu items 2012-09-17 08:35:44 -05:00
gigaherz
bbcb05af7b Implement page rotation controls using keyboard (R/shift-R) and context menu. 2012-09-08 01:05:14 +02:00
Saebekassebil
dacdbaa978 Correct l10n and address yury's comments 2012-07-30 17:58:34 +02:00