Commit Graph

1510 Commits

Author SHA1 Message Date
arai
5c4e3c31b8 Bug 1156287 - Do not extract unreachable code after return 2015-04-21 00:22:45 +09:00
Tim van der Meij
e4e9a2adea Merge pull request #5926 from browtayl/1018932
prevent viewer from zooming on cmd+mousewheel (bug 1018932)
2015-04-13 20:57:23 +02:00
Jonas Jenwald
bc0d55bf43 Remove commented out code from viewer.html
The line that this patch removes has been commented out since 2012 (!), see commit c8a6a9ba00.

Also, since the patch is trivial, I'm fixing the formatting of a comment to stop [GitHub from marking it with a red color](https://github.com/mozilla/pdf.js/blob/master/web/viewer.html#L394) (and IE from complaining).
2015-04-13 12:44:05 +02:00
Taylor Brown
34d3b96b52 prevent viewer from zooming on cmd+mousewheel 2015-04-10 15:08:32 -07:00
Jonas Jenwald
48242abe72 [B2G] Stub the |DownloadManager| to avoid error
After the refactoring in PR 5678, the B2G viewer now prints the following in the console:
```
ReferenceError: DownloadManager is not defined
```

This will obviously not matter once the B2G viewer is replaced with the new components-based one. But until that happens, I think it makes sense to just stub the class to suppress the error.
2015-04-04 21:26:33 +02:00
Tim van der Meij
01f1761a8b Merge pull request #5881 from mbbaig/master
Added the data-page-number dom attribute to the page rendered in the browser
2015-04-01 20:57:07 +02:00
Jonas Jenwald
e5c4819601 Small refactoring of the code that calls |PDFViewerApplication.setInitialView|
This is a minor cleanup, to avoid an unnecessary `Promise.all` and to simplify catching |ViewHistory| errors.
2015-03-31 20:35:00 +02:00
Jonas Jenwald
6091e7bd6b Move the code that resets the history state when the |showPreviousViewOnLoad| preference is set to |false|
Since this code is *only* necessary if/when the history is actually enabled, this patch refactors it to actually reflect that.
2015-03-31 18:12:15 +02:00
Jonas Jenwald
03497eabd5 Move fetching of the |defaultZoomValue| preference value to |PDFViewerApplication.initialize|
For consistency, this preference should be placed amongst the others. The current position is purely for "historical" reasons, since it was one of the first preferences that was added to the code.
2015-03-31 15:33:21 +02:00
Jonas Jenwald
3974adcc22 Remove reference to GNUpdf from comment in |DocumentProperties.parseDate|
Since the link is no longer valid, we should remove it from the comment.

(Using the Internet Archive, it seems that the contents of that page was basically identical to the PDF specification.)
2015-03-28 11:53:20 +01:00
Mohamed Baig
6d8adb31ad Added the data-page-number dom attribute to the page rendered in the browser
Added data-page-id attribute to page container divs

Updated the attribute with a better label
2015-03-27 18:23:39 -04:00
Jonas Jenwald
94cc731616 Add custom |outlineloaded| and |attachmentsloaded| events to the viewer (bug 1112947) 2015-03-21 17:49:34 +01:00
Tim van der Meij
2d11266a52 Merge pull request #5866 from Snuffleupagus/scalechange-evt-pageActualOption
Add |pageActualOption| to the list of predefined zoom options in the |scalechange| event handler in viewer.js
2015-03-20 22:26:07 +01:00
Jonas Jenwald
36400ae48d Add |pageActualOption| to the list of predefined zoom options in the |scalechange| event handler in viewer.js
This patch also rearrange the order of the references to the DOM elements of the predefined zoom values, in viewer.js, to correspond with the element order in the current viewer UI. (The previous ordering is a leftover from the previous viewer UI.)
2015-03-20 22:09:34 +01:00
Jonas Jenwald
4a3b0d9c64 Add a |PDFViewer| option to remove the border shadow around pages (issue 5559) 2015-03-16 12:28:28 +01:00
Jonas Jenwald
65a5543efe Disable PresentationMode for certain problematic configurations
Instead of trying to hack around various browser defects, let's just disable PresentationMode in the affected browsers. This patch:

