mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Update Prettier to version 2.0
Please note that these changes were done automatically, using `gulp lint --fix`. Given that the major version number was increased, there's a fair number of (primarily whitespace) changes; please see https://prettier.io/blog/2020/03/21/2.0.0.html In order to reduce the size of these changes somewhat, this patch maintains the old "arrowParens" style for now (once mozilla-central updates Prettier we can simply choose the same formatting, assuming it will differ here).
This commit is contained in:
parent
a4dd081d7b
commit
426945b480
145 changed files with 2005 additions and 2009 deletions
|
@ -30,7 +30,7 @@ function buildSVG(viewport, textContent) {
|
|||
svg.setAttribute("font-size", 1);
|
||||
|
||||
// processing all items
|
||||
textContent.items.forEach(function(textItem) {
|
||||
textContent.items.forEach(function (textItem) {
|
||||
// we have to take in account viewport transform, which includes scale,
|
||||
// rotation and Y-axis flip, and not forgetting to flip text.
|
||||
var tx = pdfjsLib.Util.transform(
|
||||
|
@ -51,10 +51,10 @@ function buildSVG(viewport, textContent) {
|
|||
function pageLoaded() {
|
||||
// Loading document and page text content
|
||||
var loadingTask = pdfjsLib.getDocument({ url: PDF_PATH });
|
||||
loadingTask.promise.then(function(pdfDocument) {
|
||||
pdfDocument.getPage(PAGE_NUMBER).then(function(page) {
|
||||
loadingTask.promise.then(function (pdfDocument) {
|
||||
pdfDocument.getPage(PAGE_NUMBER).then(function (page) {
|
||||
var viewport = page.getViewport({ scale: PAGE_SCALE });
|
||||
page.getTextContent().then(function(textContent) {
|
||||
page.getTextContent().then(function (textContent) {
|
||||
// building SVG and adding that to the DOM
|
||||
var svg = buildSVG(viewport, textContent);
|
||||
document.getElementById("pageContainer").appendChild(svg);
|
||||
|
@ -63,7 +63,7 @@ function pageLoaded() {
|
|||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
if (typeof pdfjsLib === "undefined") {
|
||||
alert(
|
||||
"Built version of PDF.js was not found.\n" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue