1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-06-01 13:32:24 +02:00

get and print nb layers

This commit is contained in:
Jb Lm 2022-04-01 15:43:47 +02:00
parent cf41808878
commit 62615bd649
2 changed files with 20 additions and 0 deletions

View file

@ -976,6 +976,17 @@ var pageUpload = async function() {
});
}
var printNbLayers = function(element) {
const xhr = new XMLHttpRequest();
xhr.open('GET', element.getAttribute('data-ajax'), true);
xhr.onload = function() {
if (xhr.status == 200) {
element.innerHTML = xhr.response;
}
};
xhr.send();
};
var pageSignature = async function(url) {
modalSharing();
document.getElementById('page-upload').classList.add('d-none');
@ -1023,6 +1034,14 @@ var pageSignature = async function(url) {
stateAddLock();
createEventsListener();
loadPDF(pdfBlob, filename);
let element = document.getElementById('nblayers');
if(element) {
printNbLayers(element);
setInterval(function() {
printNbLayers(element);
}, 10000);
}
};
(function () {

View file

@ -91,6 +91,7 @@
<button class="btn btn-primary w-100 mt-2" disabled="disabled" type="submit" id="save"><i class="bi bi-download"></i> Télécharger le PDF signé</button>
</form>
<?php else: ?>
<p>Nombre de signataire : <span id="nblayers" data-ajax="/signature/<?php echo $hash ?>/nblayers">0</span></p>
<a id="btn_download" class="btn btn-outline-dark w-100" href="/signature/<?php echo $hash ?>/pdf"><i class="bi bi-download"></i> Télécharger le PDF</a>
<form id="form_pdf" action="/signature/<?php echo $hash ?>/save" method="post" enctype="multipart/form-data">
<input id="input_svg" name="svg[]" type="file" class="d-none" />