- Disables PresentationMode in IE11+ when the viewer is embedded; fixes 4711.
2015-03-13 22:09:36 +01:00
Tim van der Meij
230d8c40e4 Make presentation mode work again in Safari 2015-03-13 21:41:14 +01:00
Tim van der Meij
ac5d1fbb2d Merge pull request #5785 from Snuffleupagus/bug-1138993
Revert PR 5510, except in WebKit browsers, for breaking print preview in Firefox
2015-03-12 21:16:29 +01:00
Yury Delendik
da258f8972 Merge pull request #5692 from Rob--W/webl10n-fix
[l10n] Treat language as case-insensitive
2015-03-09 23:24:57 -05:00
Yury Delendik
c2dc665332 Merge pull request #5582 from Snuffleupagus/setHash-Fit-values
Fix handling of "Fit" zoom values in setHash (issue 5581)
2015-03-09 23:20:23 -05:00
Yury Delendik
f4dbd69e06 Merge pull request #5595 from fkaelberer/useBinarySearchToFindVisibleElements
Use binary search in getVisibleElements()
2015-03-09 23:11:50 -05:00
Jonas Jenwald
f0d538d7cf Revert PR 5510, except in WebKit browsers, for breaking print preview in Firefox
See https://bugzilla.mozilla.org/show_bug.cgi?id=1138993.
2015-03-07 00:16:55 +01:00
speedplane
80d85b5fe7 Embedded PDF viewers should not be changing their parent page's title. 2015-03-05 22:36:08 -05:00
Jonas Jenwald
43e6de7e38 Merge pull request #5680 from Rob--W/forget-showPreviousViewOnLoad
Reset state upon load if showPreviousViewOnLoad
2015-03-02 21:49:34 +01:00
Rob Wu
6a16d7dd44 Reset state upon load if showPreviousViewOnLoad
And moved showPreviousViewOnLoad up to PDFViewerApplication.initialize
2015-03-02 21:35:44 +01:00
fkaelberer
a78bb6b946 Use binary search in getVisibleElements() 2015-03-01 17:41:20 +01:00
Tim van der Meij
a033b4bf3d Merge pull request #5769 from dumyan/findcontroller-nbsp
nbsp normalization
2015-02-28 14:50:25 +01:00
Jonas Jenwald
00ee6bd6b6 Merge pull request #5693 from collinanderson/whitespace
cleaned whitespace
2015-02-28 10:09:21 +01:00
Damjan Velickovski
29290f3277 added nbsp normalization 2015-02-28 02:57:08 +01:00
Yury Delendik
ce122591b9 Merge pull request #5586 from fkaelberer/updateThumbnailClassesOnlyWhenVisible
Update thumbnails only when they are visible (to improve scrolling through large documents)
2015-02-27 06:56:32 -06:00
Yury Delendik
6ead5c4731 Merge pull request #5711 from Snuffleupagus/deprecate-el-property
Remove the |el| property in PDFPageView and PDFThumbnailView
2015-02-27 06:39:00 -06:00
Yury Delendik
a0a94344d7 Merge pull request #5721 from Snuffleupagus/move-findController-resolveFirstPage
Move the call to |PDFFindController.resolveFirstPage| into PDFViewer
2015-02-27 06:33:15 -06:00
Jonas Jenwald
eed67ea8bb Remove the |el| property in PDFPageView and PDFThumbnailView 2015-02-27 00:26:02 +01:00
Jonas Jenwald
a495ab0d13 Fix regression that prevents resetting the zoom level to "Automatic" when using the |Ctrl + 0| keys 2015-02-19 17:37:02 +01:00
Collin Anderson
54e984c763 cleaned whitespace 2015-02-17 11:07:37 -05:00
Jonas Jenwald
8131440f9e Move the call to |PDFFindController.resolveFirstPage| into PDFViewer
From reading IRC scrollback, it became clear that having to manually call `PDFFindController.resolveFirstPage` in order for the find functionality to work isn't particulary good. Hence this PR, which moves that code into `PDFViewer.setDocument` to make life easier for third-party implementations.
2015-02-11 14:22:24 +01:00
Rob Wu
ac5a8bcdda [l10n] Treat language as case-insensitive
See "Case-insensitive language comparisons per RFC 4646"
https://github.com/fabi1cazenave/webL10n/pull/51

Removed the "patch" in compatibility.js and fixed the bug in webL10n,
because the logic belongs to webL10n instead of PDF.js.
The immediate motivation for this patch is that Chrome 40 converts
navigator.language to lower case: https://crbug.com/454331
2015-02-02 22:02:18 +01:00
Jonas Jenwald
d53fa1884b Simplify a couple of preprocessor tags in viewer.js 2015-01-31 22:45:20 +01:00
Jonas Jenwald
bb16475070 Use the |shadow| function from src/shared/util.js in viewer.js 2015-01-31 22:43:30 +01:00
Tim van der Meij
b72395d5ce Determine filename only once and reduce code for _bindLink 2015-01-28 20:53:03 +01:00
Tim van der Meij
818b7fc306 Add JSDoc comments to PDFAttachmentView 2015-01-28 20:53:02 +01:00
Tim van der Meij
4c6ca1c78f Remove DownloadManager dependency
We can pass it in using the options object. Note that that this also avoids creating a DownloadManager object for each separate link (instead, having only one is enough).
2015-01-28 20:53:01 +01:00
Tim van der Meij
733882ac25 Refactor PDFAttachmentView to be more class-like and to separate functionality into methods 2015-01-28 20:53:00 +01:00
Tim van der Meij
609e2a30e9 Rename DocumentAttachmentsView to PDFAttachmentView 2015-01-28 20:52:59 +01:00
Tim van der Meij
2c19d99a2e Rename document_attachments_view.js to pdf_attachment_view.js 2015-01-28 20:52:22 +01:00
Tim van der Meij
f4dbc99483 Add JSDoc comments to PDFOutlineView 2015-01-27 23:04:48 +01:00
Tim van der Meij
ea1d37eb0d Refactor PDFAttachmentView to be more class-like and to separate functionality into methods 2015-01-27 22:51:39 +01:00
Tim van der Meij
b17da309ed Rename DocumentOutlineView to PDFOutlineView 2015-01-27 22:40:12 +01:00
Tim van der Meij
3eeb571425 Rename document_outline_view.js to pdf_outline_view.js 2015-01-27 22:38:45 +01:00
fkaelberer
d3022e1e70 Update thumbnail images only when sidebar is visible 2015-01-27 21:13:34 +01:00