From 51ad741744575917c34d82ba22b0271827409f56 Mon Sep 17 00:00:00 2001 From: Ludy Date: Sun, 18 Feb 2024 08:40:30 +0100 Subject: [PATCH] Fix 746 (#825) * Fix: #746 * formatting --- .../SPDF/config/EndpointConfiguration.java | 2 +- src/main/resources/static/js/downloader.js | 16 +- src/main/resources/static/pdfjs/js/viewer.js | 4 +- .../resources/templates/fragments/common.html | 38 +- .../templates/misc/adjust-contrast.html | 440 +++++++++--------- .../resources/templates/misc/compare.html | 10 +- .../templates/misc/extract-images.html | 2 +- .../resources/templates/misc/flatten.html | 28 +- src/main/resources/templates/view-pdf.html | 8 +- 9 files changed, 265 insertions(+), 283 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java b/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java index 752474a0..2b25b7fb 100644 --- a/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java +++ b/src/main/java/stirling/software/SPDF/config/EndpointConfiguration.java @@ -218,7 +218,7 @@ public class EndpointConfiguration { addEndpointToGroup("Java", "overlay-pdf"); addEndpointToGroup("Java", "split-pdf-by-sections"); addEndpointToGroup("Java", "remove-blanks"); - + // Javascript addEndpointToGroup("Javascript", "pdf-organizer"); addEndpointToGroup("Javascript", "sign"); diff --git a/src/main/resources/static/js/downloader.js b/src/main/resources/static/js/downloader.js index a4794e12..9871b69d 100644 --- a/src/main/resources/static/js/downloader.js +++ b/src/main/resources/static/js/downloader.js @@ -25,16 +25,15 @@ $(document).ready(function () { const originalButtonText = $("#submitBtn").text(); $("#submitBtn").text("Processing..."); console.log(override); - + // Set a timeout to show the game button if operation takes more than 5 seconds const timeoutId = setTimeout(() => { - var boredWaiting = localStorage.getItem("boredWaiting") || "disabled"; - const showGameBtn = document.getElementById('show-game-btn'); - if(boredWaiting === "enabled" && showGameBtn){ - showGameBtn.style.display = 'block'; + var boredWaiting = localStorage.getItem("boredWaiting") || "disabled"; + const showGameBtn = document.getElementById("show-game-btn"); + if (boredWaiting === "enabled" && showGameBtn) { + showGameBtn.style.display = "block"; } - }, 5000); - + }, 5000); try { if (remoteCall === true) { @@ -46,9 +45,8 @@ $(document).ready(function () { } clearTimeout(timeoutId); $("#submitBtn").text(originalButtonText); - } catch (error) { - clearTimeout(timeoutId); + clearTimeout(timeoutId); handleDownloadError(error); $("#submitBtn").text(originalButtonText); console.error(error); diff --git a/src/main/resources/static/pdfjs/js/viewer.js b/src/main/resources/static/pdfjs/js/viewer.js index f533f24b..3ed440f6 100644 --- a/src/main/resources/static/pdfjs/js/viewer.js +++ b/src/main/resources/static/pdfjs/js/viewer.js @@ -3323,13 +3323,13 @@ kind: OptionKind.WORKER }, workerSrc: { - value: "/pdfjs/pdf.worker.js", + value: "./pdfjs/pdf.worker.js", kind: OptionKind.WORKER } }; { defaultOptions.defaultUrl = { - value: "/pdfjs/example/Welcome.pdf", + value: "./pdfjs/example/Welcome.pdf", kind: OptionKind.VIEWER }; defaultOptions.disablePreferences = { diff --git a/src/main/resources/templates/fragments/common.html b/src/main/resources/templates/fragments/common.html index 10c38afa..517a902b 100644 --- a/src/main/resources/templates/fragments/common.html +++ b/src/main/resources/templates/fragments/common.html @@ -34,7 +34,7 @@ - + @@ -70,24 +70,22 @@
diff --git a/src/main/resources/templates/misc/adjust-contrast.html b/src/main/resources/templates/misc/adjust-contrast.html index d5bd1115..537985ec 100644 --- a/src/main/resources/templates/misc/adjust-contrast.html +++ b/src/main/resources/templates/misc/adjust-contrast.html @@ -4,272 +4,260 @@ - -
-
- -

-
-
-
-
-
-
+
- -
- + diff --git a/src/main/resources/templates/misc/compare.html b/src/main/resources/templates/misc/compare.html index c225f6b2..3b564855 100644 --- a/src/main/resources/templates/misc/compare.html +++ b/src/main/resources/templates/misc/compare.html @@ -4,11 +4,11 @@ diff --git a/src/main/resources/templates/misc/extract-images.html b/src/main/resources/templates/misc/extract-images.html index b14c9b20..bf79fa54 100644 --- a/src/main/resources/templates/misc/extract-images.html +++ b/src/main/resources/templates/misc/extract-images.html @@ -5,7 +5,7 @@ - +
diff --git a/src/main/resources/templates/misc/flatten.html b/src/main/resources/templates/misc/flatten.html index 1d4563bc..6107fcc4 100644 --- a/src/main/resources/templates/misc/flatten.html +++ b/src/main/resources/templates/misc/flatten.html @@ -21,26 +21,26 @@ diff --git a/src/main/resources/templates/view-pdf.html b/src/main/resources/templates/view-pdf.html index 8aca4542..afe4e957 100644 --- a/src/main/resources/templates/view-pdf.html +++ b/src/main/resources/templates/view-pdf.html @@ -32,11 +32,11 @@ See https://github.com/adobe-type-tools/cmap-resources - - + + - - + +