1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Replace *most* cases of var with let/const in the examples/ folder

These changes were done automatically, by using the `gulp lint --fix` command, in preparation for the next patch.
This commit is contained in:
Jonas Jenwald 2021-03-12 17:08:17 +01:00
parent 56fd01bf8d
commit 276fa4ad8f
15 changed files with 196 additions and 194 deletions

View file

@ -27,40 +27,40 @@ pdfjsLib.GlobalWorkerOptions.workerSrc =
// Some PDFs need external cmaps.
//
var CMAP_URL = "../../node_modules/pdfjs-dist/cmaps/";
var CMAP_PACKED = true;
const CMAP_URL = "../../node_modules/pdfjs-dist/cmaps/";
const CMAP_PACKED = true;
var DEFAULT_URL = "../../web/compressed.tracemonkey-pldi-09.pdf";
const DEFAULT_URL = "../../web/compressed.tracemonkey-pldi-09.pdf";
// To test the AcroForm and/or scripting functionality, try e.g. this file:
// var DEFAULT_URL = "../../test/pdfs/160F-2019.pdf";
var SEARCH_FOR = ""; // try 'Mozilla';
const SEARCH_FOR = ""; // try 'Mozilla';
// For scripting support, note also `enableScripting` below.
var SANDBOX_BUNDLE_SRC = "../../node_modules/pdfjs-dist/build/pdf.sandbox.js";
const SANDBOX_BUNDLE_SRC = "../../node_modules/pdfjs-dist/build/pdf.sandbox.js";
var container = document.getElementById("viewerContainer");
const container = document.getElementById("viewerContainer");
var eventBus = new pdfjsViewer.EventBus();
const eventBus = new pdfjsViewer.EventBus();
// (Optionally) enable hyperlinks within PDF files.
var pdfLinkService = new pdfjsViewer.PDFLinkService({
const pdfLinkService = new pdfjsViewer.PDFLinkService({
eventBus,
});
// (Optionally) enable find controller.
var pdfFindController = new pdfjsViewer.PDFFindController({
const pdfFindController = new pdfjsViewer.PDFFindController({
eventBus,
linkService: pdfLinkService,
});
// (Optionally) enable scripting support.
var pdfScriptingManager = new pdfjsViewer.PDFScriptingManager({
const pdfScriptingManager = new pdfjsViewer.PDFScriptingManager({
eventBus,
sandboxBundleSrc: SANDBOX_BUNDLE_SRC,
});
var pdfViewer = new pdfjsViewer.PDFViewer({
const pdfViewer = new pdfjsViewer.PDFViewer({
container,
eventBus,
linkService: pdfLinkService,
@ -82,7 +82,7 @@ eventBus.on("pagesinit", function () {
});
// Loading document.
var loadingTask = pdfjsLib.getDocument({
const loadingTask = pdfjsLib.getDocument({
url: DEFAULT_URL,
cMapUrl: CMAP_URL,
cMapPacked: CMAP_PACKED,