mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
Manipulation buttons of the selected pages above and like the add button of pdf
This commit is contained in:
parent
492e20dda0
commit
8fa6b5e459
@ -139,9 +139,21 @@ var loadPDF = async function(pdfBlob, filename, pdfIndex) {
|
||||
container.classList.add('border-transparent', 'bg-transparent');
|
||||
}
|
||||
if(document.querySelectorAll('.canvas-container .input-select:checked').length > 0) {
|
||||
document.querySelector('#container_btn_select').classList.remove('opacity-50');
|
||||
document.querySelectorAll('#container_btn_select button').forEach(function(button) {
|
||||
button.classList.add('btn-outline-primary');
|
||||
button.classList.remove('btn-outline-dark');
|
||||
button.removeAttribute('disabled');
|
||||
});
|
||||
document.querySelector('#container-btn-save-select').classList.remove('d-none');
|
||||
document.querySelector('#container-btn-save').classList.add('d-none');
|
||||
} else {
|
||||
document.querySelector('#container_btn_select').classList.add('opacity-50');
|
||||
document.querySelectorAll('#container_btn_select button').forEach(function(button) {
|
||||
button.classList.add('btn-outline-dark');
|
||||
button.classList.remove('btn-outline-primary');
|
||||
button.setAttribute('disabled', 'disabled');
|
||||
});
|
||||
document.querySelector('#container-btn-save-select').classList.add('d-none');
|
||||
document.querySelector('#container-btn-save').classList.remove('d-none');
|
||||
}
|
||||
@ -224,7 +236,7 @@ var updateListePDF = function() {
|
||||
document.querySelector('#list_pdf').innerHTML = "";
|
||||
for (var i = 0; i < document.querySelector('#input_pdf').files.length; i++) {
|
||||
const pdfFile = document.querySelector('#input_pdf').files.item(i);
|
||||
document.querySelector('#list_pdf').insertAdjacentHTML('beforeend', '<li class="list-group-item small" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;"><i class="bi bi-files"></i> '+decodeURI(pdfFile.name)+'</li>');
|
||||
document.querySelector('#list_pdf').insertAdjacentHTML('beforeend', '<li class="list-group-item small" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;"><i class="bi bi-files"></i> <input class="form-check-input me-1 ms-1" type="checkbox" /> '+decodeURI(pdfFile.name)+'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,16 +64,18 @@
|
||||
<button type="button" class="btn btn-sm btn-outline-dark" onclick="document.getElementById('input_pdf_upload_2').click();"><i class="bi bi-plus-circle"></i> Ajouter un PDF</button>
|
||||
<input id="input_pdf_upload_2" class="form-control d-none" type="file" accept=".pdf,application/pdf">
|
||||
</div>
|
||||
<hr />
|
||||
<div id="container_btn_select" class="d-grid gap-2 mt-2 opacity-50">
|
||||
<button id="btn_rotate_select" disabled="disabled" type="button" class="btn btn-sm btn-outline-dark"><i class="bi bi-arrow-clockwise"></i> Tourner les pages sélectionnées de 90°</button>
|
||||
<button id="btn_delete_select" disabled="disabled" type="button" class="btn btn-sm btn-outline-dark"><i class="bi bi-trash"></i> Supprimer les pages sélectionnées</button>
|
||||
<button id="btn_cancel_select" disabled="disabled" type="button" class="btn btn-sm btn-outline-dark"><i class="bi bi-check-square"></i> Annuler la sélection de pages</button>
|
||||
</div>
|
||||
|
||||
<div class="position-absolute bottom-0 pb-2 ps-0 pe-4 w-100">
|
||||
<form id="form_pdf" action="/organize" method="post" enctype="multipart/form-data">
|
||||
<input id="input_pdf" name="pdf[]" type="file" class="d-none" />
|
||||
<input id="input_pages" type="hidden" value="" name="pages" />
|
||||
<div id="container-btn-save-select" class="d-none">
|
||||
<button id="btn_cancel_select" type="button" class="btn btn-link w-100">Annuler la sélection</button>
|
||||
<div class="btn-group mb-2 mt-2" role="group">
|
||||
<button id="btn_delete_select" type="button" class="btn btn-outline-primary"><i class="bi bi-trash"></i> Supprimer</button>
|
||||
<button id="btn_rotate_select" type="button" class="btn btn-outline-primary"><i class="bi bi-arrow-clockwise"></i> Tourner</button>
|
||||
</div>
|
||||
<button class="btn w-100 btn-outline-primary" type="submit" id="save-select"><i class="bi bi-download"></i> Télécharger les pages séléctionnées</button>
|
||||
</div>
|
||||
<div id="container-btn-save" class="d-grid gap-2 mt-2">
|
||||
|
Loading…
Reference in New Issue
Block a user