Commit Graph

8788 Commits

Author SHA1 Message Date
Jonas Jenwald
e281ef15db Adjust incorrect first obj number of "free" xref entry in XRef_readXRefTable (issue 7229)
Fixes 7229.
2016-04-21 16:36:32 +02:00
Jonas Jenwald
2001953871 Merge pull request #7219 from timvandermeij/password-prompt-class
Convert the password prompt to a class
2016-04-21 15:19:34 +02:00
Tim van der Meij
2b7137ba0a Convert the password prompt to a class
Furthermore we introduce two new methods named `setCallback` and
`setReason` so external code does not change the properties of the class
directly. Finally we update various names of properties and methods to
be more self-explanatory.
2016-04-21 14:06:10 +02:00
Jonas Jenwald
990150ce61 Update l10n files 2016-04-19 13:32:25 +02:00
Yury Delendik
3228c9445c Merge pull request #7210 from Snuffleupagus/extract-PDFImage.resize
Split the two paths in `PDFImage.resize` into separate helper functions, placed in colorspace.js and image.js
2016-04-17 07:49:37 -05:00
Jonas Jenwald
19e0599f74 Split the two paths in PDFImage.resize into separate helper functions, placed in colorspace.js and image.js
Re: issue 6777.
2016-04-17 10:24:36 +02:00
Yury Delendik
0428fdf3ca Merge pull request #7211 from Snuffleupagus/crypto-tests-NEED_PASSWORD
Add a couple of `CipherTransformFactory` unit-tests for blank passwords, and move the `isDict` unit-tests to the correct file
2016-04-16 20:02:05 -05:00
Jonas Jenwald
b4a17323b6 Move isDict unit-tests from util_spec.js to primitives_spec.js
This patch moves the unit-test to the correct file, since the `isDict` function was moved PR 6683.
2016-04-16 20:32:46 +02:00
Jonas Jenwald
4523ae0b91 Add a couple of CipherTransformFactory unit-tests to check that blank passwords are correctly rejected 2016-04-16 20:24:55 +02:00
Tim van der Meij
a093d755b7 Merge pull request #7207 from timvandermeij/hand-tool-class
Convert the hand tool to a class
2016-04-16 19:32:58 +02:00
Tim van der Meij
b0aca31de8 Convert the hand tool to a class 2016-04-16 19:20:37 +02:00
Jonas Jenwald
7f90f5bfed Merge pull request #7206 from Snuffleupagus/viewer-expose-non-classes-on-PDFViewerApplication
Expose a few non-classes on `PDFViewerApplication`
2016-04-16 16:43:22 +02:00
Jonas Jenwald
9dfda2b908 Expose a few non-classes on PDFViewerApplication
With the recent PR 7172, which made the viewer modular, there's now a couple of modules that are no longer easily accessible (e.g. through the console).
This can make testing/debugging more difficult, and means that e.g. https://github.com/mozilla/pdf.js/wiki/Debugging-PDF.js#enabling no longer works in the generic viewer.

For now, as a simple solution, this patch just exposes those non-classes on `PDFViewerApplication` to ensure that they are available, and to avoid polluting the `window` scope.
2016-04-16 16:23:21 +02:00
Tim van der Meij
452c031af5 Merge pull request #7116 from Snuffleupagus/refactor-LinkAnnotation-tests
Refactor `LinkAnnotation` slightly, improve handling of the `GoToR` action, and add unit-tests
2016-04-16 15:46:41 +02:00
Tim van der Meij
ff65c8021f Merge pull request #7190 from Snuffleupagus/sidebarviewchanged-event
Dispatch a `sidebarviewchanged` event in `PDFSidebar` when the view changes
2016-04-16 14:58:50 +02:00
Ankit Aggarwal
6ceda3f290 web/viewer.js: Persist the state of sidebar
Persist the state of content sidebar while browsing away from viewer and
initializing the same on returning back to the viewer. The state is saved
in persistent store preferences and used upon viewer initialization.

