2023-12-12 00:20:31 +01:00
|
|
|
<!DOCTYPE html>
|
2024-03-21 21:58:01 +01:00
|
|
|
<html th:lang="${#locale.language}" th:dir="#{language.direction}" th:data-language="${#locale.toString()}" xmlns:th="http://www.thymeleaf.org">
|
2024-02-16 22:49:06 +01:00
|
|
|
<head>
|
|
|
|
<th:block th:insert="~{fragments/common :: head(title=#{split-by-size-or-count.title}, header=#{split-by-size-or-count.header})}"></th:block>
|
|
|
|
</head>
|
2023-12-12 00:20:31 +01:00
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
<body>
|
2023-12-12 00:20:31 +01:00
|
|
|
<th:block th:insert="~{fragments/common :: game}"></th:block>
|
|
|
|
<div id="page-container">
|
2024-02-16 22:49:06 +01:00
|
|
|
<div id="content-wrap">
|
|
|
|
<th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
|
2024-03-21 21:58:01 +01:00
|
|
|
<br><br>
|
2024-02-16 22:49:06 +01:00
|
|
|
<div class="container">
|
|
|
|
<div class="row justify-content-center">
|
2024-05-05 13:19:53 +02:00
|
|
|
<div class="col-md-6" id="bg-card">
|
|
|
|
<div class="tool-header">
|
|
|
|
<span class="material-symbols-rounded tool-header-icon advance">layers</span>
|
|
|
|
<span class="tool-header-text" th:text="#{overlay-pdfs.header}"></span>
|
|
|
|
</div>
|
2024-02-16 22:49:06 +01:00
|
|
|
<form id="overlayForm" method="post" enctype="multipart/form-data" th:action="@{/api/v1/general/overlay-pdfs}">
|
|
|
|
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='application/pdf')}"></div>
|
|
|
|
<div th:replace="~{fragments/common :: fileSelector(name='overlayFiles', multiple=true, accept='application/pdf')}"></div>
|
2024-02-11 17:47:00 +01:00
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
<label for="overlayMode" th:text="#{overlay-pdfs.mode.label}">Overlay Mode</label>
|
|
|
|
<select id="overlayMode" name="overlayMode" class="form-control">
|
2024-03-21 21:58:01 +01:00
|
|
|
<option value="SequentialOverlay" th:text="#{overlay-pdfs.mode.sequential}">Sequential Overlay</option>
|
|
|
|
<option value="InterleavedOverlay" th:text="#{overlay-pdfs.mode.interleaved}">Interleaved Overlay</option>
|
|
|
|
<option value="FixedRepeatOverlay" th:text="#{overlay-pdfs.mode.fixedRepeat}">Fixed Repeat Overlay</option>
|
2024-02-16 22:49:06 +01:00
|
|
|
</select>
|
|
|
|
<br>
|
|
|
|
<label for="overlayPosition" th:text="#{overlay-pdfs.position.label}">Overlay Position</label>
|
|
|
|
<select id="overlayPosition" name="overlayPosition" class="form-control">
|
|
|
|
<option value="0" th:text="#{overlay-pdfs.position.foreground}">Foreground</option>
|
|
|
|
<option value="1" th:text="#{overlay-pdfs.position.background}">Background</option>
|
|
|
|
</select>
|
|
|
|
<br>
|
|
|
|
<div id="countsContainer" style="display: none;">
|
|
|
|
<label th:text="#{overlay-pdfs.counts.label}">Overlay Counts</label>
|
|
|
|
<!-- Inputs for counts will be dynamically added here -->
|
|
|
|
</div>
|
2024-02-11 17:47:00 +01:00
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{overlay-pdfs.submit}">Submit</button>
|
|
|
|
</form>
|
|
|
|
<script>
|
|
|
|
function updateCountsInputs() {
|
|
|
|
const mode = document.getElementById('overlayMode').value;
|
|
|
|
console.log("mode",mode);
|
|
|
|
const countsContainer = document.getElementById('countsContainer');
|
|
|
|
console.log("countsContainer",countsContainer);
|
|
|
|
countsContainer.innerHTML = ''; // Clear previous inputs
|
2024-02-11 17:47:00 +01:00
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
if (mode === 'FixedRepeatOverlay') {
|
|
|
|
const fileInput = document.getElementById('overlayFiles-input');
|
|
|
|
console.log("fileInput",fileInput);
|
|
|
|
if(fileInput){
|
|
|
|
const files = fileInput.files
|
|
|
|
console.log("files",files);
|
|
|
|
if(files) {
|
|
|
|
const fileCount = files.length;
|
2023-12-12 00:20:31 +01:00
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
for (let i = 0; i < fileCount; i++) {
|
|
|
|
const input = document.createElement('input');
|
|
|
|
input.type = 'text';
|
|
|
|
input.name = 'counts';
|
|
|
|
input.classList.add('form-control');
|
|
|
|
input.placeholder = 'Count for file ' + (i + 1);
|
|
|
|
countsContainer.appendChild(input);
|
|
|
|
}
|
|
|
|
countsContainer.style.display = 'block';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
countsContainer.style.display = 'none';
|
|
|
|
}
|
|
|
|
}
|
2023-12-12 00:20:31 +01:00
|
|
|
|
2024-02-16 22:49:06 +01:00
|
|
|
document.addEventListener('DOMContentLoaded', (event) => {
|
|
|
|
var fileInput = document.getElementById('overlayFiles-input');
|
|
|
|
console.log("fileInput2",fileInput);
|
|
|
|
if (fileInput) {
|
2024-03-21 21:58:01 +01:00
|
|
|
fileInput.addEventListener('change', updateCountsInputs);
|
2024-02-16 22:49:06 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
document.addEventListener('DOMContentLoaded', (event) => {
|
|
|
|
var overlay = document.getElementById('overlayMode');
|
|
|
|
console.log("overlay2",overlay);
|
|
|
|
if (overlay) {
|
|
|
|
overlay.addEventListener('change', updateCountsInputs);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2023-12-12 00:20:31 +01:00
|
|
|
</div>
|
2024-02-16 22:49:06 +01:00
|
|
|
</div>
|
2023-12-12 00:20:31 +01:00
|
|
|
</div>
|
2024-02-16 22:49:06 +01:00
|
|
|
</div>
|
|
|
|
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
|
2023-12-12 00:20:31 +01:00
|
|
|
</div>
|
2024-02-16 22:49:06 +01:00
|
|
|
</body>
|
2024-03-21 21:58:01 +01:00
|
|
|
</html>
|