PageSourceSearch

https://futurenergyweb.es/_base/JS/RegistraMicroNewsletter20180525-20220304111010.js

js futurenergyweb.es collected 2026-10-04 20:44:31 UTC 4,723 bytes, 139 lines download raw bytes

1if(!String.prototype.trim)
2{	String.prototype.trim = function () {return this.replace(/^\s+|\s+$/g,'');};
3}
4var EtiquetaEscriguiEMail = 'Escriba su e-mail' ;
5
6function ValidaFormNL(f)
7{
8	f.correu_e.value = f.correu_e.value.trim() ;
9	f.acepto_condiciones.value = f.acepto_condiciones.value.trim() ;
10
11	if (f.correu_e.value == EtiquetaEscriguiEMail)
12	{
13		f.correu_e.focus();
14		alert("Por favor, indíquenos su dirección de correo electrónico (e-mail)");
15		return (false) ;
16	}
17	if (f.correu_e.value > "")
18	{
19  	    if(!jQueryComprovaCorreuE(f.correu_e.value, false) && false)
20		{
21			f.correu_e.focus();
22			alert("La dirección de correo electrónico indicada no es válida.");
23			return (false) ;
24	    }
25    }
26	else
27	{
28		alert("Debe indicarnos un correo electrónico válido para subscribirse a la newsletter.");
29		f.correu_e.focus();
30		return (false);
31	}
32
33    // Gestió dels consentiments...
34    // Si tenim un camp d'autoritzar newsletters, ha d'estar marca (RGPD)
35    if ('undefined' !== typeof f.autoritza_newsletters)
36    {
37        if  (!f.autoritza_newsletters.checked)
38        {
39            alert("Para recibir nuestra newsletter tiene que aceptarlo explícitamente (RGPD).");
40            f.autoritza_newsletters.focus();
41            return false;
42        }
43    }
44
45	if (!f.acepto_condiciones.checked)
46	{
47		alert("Para recibir nuestra newsletter acepte el Aviso Legal y Política de Protección de Datos.");
48		f.acepto_condiciones.focus();
49		return (false);
50    }
51
52	var url = "https://www.interempresas.net/GestionUsuarios/_alta_newsletter_ajax.asp" ;
53
54	jQuery.ajax (url,
55		{
56		data: {
57			correu_e: f.correu_e.value,
58			id_sector: f.id_sector.value,
59			codi_idioma: 'es',
60			url_actual: window.location.href,
61			contrasenya: f.contrasenya.value,
62			acepto_condiciones: f.acepto_condiciones.checked,
63            // El proper atribut hauria de ser sempre true... però per si de cas hi ha alguna errada intermèdia,
64            // prefereixo reavaluar-ho
65			autoritza_newsletters: typeof f.autoritza_newsletters !== 'undefined' && f.autoritza_newsletters.checked,
66			autoritza_emailings:   typeof f.autoritza_emailings   !== 'undefined' && f.autoritza_emailings.checked,
67			origen_dades: f.origen_dades.value
68			},
69		error: function(jqXHR, textStatus, errorThrown)
70			{
71				alert("ERROR" + textStatus + errorThrown) ;
72				debugger ;
73			},
74		success: function(data, textStatus, jqXHR)
75			{
76				if (data.necessito_contrasenya)
77				{
78				    $('#label-contrasenya').fadeIn();
79				    $('#contrasenya').fadeIn();
80				    $('#correu_e').prop('readOnly', true);
81					alert("Suscripción newsletter:\n\n" + data.missatge_a_usuari) ;
82					f.contrasenya.focus();
83				}
84				else
85				{
86					alert("Suscripción newsletter:\n\n" + data.missatge_a_usuari) ;
87					if (f.origen_dades.value == "Formulari_micro_newsletter_fv")
88					{
89						$('#avisam_anuncis_nous').fadeOut();
90					}
91					else
92					{
93						if (f.origen_dades.value == "Formulari_micro_newsletter_peu")
94						{
95							//fer un login implicit i portar al que s'ha donat d'alta o s'ha identificat a la pàgina de registre de les news.
96							window.location.replace("/GestionUsuarios/EdicionesDigitales.asp?ln=es");
97						}
98						else
99						{
100							$('#SuscribirseNewsletter').fadeOut();
101						}
102					}
103				}
104			}
105		}) ;
106}
107$(document).ready(function () {
108    // Gestió de les autoritzacions al microformulari newsletters...
109    try {
110        var totsChecksMarcats = function () {
111            var politica_checked = $('#acepto_condiciones').prop('checked');
112            var autoritza_newsletters_checked = $('#autoritza_newsletters').prop('checked');
113            var autoritza_emailings_checked = $('#autoritza_emailings').prop('checked');
114
115            return politica_checked && autoritza_newsletters_checked && autoritza_emailings_checked;
116        }
117
118        var canviaEtiquetaMarcar = function () {
119            var etiqueta = totsChecksMarcats() ? 'Desmarcar todos' : '<span id="ara-dic-marcar-tots">Marcar todos</span>';
120            $('#etiqueta_marca_tot').html(etiqueta);
121        }
122
123        var marcaHoTot = function () {
124            var checked = !totsChecksMarcats();
125
126            $('#marcar_tot').prop('checked', checked);
127            $('#acepto_condiciones').prop('checked', checked);
128            $('#autoritza_newsletters').prop('checked', checked);
129            $('#autoritza_emailings').prop('checked', checked);
130            canviaEtiquetaMarcar();
131        }
132
133        $('body').on('click', '#divMarcarTot', marcaHoTot);
134        $('#microformulari_newsletter').on('change', ':checkbox', canviaEtiquetaMarcar);
135    }
136    catch (e) { };
137
138
139});

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.