Fixes #6935
2016-04-16 10:17:42 +02:00
Jonas Jenwald
5657d082c7 Dispatch a sidebarviewchanged event in PDFSidebar when the view changes
We cannot piggy-back on the `updateviewarea` event in order to update the stored sidebar state, since there're a number of cases where opening/switching the sidebar view won't fire a `updateviewarea` event.
Note that `updateviewarea` only fires when the position changes in the *viewer*, which means that it won't fire if e.g. the viewer is narrow, such that the sidebar overlays the document transparently; or when switching views, without the document position also changing.

This patch also moves the handling of `forceOpen` parameter in `PDFSidebar_switchView`, to prevent triggering back-to-back rendering and dispatching of events.
2016-04-16 10:10:28 +02:00
Jonas Jenwald
171f908b89 Add a couple of LinkAnnotation unit-tests
We currently don't have *any* unit-tests for `LinkAnnotation`s, so it seemed a good idea to add a few. These tests are taken from various actual PDF files.
2016-04-15 22:59:08 +02:00
Jonas Jenwald
f3f825cc71 Various improvements for GoToR actions
- Add support for the 'NewWindow' property.

 - Ensure that destinations are applied to the *remote* document, instead of the current one.

 - Handle the `F` entry being a standard string, instead of a dictionary.
