1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-23 15:21:25 +01:00

feat: only load pdf-lib when its used

This commit is contained in:
sbplat 2024-09-14 20:55:35 -04:00
parent d389b5e2f3
commit 7e2a53a02e
6 changed files with 5 additions and 5 deletions

View File

@ -37,9 +37,6 @@
<!-- PDF.js -->
<script type="module" th:src="@{'/pdfjs-legacy/pdf.mjs'}" th:if="${currentPage != 'home'}"></script>
<!-- PDF-Lib -->
<script th:src="@{'/js/thirdParty/pdf-lib.min.js'}" th:if="${currentPage != 'home'}"></script>
<!-- Custom -->
<link rel="stylesheet" th:href="@{'/css/general.css'}">
<link rel="stylesheet" th:href="@{'/css/theme/theme.css'}">

View File

@ -66,6 +66,7 @@
<!-- draggables box -->
<div id="box-drag-container" class="show-on-file-selected">
<canvas id="pdf-canvas"></canvas>
<script th:src="@{'/js/thirdParty/pdf-lib.min.js'}"></script>
<script th:src="@{'/js/draggable-utils.js'}"></script>
<div class="draggable-buttons-box ignore-rtl">
<button class="btn btn-outline-secondary" onclick="DraggableUtils.deleteDraggableCanvas(DraggableUtils.getLastInteracted())">

View File

@ -53,7 +53,7 @@
</div>
</form>
<script th:src="@{'/js/thirdParty/pdf-lib.min.js'}"></script>
<script>
var canvas = document.getElementById('contrast-pdf-canvas');
var context = canvas.getContext('2d');

View File

@ -28,6 +28,7 @@
</div>
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
</div>
<script th:src="@{'/js/thirdParty/pdf-lib.min.js'}"></script>
<script th:src="@{'/js/local-pdf-input-download.js'}"></script>
<script>
document.getElementById('pdfForm').addEventListener('submit', async (e) => {

View File

@ -75,7 +75,7 @@
<div id="drag-container"></div>
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
</div>
<script th:src="@{'/js/thirdParty/pdf-lib.min.js'}"></script>
<script type="module">
import PdfContainer from './js/multitool/PdfContainer.js';
import DragDropManager from "./js/multitool/DragDropManager.js";

View File

@ -229,6 +229,7 @@
<!-- draggables box -->
<div id="box-drag-container" class="show-on-file-selected">
<canvas id="pdf-canvas"></canvas>
<script th:src="@{'/js/thirdParty/pdf-lib.min.js'}"></script>
<script th:src="@{'/js/draggable-utils.js'}"></script>
<div class="draggable-buttons-box ignore-rtl">
<button class="btn btn-outline-secondary" onclick="DraggableUtils.deleteDraggableCanvas(DraggableUtils.getLastInteracted())">