Commit Graph

652 Commits

Author SHA1 Message Date
Brendan Dahl
6f61a9c83e Merge pull request #3727 from brendandahl/css-zoom2
Use css to initially scale on zoom.
2013-10-08 20:34:22 -07:00
Tim van der Meij
64757dd481 Merge pull request #3774 from Snuffleupagus/contextMenu-PresentationMode
Enabling clicking to close the context menu in Presentation Mode, without going to the next page
2013-10-08 11:31:02 -07:00
Jonas Jenwald
dfb8e62079 Enabling clicking to close the context menu in Presentation Mode, without going to the next page 2013-10-08 20:11:04 +02:00
Rob Wu
1731c0fb42 Add mozPrintCallback shim
This shim does the following:
1. Intercept window.print()
2. For a window.print() call (if allowed, ie. no previous print job):
   1. Dispatch the beforeprint event.
   2. Render a printg progress dialog.
   3. For each canvas, call mozPrintCallback if existent (one at a time, async).
   4. During each mozPrintCallback callback, update the progress dialog.
   5. When all <canvas>es have been rendered, invoke the real window.print().
   6. Dispatch the afterprint event.

The shim is not included in Firefox through the preprocessor.

Keyboard shortcuts (Ctrl/Cmd + P) are intercepted and default behavior
(i.e. printing) is prevented, and the steps for window.print() are run.
window.attachEvent is used, in order to cancel printing in IE10 and
earlier (courtesy of Stack Overflow - http://stackoverflow.com/a/15302847).
Unfortunately, this doesn't work in IE11 - if Ctrl + P is used, the
print dialog will be shown twice: Once because of Ctrl + P, and again
when all pages have finished rendering.

This logic of this polyfill is not specific to PDF.js, so it can also
be used in other projects.

There's one additional modification in PDF.js's viewer.js: The printed
<canvas> element is wrapped in a <div>. This is needed, because Chrome
would otherwise print one canvas on two pages.
2013-10-08 19:46:59 +02:00
Jonas Jenwald
d795c8ec14 Refactor Presentation Mode code 2013-10-06 20:10:26 +02:00
Tim van der Meij
a68375c48e Merge pull request #3739 from Snuffleupagus/bug-921162
Add the viewBookmark button to the Secondary Toolbar
2013-10-04 13:16:38 -07:00
Brendan Dahl
df249da923 Use css to initially scale on zoom. 2013-10-02 09:05:46 -07:00
Jonas Jenwald
d6ab0c61e8 Move Settings from viewer.js to its own file 2013-10-02 15:55:31 +02:00
Jonas Jenwald
bfc66626a0 Move Presentation Mode related code from viewer.js to its own file 2013-10-01 23:11:46 +02:00
Jonas Jenwald
b148c9cb51 Add the viewBookmark button to the secondary toolbar 2013-09-27 11:51:32 +02:00
Tim van der Meij
63233fa8c2 Improved password prompt 2013-09-24 17:46:54 +02:00
Jonas Jenwald
cebf3c60e2 Move PageView from viewer.js to its own file 2013-09-20 09:25:41 +02:00
Yury Delendik
a8320b2e18 Merge pull request #3695 from SSk123/transform
Adding transformation to the extract code
2013-09-19 18:45:59 -07:00
Srishti
3808d02a53 implementing transform matrix to getTextContent 2013-09-20 06:37:08 +05:30
Brendan Dahl
c270d7e056 Merge pull request #3641 from Snuffleupagus/properly-disable-presentationMode-when-embedded
Properly disable presentation mode when the viewer is embedded
2013-09-17 13:49:11 -07:00
Thor Larholm
0f07d8ad55 Squashed: Added basic support for presentationMode in IE11 2013-09-10 21:40:14 +02:00
Yury Delendik
69eff38d09 Merge pull request #3660 from maxidirienzo/master
viewer.js: Do not process keyboard shortcuts when focused element is a t...
2013-09-09 08:17:50 -07:00
maxidirienzo
ee5d8ca56d viewer.js: Do not process keyboard shortcuts when focused element is a textarea
If focused element is a textarea, viewer should not process keyboard shortcuts (as it does with input and select elements) because while writing on a textarea, if you press k,p,l, or n, the viewer scrolls next/prev page and the letter is not added to the textarea (eg. in my case I had a viewer displaying a product specs in PDF and a "request a quote" form at it's right, the form had a textarea field and users complains that they couldn't write in it, after checking it, I've realized it was this particular issue and fixd it with the change I'm commiting.
2013-09-09 11:50:49 -03:00
Jonas
b118ade9ae Fix searching in presentation mode in Firefox 2013-09-06 09:08:43 +02:00
Brendan Dahl
7cf8b8d70c Merge pull request #3607 from Snuffleupagus/issue-3604
Prevent searching during load from breaking the find functionality
2013-09-05 08:13:45 -07:00
Jonas
433397f877 Simplify getVisiblePages() in presentation mode 2013-09-05 00:42:36 +02:00
Jonas
54dfe05e30 Prevent searching during load from breaking the find functionality 2013-09-05 00:25:19 +02:00
Jonas
3cce7be9ce Properly disable presentation mode when the viewer is embedded 2013-09-05 00:23:16 +02:00
Tim van der Meij
3c0ac37292 Secondary toolbar 2013-09-04 23:48:31 +02:00
Brendan Dahl
d26fcd5468 Merge pull request #3618 from Snuffleupagus/followup-3557
Prevent named actions from displaying a 'resource://' URL in Firefox
2013-09-04 11:16:15 -07:00
Brendan Dahl
b368a99f20 Merge pull request #3421 from Snuffleupagus/avoid-multiple-rendering-on-wheel-zoom
Avoid triggering rendering multiple times when zooming using the mouse wheel
2013-09-04 10:25:31 -07:00
Nils Maier
16a1c38c1f Download: Use the typed array view instead of the buffer
The ArrayBuffer holding the data might be over-sized in case the
data length was not known during the transfer, e.g. when using a
Content-Encoding other than `identity` or when using a
Transfer-Encoding.
Only the view into the buffer has the correct length then, hence
always use the view directly when creating the blob URI for the
download, instead of the over-sized underlying buffer.

Closes GH-3627
Closes GH-3634
2013-09-01 16:45:26 +02:00
Jonas
8630e29054 Avoid triggering rendering multiple times when zooming using the mouse wheel 2013-08-26 21:00:35 +02:00
Brendan Dahl
427dd3948b Merge pull request #3569 from yurydelendik/bug900193
Fixes canvas alignment for small scale...
2013-08-26 10:52:47 -07:00
Brendan Dahl
e2ca1d0e5e Merge pull request #3613 from Snuffleupagus/remove-dead-find-code
Remove old dead find related code from viewer.js
2013-08-26 10:46:58 -07:00
Brendan Dahl
e9a3ac175c Merge pull request #3612 from Snuffleupagus/fix-find-when-loading-new-file
Prevent searching from breaking when opening a new file in the web viewer
2013-08-26 10:44:54 -07:00
Brendan Dahl
c17a7c9d04 Merge pull request #3505 from Snuffleupagus/move-ThumbnailView
Move ThumbnailView from viewer.js to its own file
2013-08-26 10:30:24 -07:00
Jonas
e69fc0072a Prevent named actions from displaying a 'resource://' URL in Firefox 2013-08-24 20:27:58 +02:00
Jonas
8892beeb08 Remove old dead find related code from viewer.js 2013-08-23 13:08:51 +02:00
Jonas
baba41f702 Prevent searching from breaking when opening a new file in the web viewer 2013-08-23 11:08:03 +02:00
Yury Delendik
bde863a8ac Merge pull request #3573 from Rob--W/crx-view-local-files
[CRX] Fixes to view local files again
2013-08-21 07:37:32 -07:00
Yury Delendik
ba23a9e8f9 Adds initial telemetry probes 2013-08-16 09:53:05 -05:00
Rob Wu
a4dd4b1789 [CRX] Fixes to view local files again
pdfHandler-local.js references the isPdfDownloadable function from
pdfHandler.js, but the function didn't expect that the responseHeaders
property was absent. Added a check to prevent a runtime error when a
local file is displayed in a frame, and show local PDF files again.

Local files are rendered on the chrome-extension:-protocol. The previous
method of getting the PDF URL was incorrect, this has been fixed as well.
2013-08-14 23:50:51 +02:00
Yury Delendik
86077810b0 Fixes canvas alignment for small scale and scale adjustment after Cmd+0 2013-08-13 18:45:06 -05:00
Brendan Dahl
5ecce4996b Split files into worker and main thread pieces. 2013-08-12 10:48:06 -07:00
Tim van der Meij
75035a2970 Named actions implementation 2013-08-08 21:59:59 +02:00
Jonas
d99879bfbf Move ThumbnailView from viewer.js to its own file 2013-08-06 22:19:03 +02:00
Brendan Dahl
820145da05 Merge pull request #3523 from yurydelendik/csp
Bug 889320 - [CSP] removes inlined styles and scripts, also HTTP headers
2013-08-06 13:10:33 -07:00
Brendan Dahl
d85e38d629 Fix intermittent blank page on fast zoom. 2013-08-05 16:34:57 -07:00
Yury Delendik
bea2e41e45 Backout of #3513 (except formatting) 2013-08-05 07:52:24 -05:00
Yury Delendik
7435b267f9 Merge pull request #3535 from Snuffleupagus/issue-3534
Fix issue with initial scale when opening a new file and another one is already loaded
2013-08-04 17:29:36 -07:00
Brendan Dahl
65fd2c77d0 Merge pull request #3513 from Snuffleupagus/keep-scroll-position-on-zoom-v2
Keep current scroll position when zooming the document
2013-08-02 15:22:52 -07:00
Jonas
8170d67a6b Fix issue with initial scale when opening a new file and another one is already loaded 2013-08-02 16:09:33 +02:00
Brendan Dahl
bf72bc94e2 Incrementally render by sending the operator list by chunks as they're ready. 2013-07-31 11:17:36 -07:00
Jonas
edf3163fa6 Keep current scroll position when zooming the document 2013-07-31 19:43:03 +02:00