PageSourceSearch

https://app.tinsa.es/js/validacion_firma.js?20240925-1643

js tinsa.es collected 2026-10-02 10:08:30 UTC 2,636 bytes, 108 lines download raw bytes

1/**
2 * @file
3 * Programación JavaScript para la validación de la firma de un documento PDF.
4 *
5 * @author	Iván Argulo <[email protected]>
6 * @since 	08/10/2015
7 * @version	1.0
8 *
9 * Copyright 2015, Tinsa S.A.
10 * http://www.tinsa.es
11 */
12
13var _enviado = false;
14var _files = 0;
15
16
17//--------------------------------------------------------------------------------------------------
18
19
20Dropzone.options.demoDropzone = {
21	maxFiles: 5,
22	init: function() {
23		this.on('maxfilesexceeded', function(file){
24	        alert(l10n_firma_limite);
25	    }),
26	    this.on('addedfile', function(file) {
27	    	jQuery('.subiendo').fadeIn();
28			_files++;
29	    }),
30	    this.on('error', function(file) {
31	    	_files--;
32	    }),
33		this.on('queuecomplete', function(file) {
34			showResults();
35		});
36	},
37    withCredentials: true
38};
39
40jQuery('document').ready(function(){
41//	showResults();
42});
43
44/**
45 * Muestra en pantalla los resultados de la validación.
46 *
47 * @author	Iván Argulo <[email protected]>
48 * @since 	23/10/2015
49 */
50function showResults()
51{
52	jQuery('.subiendo').hide();
53
54	jQuery('#demo-dropzone').hide();
55	jQuery('#resultados').show();
56
57	// Datos para enviar a la petición
58	var _datos = {
59		'plantilla': jQuery('#resultados-plantilla').html(),
60		'mensaje-ok': jQuery('#resultados-plantilla-ok').html(),
61		'mensaje-ok-modificado': jQuery('#resultados-plantilla-ok-modificado').html(),
62		'mensaje-ko': jQuery('#resultados-plantilla-ko').html(),
63		'mensaje-invalido': jQuery('#resultados-plantilla-invalido').html(),
64		'mensaje-ok-notinsa': jQuery('#resultados-plantilla-ok-notinsa').html(),
65		'mensaje-ok-notinsa-modificado': jQuery('#resultados-plantilla-ok-notinsa-modificado').html(),
66	};
67
68	// Ejecuta la petición AJAX
69	jQuery.ajax({
70		url: url_app + 'firma/resultado',
71		type: 'post',
72		cache: false,
73		dataType: 'json',
74		data: _datos,
75		success: function(res) {
76			// Añade el resultado al visor
77			jQuery('#archivos').html(res);
78		}
79	});
80}
81
82
83//--------------------------------------------------------------------------------------------------
84
85
86/**
87* Imprime el contenido de un DIV.
88*
89* @author	Iván Argulo <[email protected]>
90* @since 	12/10/2015
91* @param	string	Selector jQuery del div a imprimir
92*/
93function printdiv(printpage)
94{
95	jQuery('.btn-imprimir-individual').hide();
96
97	var headstr = "<html><head><title></title></head><body>";
98	var footstr = "</body>";
99	var newstr = jQuery(printpage).html();
100	var oldstr = document.body.innerHTML;
101	document.body.innerHTML = headstr+newstr+footstr;
102	window.print();
103	document.body.innerHTML = oldstr;
104
105	jQuery('.btn-imprimir-individual').show();
106
107	return;
108}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.