1function makeTimer(validez, fechaactual, display) { 2 var endTime = new Date(validez); 3 endTime = (Date.parse(endTime) / 1000); 4 5 var now = new Date(fechaactual); 6 now = (Date.parse(now) / 1000); 7 8 var timeLeft = endTime - now; 9 10 var myTimer = setInterval(function () { 11 var days = Math.floor(timeLeft / 86400); 12 var hours = Math.floor((timeLeft - (days * 86400)) / 3600); 13 var minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600)) / 60); 14 var seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60))); 15 16 if (hours < "10") { hours = "0" + hours; } 17 if (minutes < "10") { minutes = "0" + minutes; } 18 if (seconds < "10") { seconds = "0" + seconds; } 19 display.textContent = minutes + ":" + seconds; 20 21 if (--timeLeft < 0) { 22 clearInterval(myTimer); 23 } 24 }, 1000); 25} 26 27function startOlograph() { 28 $("#firmaOlografa").signature({ 29 syncField: '#signatureField', 30 guideline: true, 31 guidelineColor: "#18abe1", 32 guidelineOffset: 10, 33 notAvailable: 'Not signature available', 34 thickness: 1, 35 change: function (event, ui) { 36 $("#signatureSizes").val($("#firmaOlografa canvas").attr("width") + '~' + $("#firmaOlografa canvas").attr("height")); 37 } 38 }); 39} 40 41function enviar() { 42 var form = validarFormularios("form1"); 43 if ($("#form1").valid()) { 44 if (!$(".passtrengthMeter").hasClass("strong") && !$(".passtrengthMeter").hasClass("very-strong")) 45 openPromtValidator(getText("texto825", "/register.aspx"), getText("texto1223", "/register.aspx") + " " + getText("RecomendacionesClaveDebil", "/register.aspx"), "txtClave", getText("texto312", "/register.aspx")); 46 else if (!$("#chkAceptaCondiciones").is(":checked") || !$("#chkAceptaPrivacidad").is(":checked") || !$("#chkAceptaCookies").is(":checked")) 47 openPromtValidator(getText("texto825", "/register.aspx"), getText("texto1025", "/register.aspx"), "chkAceptaCondiciones", getText("texto312", "/register.aspx")); 48 else if ($("#txtEmail").val() != $("#txtEmail2").val()) 49 openPromtValidator(getText("texto825", "/register.aspx"), getText("EmailNoCoincide", "/register.aspx"), "txtEmail2", getText("texto312", "/register.aspx")); 50 else { 51 var msg = "<p>" + getText("texto1228", "/register.aspx") + "</p><ul class='list-group list'>" 52 + ($("#hdeTipoRegistro").val() == "2" || $("#hdeTipoRegistro").val() == "3" ? "<li class='list-group-item p-1'>" + getText("texto38", "/register.aspx") + ": " + $("#txtNombreEmpresa").val() + "</li>" : "") 53 + ($("#hdeTipoRegistro").val() == "2" || $("#hdeTipoRegistro").val() == "3" ? "<li class='list-group-item p-1'>" + getText("texto225", "/register.aspx") + ": " + $("#txtIdFiscalEmpresa").val() + "</li>" : "") 54 + "<li class='list-group-item p-1'>" + getText("texto1221", "/register.aspx") + ": " + $("#ddlPais option:selected").html() + "</li>" 55 + "<li class='list-group-item p-1'>" + getText("PaisDeResidencia", "/register.aspx") + ": " + $("#ddlPaisResidencia option:selected").html() + "</li>" 56 + "<li class='list-group-item p-1'>" + getText("texto1017", "/register.aspx") + ": " + $("#txtIdentificacion").val() + "</li>" 57 + "<li class='list-group-item p-1'>" + getText("texto15", "/register.aspx") + ": " + $("#txtNombre").val() + "</li>" 58 + "<li class='list-group-item p-1'>" + getText("texto16", "/register.aspx") + ": " + $("#txtApellido1").val() + " " + $("#txtApellido2").val() + "</li>" 59 + "<li class='list-group-item p-1'>" + getText("FechaNacimiento", "/register.aspx") + ": " + $("#ddlDia option:selected").text() + "-" + $("#ddlMes option:selected").text() + "-" + $("#ddlAnio option:selected").text() + "</li>" 60 + "<li class='list-group-item p-1'>" + getText("texto20", "/register.aspx") + ": " + $("#ddlIdioma option:selected").html() + "</li>" 61 + "<li class='list-group-item p-1'>" + getText("Sexo", "/register.aspx") + ": " + $("#ddlSexo option:selected").html() + "</li>" 62 + "<li class='list-group-item p-1'>" + getText("texto25", "/register.aspx") + ": " + $("#txtMovil").val() + "</li>" 63 + "<li class='list-group-item p-1'>" + getText("certificado86", "/register.aspx") + ": " + $("#txtEmail").val() + "</li>" 64 + "</ul>"; 65 66 var span = document.createElement("span"); 67 span.innerHTML = msg; 68 69 Swal.fire({ 70 title: getText("texto924", "/register.aspx"), 71 html: span, // SweetAlert2 usa 'html' en lugar de 'content' 72 icon: "info", 73 showCancelButton: true, 74 reverseButtons: true, 75 customClass: { 76 cancelButton: 'btn btn-secondary me-4', 77 confirmButton: 'btn btn-success' 78 }, 79 confirmButtonText: getText("texto142", "/register.aspx"), 80 cancelButtonText: getText("texto312", "/register.aspx"), 81 }).then((result) => { 82 if (result.isConfirmed) { 83 validar(); 84 } 85 }); 86 //swal({ 87 // title: getText("texto924", "/register.aspx"), 88 // content: span, 89 // icon: "info", 90 // buttons: { 91 // cancel: getText("texto312", "/register.aspx"), 92 // confirm: getText("texto142", "/register.aspx") 93 // }, 94 //}).then((confirma) => { 95 // if (confirma) 96 // validar(); 97 //}); 98 } 99 } 100 else 101 form.focusInvalid(); 102} 103 104$(document).ready(function () { 105 $("#txtIdentificacion").attr("placeholder", getText("certificado7", "/register.aspx")); 106 107 $("#txtNombre").attr("placeholder", getText("texto42", "/register.aspx")); 108 $("#txtApellido1").attr("placeholder", getText("texto16", "/register.aspx") + " 1"); 109 $("#txtApellido2").attr("placeholder", getText("texto16", "/register.aspx") + " 2"); 110 $("#txtEmail").attr("placeholder", getText("certificado86", "/register.aspx")); 111 $("#txtClave").attr("placeholder", getText("texto1023", "/register.aspx")); 112 $("#txtCuponCode").attr("placeholder", getText("texto1024", "/register.aspx")); 113 $("#txtMovil").attr("placeholder", getText("texto197", "/register.aspx")); 114 115 $("#txtNombreEmpresa").attr("placeholder", getText("texto42", "/register.aspx")); 116 $("#txtIdFiscalEmpresa").attr("placeholder", getText("texto225", "/register.aspx")); 117 118 $("input[type='checkbox']").each(function () { 119 $(this).attr("class", "css-checkbox"); 120 });
121 122 $('#txtClave').passtrength({ 123 tooltip: true, 124 eyeImg: "/assets/img/icons/eye.svg", 125 textWeak: getText("texto1223", "/register.aspx"), 126 textMedium: getText("texto1224", "/register.aspx"), 127 textStrong: getText("texto1225", "/register.aspx"), 128 textVeryStrong: getText("texto1226", "/register.aspx"), 129 textChars: getText("texto144", "/register.aspx"), 130 textMinimo: getText("texto1227", "/register.aspx") 131 }); 132 133 $("#ddlMovilCodInt").change(function () { 134 asignarCodigoInternacional($(this)); 135 }); 136 137 asignarCodigoInternacional($("#ddlMovilCodInt")); 138 139 var current_fs, next_fs, previous_fs; //fieldsets 140 var opacity; 141 var current = 1; 142 var steps = $("fieldset").length; 143 144 $("#showCuponCode").click(function () { 145 $("#divCuponCode").toggle("slow"); 146 }); 147 148 $("#ddlMovilCodInt").change(function () { 149 changePhoneArea($("#ddlMovilCodInt"), "lblArea", "txtMovil"); 150 }); 151 152 if ($("#ddlMovilCodInt").val() != "") 153 changePhoneArea($("#ddlMovilCodInt"), "lblArea", "txtMovil"); 154 155 $(".datosEmpresa").hide(); 156 $("#btnSiguiente1").hide(); 157 setProgressBar(current); 158 159 $(".next").click(function () { 160 if ($("#form1").valid()) { 161 current_fs = $(this).parent().parent().parent(); 162 next_fs = $(this).parent().parent().parent().next(); 163 164 //Add Class Active 165 $("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active"); 166 167 //show the next fieldset 168 next_fs.show(); 169 //hide the current fieldset with style 170 current_fs.animate({ opacity: 0 }, { 171 step: function (now) { 172 // for making fielset appear animation 173 opacity = 1 - now; 174 175 current_fs.css({ 176 'display': 'none', 177 'position': 'relative' 178 }); 179 next_fs.css({ 'opacity': opacity }); 180 }, 181 duration: 500 182 }); 183 setProgressBar(++current); 184 } 185 }); 186 187 $(".previous").click(function () { 188 current_fs = $(this).parent().parent().parent(); 189 previous_fs = $(this).parent().parent().parent().prev(); 190 191 //Remove class active 192 $("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active"); 193 194 //show the previous fieldset 195 previous_fs.show(); 196 197 //hide the current fieldset with style 198 current_fs.animate({ opacity: 0 }, { 199 step: function (now) { 200 // for making fielset appear animation 201 opacity = 1 - now; 202 203 current_fs.css({ 204 'display': 'none', 205 'position': 'relative' 206 }); 207 previous_fs.css({ 'opacity': opacity }); 208 }, 209 duration: 500 210 }); 211 setProgressBar(--current); 212 }); 213 214 function setProgressBar(curStep) { 215 var percent = parseFloat(100 / steps) * curStep; 216 percent = percent.toFixed(); 217 $(".progress-bar") 218 .css("width", percent + "%") 219 } 220 221 $("#rdoRepresentaSi").click(function () { 222 activarRegistroEmpresa(true); 223 $(".btnSiguiente2").prop("disabled", false); 224 }); 225 226 $("#rdoRepresentaNo").click(function () { 227 activarRegistroEmpresa(false); 228 $(".btnSiguiente2").prop("disabled", false); 229 }); 230 231 $("#ddlTipoRepresentante").change(function () { 232 if ($("#ddlTipoRepresentante").val() == "3") 233 $("#txtCargo").show(); 234 else 235 $("#txtCargo").hide(); 236 }); 237 238 $('#btnRegisterButtonFake').on('click', function (event) { 239 if (!enviar()) { 240 event.preventDefault(); // Evita el envÃo del formulario si la validación falla 241 } 242 }); 243}); 244 245function activarRegistroEmpresa(obj) { 246 $("#ddlTipoRepresentante").prop("disabled", !obj); 247 if (obj == false) { 248 $("#txtCargo").show(); 249 $("#ddlTipoRepresentante").val('3'); 250 } 251 else { 252 $("#txtCargo").hide(); 253 $("#ddlTipoRepresentante").val(''); 254 } 255} 256 257function asignarCodigoInternacional(obj) { 258 var valores = $(obj).val().split('~'); 259 if (valores.length == 2) { 260 var maxlength = 0; 261 if (valores[1].split(',').length > 1) 262 maxlength = valores[1].split(',')[1]; 263 else 264 maxlength = valores[1]; 265 266 $("#lblArea").html("+" + valores[0]); 267 $("input[id$='txtMovil']").val(''); 268 $("input[id$='txtMovil']").attr("maxlength", maxlength); 269 } 270} 271 272function limpiarOlografa() { 273 $("#firmaOlografa").signature('clear'); 274} 275 276function validarConfirm() { 277 if ($("#firmaOlografa").length && $('#firmaOlografa').signature('isEmpty')) { 278 $("#firmaOlografa").focus(); 279 openPromtValidator(getText("texto825", "/register.aspx"), getText("texto1136", "/register.aspx"), "chkAceptaCondiciones", getText("texto312", "/register.aspx")); 280 return false; 281 } 282 else if (!$("#form2").valid()) { 283 openPromtValidator(getText("texto825", "/register.aspx"), $(".divTextoOtp").Text(), "chkAceptaCondiciones", getText("texto312", "/register.aspx")); 284 return false; 285 } 286 else if (!$("#chkAceptaTerminos").is(":checked")) { 287 openPromtValidator(getText("texto825", "/register.aspx"), getText("texto1034", "/register.aspx"), "chkAceptaCondiciones", getText("texto312", "/register.aspx")); 288 return false; 289 } 290 else { 291 $(".imgLoadingFinal").show("slow"); 292 $("#btnValidar").hide("slow"); 293 gtag_report_conversion(); 294 return true; 295 } 296} 297 298function showModals(tipo) { 299 if (tipo == "terms") { 300 $("#messageModalContent").html(getText('texto1034', 'register.aspx')); 301 $('#messageModal').modal("show"); 302 } 303} 304 305function enviarForm(token) { 306 $("#grecaptcharesponse").val(token); 307 $("#btnContinuar").click(); 308} 309 310function validar() { 311 var form = validarFormularios("form1"); 312 if ($("#form1").valid() && $("#btnContinuar").length) { 313 $(".fakeLoginButton").hide(); 314 $(".fakeLoginButtonProcessing").show(); 315 grecaptcha.execute(); 316 } 317 else 318 form.focusInvalid(); 319 return false; 320} 321 322function setType(obj, val) { 323 if ($(".tipoLoading").length) { 324 getLocation(); 325 } 326 327 $(".tipoLoading").show(); 328 $("#hdeTipoRegistro").val(val); 329 330 if (val == 0) 331 $(".datosEmpresa").hide(); 332 else if (val == 1) { 333 $(".datosEmpresa").hide(); 334 $(".profesionalAutonomo").show(); 335 } 336 else if (val == 2) { 337 $(".datosEmpresa").show(); 338 $(".btnSiguiente2").prop("disabled", true); 339 } 340 else { 341 $(".datosEmpresa").show(); 342 activarRegistroEmpresa(false); 343 $(".btnSiguiente2").prop("disabled", true); 344 } 345 346 $(".btnTipoCuenta").removeClass("btn-success"); 347 $(".btnTipoCuenta").addClass("btn-primary"); 348 349 $(obj).removeClass("btn-primary"); 350 $(obj).addClass("btn-success"); 351} 352 353function getLocation() { 354 $(".tipoLoading").html("<img src='/assets/img/media/loading.gif' style='max-height: 20px;' /> Trying to geolocate your device.."); 355 if (navigator.geolocation) { 356 $(".tipoLoading").html("<img src='/assets/img/media/loading.gif' style='max-height: 20px;' /> " + getText("Geolocalizando", "/register.aspx") + "..."); 357 navigator.geolocation.getCurrentPosition(activatePositionMachine, errorCallback, { timeout: 30000 }); 358 } 359 else { 360 setTimeout(function () { $("#btnSiguiente1").click(); $(".tipoLoading").hide(); }, 500); 361 } 362} 363 364function activatePositionMachine(position) { 365 var j = { 366 'lat': position.coords.latitude, 'lon': position.coords.longitude 367 }; 368 $("#hdePosition").val(JSON.stringify(j)); 369 setTimeout(function () { $("#btnSiguiente1").click(); $(".tipoLoading").hide(); }, 500); 370} 371 372function errorCallback() { 373 setTimeout(function () { $("#btnSiguiente1").click(); $(".tipoLoading").hide(); }, 500); 374} 375 376function changePhoneArea(obj, span, text) { 377 var valores = $(obj).val().split('~'); 378 if (valores.length == 2) { 379 var maxlength = 0; 380 var minlength = 0; 381 if (valores[1].split(',').length > 1) { 382 maxlength = valores[1].split(',')[1]; 383 minlength = valores[1].split(',')[0]; 384 } 385 else { 386 maxlength = valores[1]; 387 minlength = maxlength; 388 } 389 390 $("#" + span).html("+" + valores[0]); 391 $("#" + text).attr("maxlength", maxlength); 392 } 393}
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.