1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +02:00

Merge branch 'sharing' of github.com:24eme/signaturepdf into sharing

This commit is contained in:
Jb Lm 2022-04-01 15:45:24 +02:00
commit 487434e8b9
2 changed files with 16 additions and 4 deletions

View File

@ -488,7 +488,12 @@ var createAndAddSvgInCanvas = function(canvas, item, x, y, height = null) {
document.getElementById('save_mobile').removeAttribute('disabled');
}
if(document.getElementById('btn_download')) {
document.getElementById('btn_download').classList.add('disabled');
document.getElementById('btn_download').classList.remove('btn-outline-dark');
document.getElementById('btn_download').classList.add('btn-outline-secondary');
}
if(document.getElementById('btn_share')) {
document.getElementById('btn_share').classList.remove('btn-outline-dark');
document.getElementById('btn_share').classList.add('btn-outline-secondary');
}
@ -940,7 +945,9 @@ var modalSharing = function() {
let modalInformations = bootstrap.Modal.getOrCreateInstance(modalInformationsEl);
modalInformations.show();
modalInformationsEl.addEventListener('hidden.bs.modal', function (event) {
if(window.location.hash) {
history.pushState({}, '', window.location.href.replace(/#.*$/, ''));
}
})
}
@ -949,7 +956,9 @@ var modalSharing = function() {
let modalSigned = bootstrap.Modal.getOrCreateInstance(modalSignedEl);
modalSigned.show();
modalSignedEl.addEventListener('hidden.bs.modal', function (event) {
if(window.location.hash) {
history.pushState({}, '', window.location.href.replace(/#.*$/, ''));
}
})
}
}

View File

@ -92,7 +92,10 @@
</form>
<?php else: ?>
<p>Nombre de signataire : <span id="nblayers" data-ajax="/signature/<?php echo $hash ?>/nblayers">0</span></p>
<div class="btn-group w-100">
<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>
<button class="btn btn-outline-dark" type="button" id="btn_share" data-bs-toggle="modal" data-bs-target="#modal-share-informations"><i class="bi bi-share"></i></button>
</div>
<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" />
<button class="btn btn-primary w-100 mt-2" disabled="disabled" type="submit" id="save"><i class="bi bi-cloud-upload"></i> Transmettre ma signature</button>