first comit

This commit is contained in:
2024-02-23 10:30:02 +00:00
commit ddeb07d0ba
12482 changed files with 1857507 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
(function($) {
$(document).ready(function() {
$(".jsign-container").each(function(){
var config = $(this).data('config');
var value = $(this).data('initial-value');
$(this).jSignature(config);
$(this).jSignature("setData", value, "native");
});
/* Each time user is done drawing a stroke, update value of hidden input */
$(".jsign-container").on("change", function(e) {
var jSignature_data = $(this).jSignature('getData', 'native');
var django_field_name = $(this).attr('id').split(/_(.+)/)[1];
$('#id_' + django_field_name).val(JSON.stringify(jSignature_data));
});
/* Bind clear button */
$(".jsign-wrapper input").on("click", function(e) {
$(this).siblings('.jsign-container').jSignature('reset');
});
});
})(jQuery || django.jQuery)