Skip to content

Commit

Permalink
Help message for signing a pdf with several people for the first time…
Browse files Browse the repository at this point in the history
…, because the interface could suggest that creating the signature is enough.
  • Loading branch information
wincelau committed Jul 17, 2023
1 parent 26aac0a commit f4bab4a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions public/js/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@ var addObjectInCanvas = function(canvas, item) {
};

var createAndAddSvgInCanvas = function(canvas, item, x, y, height = null) {
if(document.querySelector('#alert-signature-help')) {
document.querySelector('#alert-signature-help').classList.add('d-none');
}
if(document.getElementById('save')) {
document.getElementById('save').removeAttribute('disabled');
}
Expand Down Expand Up @@ -709,6 +712,10 @@ var createEventsListener = function() {
}

document.querySelector('#'+svg_list_id+' label:last-child').click();

if(document.querySelector('#save').disabled && document.querySelector('#alert-signature-help') && !is_mobile()) {
document.querySelector('#alert-signature-help').classList.remove('d-none');
}
});


Expand Down Expand Up @@ -1057,6 +1064,10 @@ var pageSignature = async function(url) {
svgCollections = JSON.parse(localStorage.getItem('svgCollections'));
}

if(svgCollections.length > 0 && document.querySelector('#alert-signature-help')) {
document.querySelector('#alert-signature-help').remove();
}

opentype.load('/vendor/fonts/Caveat-Regular.ttf', function(err, font) {
fontCaveat = font;
});
Expand Down
10 changes: 10 additions & 0 deletions templates/signature.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
</footer>
</div>
<div id="page-signature" style="padding-right: 350px;" class="d-none">
<?php if(isset($hash)): ?>
<div id="alert-signature-help" class="position-relative d-none">
<div class="alert alert-primary alert-dismissible position-absolute top-0 start-50 translate-middle-x text-center mt-4 pb-2 w-50 opacity-100" style="z-index: 100;" role="alert">
<h4 class="alert-heading">Comment signer ?</h4>
<strong>En cliquant directement sur la page du document</strong> pour insérer l'élément séléctionné dans la colonne de droite <small>(signature, paraphe, texte, tampon, etc ...)</small>
<div class="mt-1 fs-3"><i class="bi bi-box-arrow-down"></i></div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</div>
<?php endif; ?>
<div style="height: 65px;" class="d-md-none"></div>
<div id="container-pages" class="col-12 pt-1 pb-1 text-center vh-100">
</div>
Expand Down

0 comments on commit f4bab4a

Please sign in to comment.