2016-04-15 22:55:05 +02:00
Jonas Jenwald
b63ef7a8b6 Refactor LinkAnnotation slightly to add data.url/data.dest at the end
This patch also makes sure that all URLs are converted to the correct encoding.
2016-04-15 22:55:05 +02:00
Tim van der Meij
4a601ffc28 Merge pull request #7197 from prakashpalanisamy/remove-combineurl-test
Remove `combineUrl` and replace it with `new URL`. Issue #7183, for reference.
2016-04-15 22:44:07 +02:00
Prakash Palanisamy
a25c29d98d Remove combineUrl and replace it with new URL. 2016-04-15 21:33:10 +05:30
Jonas Jenwald
5c17df9f07 Merge pull request #7201 from Snuffleupagus/issue-7200
Ensure that the `params` parameter of the `PredictorStream` is a dictionary (issue 7200)
2016-04-15 16:59:54 +02:00
Jonas Jenwald
079b563e2d Ensure that the params parameter of the PredictorStream is a dictionary (issue 7200)
Fixes 7200.
2016-04-15 16:30:18 +02:00
Yury Delendik
e9dbb233aa Merge pull request #7191 from Snuffleupagus/export-DefaultAnnotationLayerFactory
Export the `DefaultAnnotationLayerFactory` to prevent the viewer components from breaking (PR 7172 followup)
2016-04-13 10:50:15 -05:00
Jonas Jenwald
c98f25145f Export the DefaultAnnotationLayerFactory to prevent the viewer components from breaking (PR 7172 followup) 2016-04-13 17:42:04 +02:00
Yury Delendik
6282ec24d1 Merge pull request #7172 from yurydelendik/umd-web
Introduces UMD headers to the web/ folder.
2016-04-13 10:23:23 -05:00
Yury Delendik
50fe8e7c75 Removes PDFView global and pagerender event support. 2016-04-13 10:11:43 -05:00
Yury Delendik
4165cedc9f Replace pdfjsLib with module that represents pdf.js. 2016-04-13 10:11:34 -05:00
Yury Delendik
006e8fb59d Introduces UMD headers to the web/ folder. 2016-04-13 10:09:48 -05:00
Yury Delendik
fa2f80d0fd Merge pull request #7189 from yurydelendik/webpack-browserify-love
Removing "entry-loader" dependency from webpack.
2016-04-13 08:42:11 -05:00
Yury Delendik
ae415f9e80 Removing "entry-loader" dependency from webpack. 2016-04-13 08:24:25 -05:00
Yury Delendik
b834b6899c Merge pull request #7185 from iloire/issue-7177-support-almondjs
Support almond.js #7177
2016-04-12 17:21:03 -05:00
Jonas Jenwald
127e6d7343 Merge pull request #7184 from yurydelendik/pad-mesh
[Bug 1260585] Stops bleeding of pattern edges for mesh.
2016-04-12 12:47:38 +02:00
Ivan Loire
1dfc49152a Support almond.js #7177 2016-04-12 09:32:07 +10:00
Yury Delendik
398e6acbc5 Stops bleeding of pattern edges for mesh. 2016-04-11 18:21:44 -05:00
Jonas Jenwald
be6754a1a0 Merge pull request #7176 from yurydelendik/smask-resume
Allow SMask be resumed after restore() and better transform after SMask
2016-04-11 15:57:40 +02:00
Yury Delendik
d76db416f4 Adds more SMask tests. 2016-04-11 08:02:06 -05:00
Yury Delendik
63f62a0e53 Finishing SMask at the end of operators list. 2016-04-11 08:02:06 -05:00
Yury Delendik
1485c1d1da Suspending/resuming SMask operation during setGState/restore. 2016-04-11 08:02:06 -05:00
Yury Delendik
b2828858ed Merge pull request #7178 from yurydelendik/rm-describe-test-hack
Removes hijack describe() hack from unit tests.
2016-04-11 07:58:41 -05:00
Yury Delendik
879340d741 Removes hijack describe() hack from unit tests. 2016-04-11 07:37:35 -05:00
Yury Delendik
44c63bca28 Merge pull request #7175 from Snuffleupagus/issue-6905-font_spec
Use `beforeAll`/`afterAll` in font_spec.js (issue 6905)
2016-04-11 07:20:45 -05:00
Yury Delendik
070f2d32ad Merge pull request #7171 from Snuffleupagus/remove-new-Name/Cmd
Remove the remaining usages of `new {Name,Cmd}` in favor of `{Name,Cmd}.get`
2016-04-11 07:17:30 -05:00
Jonas Jenwald
c4e21c93a2 Use beforeAll/afterAll in font_spec.js (issue 6905)
This patch fixes the only remaining point in issue 6905.
2016-04-10 16:09:11 +02:00
Tim van der Meij
5f925a561e Merge pull request #7174 from Snuffleupagus/issue-6905-crypto_spec
Use `beforeAll`/`afterAll` in `CipherTransformFactory` in crypto_spec.js (issue 6905)
2016-04-10 14:13:24 +02:00
Jonas Jenwald
b0ce83b372 Use beforeAll/afterAll in CipherTransformFactory in crypto_spec.js (issue 6905
This patch also adds/improves utility functions for checking if the passwords are correct/incorrect, and replaces `string2binary` with `stringToBytes`. Finally the patch does away with the `DictMock`, in favour of using actual `Dict`s.

Re: issue 6905.
2016-04-10 13:20:21 +02:00
Jonas Jenwald
f59c3a0644 Remove the remaining usages of new {Name,Cmd} in favor of {Name,Cmd}.get
Using `new {Name,Cmd}` should be avoided, since it creates a new object on *every* call, whereas `{Name,Cmd}.get` uses caches to only create *one* object regardless of how many times they are called.

Most of these are found in the unit-tests, where increased memory usage probably doesn't matter very much. But it still seems good to get rid of those cases, since no part of the codebase ought to advertise that usage.

Given the small size of the patch, I'm also tweaking a few comments and class names.
2016-04-08 12:14:05 +02:00
Yury Delendik
1c253e6e1d Merge pull request #7170 from Snuffleupagus/pr-7097-followup
Prevent the *entire* viewer from zooming, when quickly switching from scrolling to zooming using the mousewheel (PR 7097 followup)
2016-04-07 14:55:00 -05:00
Jonas Jenwald
514210814d Prevent the *entire* viewer from zooming, when quickly switching from scrolling to zooming using the mousewheel (PR 7097 followup)
This is a regression from PR 7097.

(Also, out of scope for this PR, but I think that a `setTimeout` value of `1000 ms` is too large. Switching from scrolling to zooming can fell sluggish, and give the impression that nothing happens.)
2016-04-07 21:04:52 +02:00