Commit Graph

5592 Commits

Author SHA1 Message Date
Brendan Dahl
99e45048cf Merge pull request #3776 from timvandermeij/thumbnail-jump
Refactoring thumbnail scroll code to fix jumps
2013-10-09 12:41:15 -07:00
Tim van der Meij
b1b661a274 Refactoring thumbnail scroll code to fix jumps 2013-10-09 20:40:21 +02:00
Tim van der Meij
cdcc26eedf Merge pull request #3790 from timvandermeij/typo-fix
Trivial typo fix
2013-10-09 11:26:10 -07:00
Tim van der Meij
ec7064ea74 Trivial typo fix 2013-10-09 20:24:12 +02:00
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
Brendan Dahl
52e429550c Simplify the output scale for css zoom. 2013-10-08 20:31:49 -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
Brendan Dahl
9db1e437b0 Merge pull request #3670 from Rob--W/mozPrintCallback-polyfill
Polyfill for mozPrintCallback
2013-10-08 11:18:58 -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
194a734e5d Resolved severe memory leak (mozPrintCallback)
Do NOT save the temporary <canvas> element as `this.canvas`.
`PDFViewer.pages[i].canvas` appears to be used to generate the thumbnail
icons. Well, that's no justification for preventing GC of those
temporary <canvas> elements used during mozPrintCallback.

