2023-05-02 22:59:16 +01:00
|
|
|
<!DOCTYPE html>
|
2024-11-22 14:40:09 -03:00
|
|
|
<html th:lang="${#locale.language}" th:dir="#{language.direction}" th:data-language="${#locale.toString()}"
|
|
|
|
xmlns:th="https://www.thymeleaf.org">
|
|
|
|
|
|
|
|
<head>
|
2024-02-16 22:49:06 +01:00
|
|
|
<th:block th:insert="~{fragments/common :: head(title=#{sign.title}, header=#{sign.header})}"></th:block>
|
2024-11-22 14:40:09 -03:00
|
|
|
<link rel="stylesheet" th:href="@{'/css/sign.css'}">
|
2024-10-22 00:44:22 +01:00
|
|
|
|
2024-11-22 14:40:09 -03:00
|
|
|
<th:block th:each="font : ${fonts}">
|
2023-07-09 19:36:41 +01:00
|
|
|
<style th:inline="text">
|
2024-02-16 22:49:06 +01:00
|
|
|
@font-face {
|
|
|
|
font-family: "[[${font.name}]]";
|
|
|
|
src: url('fonts/[[${font.name}]].[[${font.extension}]]') format('[[${font.type}]]');
|
|
|
|
}
|
|
|
|
|
|
|
|
#font-select option[value="[[${font.name}]]"] {
|
2024-10-22 00:44:22 +01:00
|
|
|
font-family: "[[${font.name}]]",
|
2025-01-20 14:11:31 +02:00
|
|
|
cursive
|
|
|
|
!important;
|
2024-02-16 22:49:06 +01:00
|
|
|
}
|
2023-07-09 19:36:41 +01:00
|
|
|
</style>
|
2024-11-22 14:40:09 -03:00
|
|
|
</th:block>
|
|
|
|
<script th:src="@{'/js/thirdParty/signature_pad.umd.min.js'}"></script>
|
|
|
|
<script th:src="@{'/js/thirdParty/interact.min.js'}"></script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<div id="page-container">
|
|
|
|
<div id="content-wrap">
|
|
|
|
<th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
|
|
|
|
<br><br>
|
|
|
|
<div class="container">
|
|
|
|
<div class="row justify-content-center">
|
2025-01-02 15:49:29 +00:00
|
|
|
<div class="col-md-7 bg-card">
|
2024-11-22 14:40:09 -03:00
|
|
|
<div class="tool-header">
|
|
|
|
<span class="material-symbols-rounded tool-header-icon sign">signature</span>
|
|
|
|
<span class="tool-header-text" th:text="#{sign.header}"></span>
|
|
|
|
</div>
|
2024-10-22 00:44:22 +01:00
|
|
|
|
2024-11-22 14:40:09 -03:00
|
|
|
<!-- pdf selector -->
|
|
|
|
<div
|
|
|
|
th:replace="~{fragments/common :: fileSelector(name='pdf-upload', multipleInputsForSingleRequest=false, disableMultipleFiles=true, accept='application/pdf')}">
|
|
|
|
</div>
|
|
|
|
<script type="module" th:src="@{'/pdfjs-legacy/pdf.mjs'}"></script>
|
|
|
|
<div class="tab-group show-on-file-selected">
|
2025-01-31 23:03:32 +00:00
|
|
|
<div class="tab-container" th:title="#{sign.upload}" th:data-title="#{sign.upload}">
|
2024-11-22 14:40:09 -03:00
|
|
|
<div
|
2025-01-02 15:49:29 +00:00
|
|
|
th:replace="~{fragments/common :: fileSelector(name='image-upload', disableMultipleFiles=false, multipleInputsForSingleRequest=true, accept='image/*', inputText=#{imgPrompt})}">
|
2024-10-22 00:44:22 +01:00
|
|
|
</div>
|
2024-11-22 14:40:09 -03:00
|
|
|
</div>
|
2024-02-16 22:49:06 +01:00
|
|
|
|
2025-01-31 23:03:32 +00:00
|
|
|
<div class="tab-container drawing-pad-container" th:title="#{sign.draw}" th:data-title="#{sign.draw}">
|
2024-11-22 14:40:09 -03:00
|
|
|
<canvas id="drawing-pad-canvas"></canvas>
|
|
|
|
<br>
|
|
|
|
<button id="clear-signature" class="btn btn-outline-danger mt-2" onclick="signaturePad.clear()"
|
|
|
|
th:text="#{sign.clear}"></button>
|
|
|
|
<button id="save-signature" class="btn btn-outline-success mt-2" onclick="addDraggableFromPad()"
|
|
|
|
th:text="#{sign.add}"></button>
|
|
|
|
</div>
|
2024-10-30 12:46:44 +00:00
|
|
|
|
2025-01-31 23:03:32 +00:00
|
|
|
<div class="tab-container" th:title="#{sign.saved}" th:data-title="#{sign.saved}">
|
2024-11-22 14:40:09 -03:00
|
|
|
<div class="saved-signatures-section" th:if="${not #lists.isEmpty(signatures)}">
|
2024-10-30 12:46:44 +00:00
|
|
|
|
2024-11-22 14:40:09 -03:00
|
|
|
<!-- Preview Modal -->
|
|
|
|
<div class="modal fade" id="signaturePreview" tabindex="-1">
|
|
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h5 class="modal-title"><span id="previewFileName"></span></h5>
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body text-center">
|
|
|
|
<img id="previewImage" src="" alt="Signature Preview" style="max-width: 100%;">
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"
|
|
|
|
th:text="#{close}"></button>
|
|
|
|
<button type="button" class="btn btn-primary" onclick="addSignatureFromPreview()"
|
|
|
|
th:text="#{addToDoc}">Add to Document</button>
|
2024-11-03 08:26:45 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-10-30 12:46:44 +00:00
|
|
|
</div>
|
2024-11-22 14:40:09 -03:00
|
|
|
</div>
|
2025-01-02 15:49:29 +00:00
|
|
|
<!-- Personal Signatures -->
|
|
|
|
<div th:if="${not #lists.isEmpty(signatures.?[category == 'Personal'])}">
|
|
|
|
<h5 th:text="#{sign.personalSigs}"></h5>
|
|
|
|
<div class="selected-files flex-wrap" style="position: relative; display:flex">
|
|
|
|
<div th:each="sig : ${signatures}" th:if="${sig.category == 'Personal'}"
|
|
|
|
class="small-file-container-saved d-flex flex-column justify-content-center align-items-center">
|
|
|
|
<div class="drag-icon"><svg xmlns="http://www.w3.org/2000/svg" height="24px"
|
|
|
|
viewBox="0 -960 960 960" width="24px" fill="#e8eaed">
|
|
|
|
<path
|
|
|
|
d="M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z">
|
|
|
|
</path>
|
|
|
|
</svg></div>
|
|
|
|
<img th:src="@{'/api/v1/general/sign/' + ${sig.fileName}}" th:alt="${sig.fileName}"
|
|
|
|
th:data-filename="${sig.fileName}" style="width: 50px; height: 50px; object-fit: cover;" />
|
|
|
|
<div class="file-info d-flex flex-column align-items-center justify-content-center">
|
2024-11-22 14:40:09 -03:00
|
|
|
<div class="signature-name" th:text="${sig.fileName}"></div>
|
2024-10-30 12:46:44 +00:00
|
|
|
</div>
|
2024-11-03 08:26:45 +01:00
|
|
|
|
|
|
|
</div>
|
2024-10-30 12:46:44 +00:00
|
|
|
</div>
|
2024-11-22 14:40:09 -03:00
|
|
|
</div>
|
2024-10-30 12:46:44 +00:00
|
|
|
|
2025-01-02 15:49:29 +00:00
|
|
|
<!-- Shared Signatures -->
|
|
|
|
<div th:if="${not #lists.isEmpty(signatures.?[category == 'Shared'])}">
|
|
|
|
<h5 th:text="#{sign.sharedSigs}"></h5>
|
|
|
|
<div class="selected-files flex-wrap" style="position: relative; display: flex;">
|
|
|
|
<div th:each="sig : ${signatures}" th:if="${sig.category == 'Shared'}"
|
|
|
|
class="small-file-container-saved d-flex flex-column justify-content-center align-items-center">
|
|
|
|
<div class="drag-icon"><svg xmlns="http://www.w3.org/2000/svg" height="24px"
|
|
|
|
viewBox="0 -960 960 960" width="24px" fill="#e8eaed">
|
|
|
|
<path
|
|
|
|
d="M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z">
|
|
|
|
</path>
|
|
|
|
</svg></div>
|
|
|
|
<img th:src="@{'/api/v1/general/sign/' + ${sig.fileName}}" th:alt="${sig.fileName}"
|
|
|
|
th:data-filename="${sig.fileName}" style="width: 50px; height: 50px; object-fit: cover;" />
|
|
|
|
<div class="file-info d-flex flex-column align-items-center justify-content-center">
|
|
|
|
<div class="signature-name" th:text="${sig.fileName}"></div>
|
2024-11-03 08:26:45 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-10-30 12:46:44 +00:00
|
|
|
</div>
|
2024-11-03 08:26:45 +01:00
|
|
|
</div>
|
2025-01-02 15:49:29 +00:00
|
|
|
|
2024-10-30 12:46:44 +00:00
|
|
|
</div>
|
2024-11-22 14:40:09 -03:00
|
|
|
<div th:if="${#lists.isEmpty(signatures)}" class="text-center p-3">
|
|
|
|
<p th:text="#{sign.noSavedSigs}">No saved signatures found</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-10-30 12:46:44 +00:00
|
|
|
|
2025-01-31 23:03:32 +00:00
|
|
|
<div class="tab-container" th:title="#{sign.text}" th:data-title="#{sign.text}">
|
2024-11-22 14:40:09 -03:00
|
|
|
<label class="form-check-label" for="sigText" th:text="#{text}"></label>
|
|
|
|
<textarea class="form-control" id="sigText" name="sigText" rows="3"></textarea>
|
|
|
|
<label th:text="#{font}"></label>
|
2025-01-20 14:11:31 +02:00
|
|
|
<div id="signFontSelection" class="custom-select form-control">
|
|
|
|
<select class="form-control" name="font" id="font-select">
|
|
|
|
<option th:each="font : ${fonts}" th:value="${font.name}" th:text="${font.name}"
|
|
|
|
th:class="${font.name.toLowerCase()+'-font'}"></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2024-11-22 14:40:09 -03:00
|
|
|
<div class="margin-auto-parent">
|
|
|
|
<button id="save-text-signature" class="btn btn-outline-success mt-2 margin-center"
|
|
|
|
onclick="addDraggableFromText()" th:text="#{sign.add}"></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2025-01-02 15:49:29 +00:00
|
|
|
<script th:src="@{'/js/sign/signature-canvas.js'}"></script>
|
2024-11-22 14:40:09 -03:00
|
|
|
<!-- draggables box -->
|
2025-01-02 15:49:29 +00:00
|
|
|
<div class="draggable-buttons-box ignore-rtl">
|
2025-01-30 18:55:33 +00:00
|
|
|
<button class="btn btn-outline-secondary" th:title="#{sign.delete}"
|
2025-01-02 15:49:29 +00:00
|
|
|
onclick="DraggableUtils.deleteDraggableCanvas(DraggableUtils.getLastInteracted())"
|
|
|
|
style="border-color: #C02223; color: #C02223; background: rgba(255, 0, 0, 0.1)">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash"
|
|
|
|
viewBox="0 0 16 16">
|
|
|
|
<path
|
|
|
|
d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6Z" />
|
|
|
|
<path
|
|
|
|
d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1ZM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118ZM2.5 3h11V2h-11v1Z" />
|
|
|
|
</svg>
|
|
|
|
</button>
|
2025-01-30 18:55:33 +00:00
|
|
|
<button class="btn btn-outline-secondary" th:title="#{sign.addToAll}"
|
2025-01-02 15:49:29 +00:00
|
|
|
onclick="DraggableUtils.addAllPagesDraggableCanvas(DraggableUtils.getLastInteracted())">
|
|
|
|
<span class="material-symbols-rounded">
|
|
|
|
content_copy
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
<div id="rotation-controls" class="align-items-center" style="display: none;">
|
|
|
|
<div class="input-with-icon">
|
|
|
|
<span class="material-symbols-rounded icon" style="margin-right: 3px;">
|
|
|
|
screen_rotation
|
2024-11-22 14:40:09 -03:00
|
|
|
</span>
|
2025-01-02 15:49:29 +00:00
|
|
|
<input type="number" id="rotation-input" class="form-control form-control-sm me-2" value="0" step="10"
|
|
|
|
style="width: 6rem" />
|
|
|
|
</div>
|
2024-11-22 14:40:09 -03:00
|
|
|
</div>
|
2025-01-30 18:55:33 +00:00
|
|
|
<button id="ratioToggleBtn" th:title="#{sign.maintainRatio}" class="btn btn-outline-secondary"
|
2025-01-02 15:49:29 +00:00
|
|
|
onclick="DraggableUtils.toggleMaintainRatio()">
|
|
|
|
<span class="material-symbols-rounded">
|
|
|
|
Aspect_Ratio
|
|
|
|
</span>
|
|
|
|
</button>
|
2025-01-30 18:55:33 +00:00
|
|
|
<button class="btn btn-outline-secondary" th:title="#{sign.first}" onclick="goToFirstOrLastPage(false)"
|
|
|
|
style="margin-left:auto">
|
2025-01-02 15:49:29 +00:00
|
|
|
<span class="material-symbols-rounded">
|
|
|
|
keyboard_double_arrow_left
|
|
|
|
</span>
|
|
|
|
</button>
|
2025-01-30 18:55:33 +00:00
|
|
|
<button class="btn btn-outline-secondary" th:title="#{sign.previous}" id="incrementPage"
|
2025-01-02 15:49:29 +00:00
|
|
|
onclick="document.documentElement.getAttribute('dir')==='rtl' ? DraggableUtils.incrementPage() : DraggableUtils.decrementPage()">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
|
|
|
class="bi bi-chevron-left" viewBox="0 0 16 16">
|
|
|
|
<path fill-rule="evenodd"
|
|
|
|
d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
|
|
|
|
</svg>
|
|
|
|
</button>
|
2025-01-30 18:55:33 +00:00
|
|
|
<button class="btn btn-outline-secondary" id="decrementPage" th:title="#{sign.next}"
|
2025-01-02 15:49:29 +00:00
|
|
|
onclick="document.documentElement.getAttribute('dir')==='rtl' ? DraggableUtils.decrementPage() : DraggableUtils.incrementPage()">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
|
|
|
class="bi bi-chevron-right" viewBox="0 0 16 16">
|
|
|
|
<path fill-rule="evenodd"
|
|
|
|
d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
|
|
|
|
</svg>
|
|
|
|
</button>
|
2025-01-30 18:55:33 +00:00
|
|
|
<button class="btn btn-outline-secondary" th:title="#{sign.last}" onclick="goToFirstOrLastPage(true)">
|
2025-01-02 15:49:29 +00:00
|
|
|
<span class="material-symbols-rounded">
|
|
|
|
keyboard_double_arrow_right
|
|
|
|
</span>
|
|
|
|
</button>
|
2025-01-30 18:55:33 +00:00
|
|
|
<button id="download-pdf" th:title="#{downloadPdf}" class="btn btn-outline-secondary"
|
2025-01-03 11:23:26 +00:00
|
|
|
style="border-color: green; color:#b2e3a8; background: rgba(24, 122, 5, 1)">
|
2025-01-02 15:49:29 +00:00
|
|
|
<span class="material-symbols-rounded">
|
|
|
|
download
|
|
|
|
</span>
|
|
|
|
</button>
|
2024-11-22 14:40:09 -03:00
|
|
|
</div>
|
2025-01-02 15:49:29 +00:00
|
|
|
<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 src="https://cdn.jsdelivr.net/npm/fabric@latest/dist/index.min.js"></script>
|
|
|
|
<script th:src="@{'/js/draggable-utils.js'}"></script>
|
|
|
|
<script type="module" th:src="@{'/js/pages/sign.js'}"></script>
|
2023-05-02 22:59:16 +01:00
|
|
|
</div>
|
2025-01-02 15:49:29 +00:00
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
</div>
|
2023-05-02 22:59:16 +01:00
|
|
|
</div>
|
2024-02-16 22:49:06 +01:00
|
|
|
</div>
|
2023-05-02 22:59:16 +01:00
|
|
|
</div>
|
2024-11-22 14:40:09 -03:00
|
|
|
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
|
|
|
|
</div>
|
2025-01-02 15:49:29 +00:00
|
|
|
</script>
|
|
|
|
|
2024-11-22 14:40:09 -03:00
|
|
|
</body>
|
|
|
|
|
2023-05-04 00:07:51 +03:00
|
|
|
</html>
|