mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
get and print nb layers
This commit is contained in:
parent
cf41808878
commit
62615bd649
@ -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 () {
|
||||
|
@ -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" />
|
||||
|
Loading…
Reference in New Issue
Block a user