With a document consisting of 79 pages, this resulted in a 600-700MB
leaked memory.
2013-10-08 19:50:45 +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
Brendan Dahl
6d1533293e Merge pull request #3416 from peerlibrary/noHTMLElement
instanceof HTMLElement does not work in jsdom node.js module.
2013-10-08 10:15:00 -07:00
Jonas Jenwald
3ee730d009 Merge pull request #3779 from xavier114fch/zh-TW
Update zh-TW locale
2013-10-07 08:03:15 -07:00
Jonas Jenwald
bfa248c811 Merge pull request #3778 from Haebaru/master
Update ja locale
2013-10-07 07:58:31 -07:00
Xavier Fung
b484d72326 Update zh-TW locale 2013-10-07 22:45:16 +08:00
Haebaru
4d98103176 Update ja locale 2013-10-07 23:25:11 +09:00
Tim van der Meij
d4aa36257c Merge pull request #3763 from Snuffleupagus/refactor-PresentationMode
Refactor Presentation Mode code
2013-10-06 11:22:08 -07:00
Jonas Jenwald
d795c8ec14 Refactor Presentation Mode code 2013-10-06 20:10:26 +02:00
Tim van der Meij
e2f44361f5 Merge pull request #3759 from Snuffleupagus/issue-3755
Fix external links in Presentation Mode (issue 3755)
2013-10-04 13:49:30 -07: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
2d489bab22 Merge pull request #3582 from Rob--W/pushState
Set URL in history.replaceState/pushState
2013-10-03 11:35:36 -07:00
Yury Delendik
e97e0032df Merge pull request #3750 from brendandahl/cidfonttype0c
Proper glyph selection for CIDFontType0C fonts.
2013-10-02 15:49:52 -07:00
Brendan Dahl
4066f2ad6d Merge pull request #3746 from Snuffleupagus/remove-webkit-from-b2g-css
[B2G] Remove the remaining occurrences of -webkit prefixes from the CSS
2013-10-02 09:20:58 -07:00
Brendan Dahl
df249da923 Use css to initially scale on zoom. 2013-10-02 09:05:46 -07:00
Jonas Jenwald
87eb2dccbe Fix external links in Presentation Mode (issue #3755) 2013-10-02 16:17:38 +02:00
Tim van der Meij
0cd4874df6 Merge pull request #3757 from Snuffleupagus/move-Settings
Move Settings from viewer.js to its own file
2013-10-02 07:11:11 -07:00
Yury Delendik
a672937111 Merge pull request #3738 from timvandermeij/transposed-jbig2
Transposed feature for text decoding in jbig2
2013-10-02 06:59:35 -07:00
Jonas Jenwald
43b0b66ada Fix coding style and improve comment in settings.js 2013-10-02 15:57:23 +02:00
Jonas Jenwald
d6ab0c61e8 Move Settings from viewer.js to its own file 2013-10-02 15:55:31 +02:00
Tim van der Meij
fc5ed402fb Merge pull request #3752 from Snuffleupagus/move-PresentationMode
Move Presentation Mode related code from viewer.js to its own file
2013-10-02 06:30:51 -07:00
Tim van der Meij
dbd214fd28 Merge pull request #3728 from JakubOnderka/patch-1
Added missed space in Czech translation
2013-10-02 06:13:27 -07:00
Jonas Jenwald
bfc66626a0 Move Presentation Mode related code from viewer.js to its own file 2013-10-01 23:11:46 +02:00
Brendan Dahl
17a953c7b3 Merge pull request #3643 from Snuffleupagus/issue-3423
Change the cursor so that text selection doesn't appear possible in presentation mode
2013-10-01 13:27:19 -07:00
Brendan Dahl
f79c182314 Proper glyph selection for CIDFontType0C fonts. 2013-09-30 21:40:28 -07:00
Jonas Jenwald
8ae2205783 [B2G] Remove the remaining occurrences of -webkit prefixes from the CSS 2013-09-29 20:45:11 +02:00
Jonas Jenwald
b148c9cb51 Add the viewBookmark button to the secondary toolbar 2013-09-27 11:51:32 +02:00
Sriram
f6eee819e2 Transposed feature for text decoding in jbig2 2013-09-26 20:49:02 +02:00
Brendan Dahl
ea50c078b0 Merge pull request #3735 from yurydelendik/embed-base
Properly resolves relative src for the embed tags
2013-09-26 10:38:08 -07:00
Jonas Jenwald
9fcb1a9e40 Merge pull request #3671 from Rob--W/toolbar-layout-fix
Fix layout of main toolbar
2013-09-26 07:55:52 -07:00
Yury Delendik
e140d2ca58 Merge pull request #3696 from Rob--W/webL10n-tot
Update webL10n to latest version (september 2013) (+support for attributes in mozL10n.get)
2013-09-25 18:57:54 -07:00
Yury Delendik
a3e59b5e2a Merge pull request #3722 from Moistly/no-cy-locales
Norwegian and Welsh locales added
2013-09-25 18:46:20 -07:00
Yury Delendik
1c7f1cee00 Merge pull request #3674 from brendandahl/cmap-squash
Read multi-byte character codes based on codespace ranges.
2013-09-25 18:04:49 -07:00
Brendan Dahl
7f49dba87c Merge pull request #3720 from biggert/localpdfmanager-undefined
Prevent undefined error when calling .destroy on a document when LocalPdfManager is used
2013-09-25 15:57:27 -07:00
biggert
fb957f5c6e Prevent undefined error on null object when calling .destroy on a
document initialized with LocalPdfManager.

Per @brendandahl's recommendation, moved the terminate function out of worker
and into the PdfManager
2013-09-25 16:25:41 -05:00
Yury Delendik
71012c6c6c Properly resolves relative src for the embed tags 2013-09-25 15:18:38 -05:00
Brendan Dahl
f32e65b19f Read multi-byte character codes based on codespace ranges. 2013-09-25 10:32:04 -07:00
Yury Delendik
1bcb3efd4a Merge pull request #3729 from prometheansacrifice/page-outofbounds
Trying to fix #3611
2013-09-25 06:18:32 -07:00
Paul Francis
bc70a195da Norwegian and Welsh locales added
Norsk (no), Cymreag (cy)
2013-09-25 11:43:49 +01:00
Brendan Dahl
9f50c1ba75 Merge pull request #3730 from brendandahl/chrome-timeout
Increase api unit tests timeout for chrome.
2013-09-24 12:55:34 -07:00
Tim van der Meij
0c49f8c3c4 Merge pull request #3731 from Snuffleupagus/swedish-password-l10n
Add password strings to the Swedish l10n
2013-09-24 11:43:16 -07:00