You've already forked pdf.js
11870 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5b17fe81dc
|
Merge pull request #9913 from Snuffleupagus/no-restricted-globals
Provide custom messages for the `no-restricted-globals` ESLint rule, and refactor the `.eslintrc` files (PR 9868 follow-up) |
||
|
|
36b683ca55 |
Provide custom messages for the no-restricted-globals ESLint rule, and refactor the .eslintrc files (PR 9868 follow-up)
Without providing useful (custom) error messages for the `no-restricted-globals` rule, see https://eslint.org/docs/rules/no-restricted-globals, it's quite likely that the rule will be incorrectly disabled rather than the required globals being imported as intended. To reduced duplication of the `no-restricted-globals` rule in multiple `.eslintrc` files, it's instead moved to the top-level `.eslintrc` file and disabled as needed on a folder/file basis outside of `/src` and `/web`. |
||
|
|
1aaeaf3338
|
Merge pull request #9904 from RonLek/master
Modified Examples to work without systemjs |
||
|
|
2ce489c16f
|
Merge pull request #9900 from Snuffleupagus/issue-8884
Prevent Metadata/XML parsing from breaking `PDFDocumentProxy.getMetadata` when no XML root document is found (issue 8884) |
||
|
|
8afc4ce258 | Modified Examples to work without systemjs | ||
|
|
8ec99b200c |
Prevent Metadata/XML parsing from breaking PDFDocumentProxy.getMetadata when no XML root document is found (issue 8884)
With the new XML parser, see PR 9573, the referenced PDF file now causes `getMetadata` to fail when incomplete XML tags are encountered. This provides a simple, and hopefully generally useful, work-around that may also help prevent future bugs. (Without being able to reproduce nor even understand the other (non XML) errors mentioned in issue 8884, I'd say that this patch is enough to close that one as fixed.) |
||
|
|
7e13977669
|
Merge pull request #9898 from Snuffleupagus/rm-createPromiseCapability-waitOnEventOrTimeout
Change `waitOnEventOrTimeout`, in web/ui_utils.js, to return a regular `Promise` and remove the `createPromiseCapability` import |
||
|
|
647fa74793 |
Change waitOnEventOrTimeout, in web/ui_utils.js, to return a regular Promise and remove the createPromiseCapability import
*Another small piece of clean-up of code I've previously written; follow-up to PR 8775.* Importing `createPromiseCapability`, and then using it in just *one* spot, seems unnecessary since the `waitOnEventOrTimeout` function may just as well return a regular `Promise` directly. |
||
|
|
61db85ab64
|
Merge pull request #9886 from Snuffleupagus/bug-1473809
Prevent errors in `sanitizeTTProgram`, during parsing of CALL functions, when encountering invalid functions stack deltas (bug 1473809) |
||
|
|
b56081c5f8
|
Merge pull request #9887 from Snuffleupagus/rm-Util-inherit
Convert more code in the `/src` folder to use ES6 classes, such that `Util.inherit` can be removed |
||
|
|
1f245c247f
|
Merge pull request #9881 from Snuffleupagus/rm-instanceof-Array
Replace the remaining occurences of `instanceof Array` with `Array.isArray()` |
||
|
|
8e76d26e5b |
Move the toRoman helper function out of the Util scope
Compared to all the other (static) methods in `Util`, the `toRoman` one looks slightly out of place. Even more so considering that `Util` is being exposed through `pdfjsLib`, where access to a Roman numerals conversion method doesn't make much sense. |
||
|
|
c1c49badff |
Remove the, now unused, Util.inherit helper function
|
||
|
|
2b25deb84c |
Prevent errors in sanitizeTTProgram, during parsing of CALL functions, when encountering invalid functions stack deltas (bug 1473809)
*I was feeling bored; so this is a very quick, and somewhat naive, attempt at fixing the bug.* The breaking error, i.e. `Error during font loading: invalid array length`, was thrown when attempting to re-size the `stack` to a *negative* length when parsing the CALL functions. Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1473809. |
||
|
|
bf6d45f85a |
Convert CMap and IdentityCMap to ES6 classes
Also changes `var` to `let`/`const` in code already touched in the patch. |
||
|
|
b773b356af |
Convert NameOrNumberTree, NameTree, and NumberTree to ES6 classes
Also changes `var` to `let`/`const` in code already touched in the patch. |
||
|
|
ba1af46709 |
Convert CompiledFont, TrueTypeCompiled, and Type2Compiled to ES6 classes
Also changes `var` to `let`/`const` in code already touched in the patch. |
||
|
|
775763a091 |
Ensure that CompiledFont.compileGlyph always returns an Array (PR 6141 follow-up)
PR 6141 changed `CompiledFont.compileGlyph` to, in the general case, return an Array. However, that PR apparenly forgot to update the no-glyph, empty-glyph, and endchar-glyph code-path and a String was still being (incorrectly) returned. Given the way that `FontFaceObject.getPathGenerator` (on the API side) is implemented, this shouldn't have caused any bugs despite the Worker possible returning unexpected data. |
||
|
|
646d81cd09
|
Merge pull request #9837 from timvandermeij/unreachable
Replace `NotImplementedException` with `unreachable` |
||
|
|
61186698c3 |
Replace the remaining occurences of instanceof Array with Array.isArray()
*Follow-up to PRs 8864 and 8813.* As explained in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray, `instanceof Array` can have inconsistent behavior. To ensure that only `Array.isArray` is used, an ESLint plugin/rule is added to enforce this. |
||
|
|
200e3d6bd8 | Update the various ESLint packages to their latest versions | ||
|
|
907c7f190b
|
Convert src/code/pdf_manager.js to ES6 classes/syntax
|
||
|
|
31012570ea
|
Merge pull request #9868 from Snuffleupagus/url-polyfill
Stop exposing the `URL` polyfill in the global scope |
||
|
|
7e1f727685
|
Merge pull request #9877 from Snuffleupagus/scroll-spread-hide
Hide the Scroll/Spread mode buttons if the viewer is a `PDFSinglePageViewer` instance (PR 9858 follow-up) |
||
|
|
9c06338258
|
Merge pull request #9880 from timvandermeij/jp-JP-mac
Remove the `jp-JP-mac` locale |
||
|
|
8a6b7373a0
|
Remove the jp-JP-mac locale
It gives warnings when running `gulp locale`, in a previous patch it was explicitly asked to remove it and there is quite a bit of discussion about the validity of the locale at https://bugzilla.mozilla.org/show_bug.cgi?id=418485. In short, let's remove it to prevent these issues. |
||
|
|
9c613a3563
|
Merge pull request #9879 from timvandermeij/readme
Correct the instructions in the README file for `examples/mobile-viewer` |
||
|
|
1024615ecb
|
Correct the instructions in the README file for examples/mobile-viewer
|
||
|
|
d8c2bcc93a |
Temporarily disable the Spread mode buttons when horizontal scrolling is enabled
Given that the non-default Spread modes (currently) doesn't affect the page layout when horizontal scrolling is enabled, having the Spread buttons appear active when clicking them appears to do *nothing* is probably confusing rather than helpful to users. |
||
|
|
36d6255866 |
Hide the Scroll/Spread mode buttons when the viewer is a PDFSinglePageViewer instance
If the current viewer is a `PDFSinglePageViewer` instance the Scroll/Spread modes are no-ops, hence displaying buttons that do *nothing* when clicked will probably do very little besides confuse users. |
||
|
|
46e1d5daa4 |
Simplify resetting of the SecondaryToolbar Scroll/Spread mode buttons, and add a missing comment in PDFCursorTools
The names 'resetscrollmode'/'resetspreadmode' were probably *not* great choices, given that the only thing being reset are toolbar buttons and not the actual Scroll/Spread modes. Furthermore, there's really no need for two separate events here. The patch also adds a comment that ought to have been included in PR 9040, to prevent future refactoring/removing of what may appear to be an unnecessary `Promise.resolve` call. |
||
|
|
b39a2ba57a
|
Merge pull request #9866 from Snuffleupagus/gulp-server-private-browsing
Prevent the development viewer, started with `gulp server`, from breaking completely in Private Browsing mode |
||
|
|
a9ce4e8417 |
Stop exposing the URL polyfill in the global scope
This moves/exposes the `URL` polyfill similarily to the existing `ReadableStream` polyfill, rather than exposing it globally, to avoid interfering with any "outside" code. Both the `URL` and `ReadableStream` polyfills are now exposed on the `pdfjsLib` object, such that they are accessible to the viewer components. Furthermore, the `no-restricted-globals` ESLint rule is also enabled to prevent accidental usage of the native `URL`/`ReadableStream` implementations directly in the `src/` and `web/` folders; see also https://eslint.org/docs/rules/no-restricted-globals Addresses the remaining TODO in https://github.com/mozilla/pdf.js/projects/6 |
||
|
|
8f0cc07116 |
Prevent the development viewer, started with gulp server, from breaking completely in Private Browsing mode
Since attempting to access `IndexedDB` in Private Browsing mode in Firefox will throw an error, see https://bugzilla.mozilla.org/show_bug.cgi?id=781982, the development viewer fails to load. |
||
|
|
42922c9ae5
|
Merge pull request #9861 from Snuffleupagus/PDFFindController-firstPagePromise
Refactor `PDFFindController` to use the 'pagesinit' event, dispatched on the `eventBus`, to resolve the `_firstPagePromise` |
||
|
|
39a1fce59b |
Refactor PDFFindController to use the 'pagesinit' event, dispatched on the eventBus, to resolve the _firstPagePromise
Rather than having to manually call a method on `PDFFindController` instances from `BaseViewer.setDocument`, thus essentially having to resolve the private `_firstPagePromise` from the "outside", this can be done easily with the 'pagesinit' event dispatched on the `eventBus` instead. Please note this particular `PDFFindController` code pre-dates the `eventBus` by almost three years, which should explain why the code looks the way it does. |
||
|
|
872c6e4af0
|
Merge pull request #9858 from Snuffleupagus/scrollMode-refactor
Additional Scroll/Spread mode clean-up (PR 9832 follow-up) |
||
|
|
4fbad9ab68
|
Merge pull request #9860 from timvandermeij/readme
Update the localization README to indicate that the translations are imported from the Nightly channel |
||
|
|
fa7eb95eed
|
Update the localization README to indicate that the translations are imported from the Nightly channel | ||
|
|
ce430bdfb5
|
Merge pull request #9859 from timvandermeij/updates
Update translations and packages |
||
|
|
ac401c65a0
|
Update packages | ||
|
|
5baec1eeb4
|
Update translations | ||
|
|
ff26d419dd |
Ensure that Scroll/Spread mode buttons are correctly reset, when the document is closed
Since the Scroll/Spread modes are now document specific, as all other properties such as page/scale/rotation, ensure that the toolbar is always correctly reset. |
||
|
|
bb193dc501 |
For consistency with other viewer state, remove and deprecate setting Scroll/Spread modes in the BaseViewer constructor
Since other viewer state, such as the current page/scale/rotation[1], are not available as `BaseViewer` constructor options, this makes the Scroll/Spread modes stand out quite a bit. Hence it probably makes sense to remove/deprecate this, to avoid inconsistent and possibly confusing state in this code. --- [1] These properties are *purposely* not available in the constructor, since attempting to set them before a document is loaded has number of issues; please refer to https://github.com/mozilla/pdf.js/pull/8539#issuecomment-309706629 for additional details. |
||
|
|
8b85ae4181 |
Re-factor updating of Scroll/Spread modes, and place all the code in BaseViewer with overrides (as necessary) in the extending classes
This structure probably makes somewhat more sense, given that `PDFSinglePageViewer` is somewhat of a special case. |
||
|
|
a7ac27e385 |
Replace setScrollMode/setSpreadMode methods with getters/setters
Since all the other viewer methods use the getter/setter pattern, e.g. for setting page/scale/rotation, the way that the Scroll/Spread modes are set thus stands out. For consistency, this really ought to use the same pattern as the rest of the `BaseViewer`. (To avoid breaking third-party implementations, the old methods are kept around as aliases.) |
||
|
|
9515f579c6 |
Change the scrollMode/spreadMode to "private" properties on BaseViewer instances
|
||
|
|
a9a93bd923 |
Allow the scrollModeOnLoad/spreadModeOnLoad Preferences to override ViewHistory settings
Note how the other "...OnLoad" preferences will allow a *non-default* value to always override a history entry. To improve overall consistency for the viewer options, and to reduce possibly confusing behaviour, this patch changes the `scrollModeOnLoad`/`spreadModeOnLoad` preferences to behave as all the other ones. |
||
|
|
baf9c98bc7 |
Add scrollModeOnLoad/spreadModeOnLoad default values to AppOptions
For some reason, these weren't added to `AppOptions` despite actually being set and read from `web/app.js`. Not adding them creates inconsistencies, since all other options *are* present in `web/app_options.js`. |
||
|
|
e522b2d87e |
Remove the unused PDFViewerApplication.documentFingerprint property
This property isn't accessed anywhere in the `web/app.js` file, and is also not being reset in `PDFViewerApplication.close`. Hence it seems that it can simply be removed, especially since the fingerprint is already synchronously available through `PDFViewerApplication.pdfDocument.fingerprint` (provided that a document is loaded). |