TimeTrex/interface/html5/dist/hr-recruitment-JobApplicationViewController.bundle.js

1 line
71 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["hr-recruitment-JobApplicationViewController"],{6719:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"JobApplicationViewController\": () => (/* binding */ JobApplicationViewController)\n});\n\n// EXTERNAL MODULE: ./node_modules/pdfjs-dist/build/pdf.js\nvar pdf = __webpack_require__(9299);\n// EXTERNAL MODULE: ./node_modules/pdfjs-dist/web/pdf_viewer.js\nvar pdf_viewer = __webpack_require__(7963);\n;// CONCATENATED MODULE: ./interface/html5/components/pdf_viewer/ttpdfviewer.js\n/* provided dependency */ var $ = __webpack_require__(9755);\n/*\n * For future reference, quite a lot of this code is based on the following, and potentially more, but these are the links I remember:\n * https://github.com/mozilla/pdf.js/tree/master/examples/components\n * https://github.com/mozilla/pdf.js/tree/master/examples/acroforms\n * https://github.com/mozilla/pdfjs-dist/tree/master/web\n * https://github.com/mozilla/pdf.js/tree/master/web\n *\n * JSFiddle examples: https://jsfiddle.net/redfox05/btaqyse6/ , https://jsfiddle.net/redfox05/xvpzwLc2/ , https://jsfiddle.net/redfox05/rdyzef3o/\n */\n\n\n\n\n\n// window.pdfjsLib = pdfjsLib;\n// window.pdfjsViewer = pdfjsViewer;\n\nclass TTPDFViewer {\n\tconstructor( options ) {\n\t\tthis.pdf_count = 0;\n\t\tthis.url_array = [];\n\t\tthis.target = null;\n\n\t\treturn this.initPDFViewer( options.urls, options.target );\n\t}\n\n\tinitPDFViewer( url_array, target ) {\n\t\tthis.url_array = url_array; // needed as a global for the eventBus to trigger the next document load.\n\t\tthis.target = target; // Also needed for the eventBus next doc loading.\n\n\t\tif( !Array.isArray( url_array )) {\n\t\t\turl_array = [ url_array ];\n\t\t}\n\n\t\tif( url_array.length > 1 ) {\n\t\t\t$('.resume-label .label' ).text( $.i18n._( 'Resume' ) + ' (' + url_array.length + ' ' + $.i18n._( 'documents' ) + ')');\n\t\t}\n\t\tthis.loadMultiplePDF( url_array, target );\n\t}\n\n\tloadMultiplePDF( url_array, target ) {\n\t\t// Load first PDF via initPDFViewer, and loads the rest in callbacks.\n\t\tif( Array.isArray( url_array ) && url_array.length > 0 ) {\n\t\t\tvar current_url = url_array.pop();\n\n\t\t\t// If not the first page, then add a divider between multiple PDF documents.\n\t\t\tif( this.pdf_count !== 0 ) {\n\t\t\t\tvar document_divider = document.createElement( 'hr' );\n\t\t\t\ttarget.appendChild( document_divider );\n\t\t\t}\n\n\t\t\t// Start to cycle through each pdf, loading the first one\n\t\t\tvar container = document.createElement( 'div' );\n\t\t\tcontainer.className = 'pdfContainer';\n\t\t\tcontainer.setAttribute('data-document-index', this.pdf_count);\n\t\t\ttarget.appendChild( container );\n\n\t\t\tthis.loadPDF( current_url, container, this.pdf_count );\n\n\t\t\tthis.pdf_count++;\n\t\t}\n\t}\n\n\tloadPDF( pdf_url, container, pdf_id ) {\n\t\tif (!pdf.getDocument || !pdf_viewer.PDFPageView) {\n\t\t\talert(\"Please build the pdfjs-dist library using\\n `gulp dist-install`\");\n\t\t}\n\n\t\t// The workerSrc property shall be specified.\n\t\t// pdfjsLib.GlobalWorkerOptions.workerSrc = \"../../node_modules/pdfjs-dist/build/pdf.worker.js\";\n\t\tpdf.GlobalWorkerOptions.workerSrc = \"dist/pdf.worker.js\";\n\n\t\t// Some PDFs need external cmaps.\n\t\t// var CMAP_URL = \"../../node_modules/pdfjs-dist/cmaps/\";\n\t\tvar CMAP_URL = \"dist/pdfjs-cmaps/\"; // This cmap directory is automatically copied by webpack config from from node_modules into dist at build.\n\t\tvar CMAP_PACKED = true;\n\n\t\t// var DEFAULT_URL = \"../../web/compressed.tracemonkey-pldi-09.pdf\";\n\t\tvar DEFAULT_URL = pdf_url;\n\t\tvar DEFAULT_SCALE = 1.0;\n\t\tvar CSS_UNITS = 96/72; // Fixed scale calculations by taking into account CSS units. https://github.com/mozilla/pdf.js/issues/5628#issuecomment-367399215\n\n\t\t// Already passed into the function.\n\t\t// var container = document.getElementById(\"pageContainer\");\