pdf.js/examples
Jonas Jenwald fa8c0ef616 [api-minor] Change PDFFindController to use the "find"-event directly (issue 12731)
Looking at the code, I do have to agree with the point made in issue 12731 about it being unexpected/unhelpful that the `PDFFindController.executeCommand`-method isn't directly usable with the "find"-event.
The reason for it being this way is, as so often, for historical reasons: The `executeCommand`-method was added (just) prior to the introduction of the `EventBus` in the viewer.

Obviously we cannot simply change the existing `PDFFindController.executeCommand`-method, since that'd be a breaking change in code which has existed for over five years.
Initially I figured that we could simply add a new method in `PDFFindController` that'd accept the state from the "find"-event, however after thinking about this and looking through the use-cases in the default viewer I settled on a slightly different approach: Let the `PDFFindController` just listen for the "find"-event (on the `EventBus`-instance) directly instead, which also removes one level of (unneeded) indirection during searching in the default viewer.

For GENERIC builds of the PDF.js library, the old `PDFFindController.executeCommand`-method is still available with a deprecation warning.
2021-10-16 10:36:22 +02:00
..
browserify Replace *most* cases of var with let/const in the examples/ folder 2021-03-12 17:16:59 +01:00
components [api-minor] Change PDFFindController to use the "find"-event directly (issue 12731) 2021-10-16 10:36:22 +02:00
image_decoders Replace *most* cases of var with let/const in the examples/ folder 2021-03-12 17:16:59 +01:00
learning Convert examples/learning/helloworld64.html to await/async 2021-10-15 20:00:54 +01:00
mobile-viewer Simplify the animationStarted handling in the mobile-viewer/ example 2021-03-12 17:52:58 +01:00
node Convert examples/node/pdf2png/pdf2png.js to await/async 2021-10-14 20:35:18 +10:00
svgviewer Replace *most* cases of var with let/const in the examples/ folder 2021-03-12 17:16:59 +01:00
text-only converted examples/text-only/pdf2svg.js to await/async 2021-10-15 09:54:10 +01:00
webpack Update webpack import instructions 2021-05-28 20:46:56 -04:00
.eslintrc Enable the ESLint no-var rule globally 2021-03-13 16:12:53 +01:00