function alertaSwitch(tipoAlert, titulo, mensaje){ Swal.fire({ icon: tipoAlert, title: titulo, text: mensaje, imageUrl: '/static/imgs/Siac.png', imageWidth: 200, imageHeight: 55, imageAlt: 'Notifiaciones SIAC', showConfirmButton:true, timer:20000 }) } function alertaSwitchRedirection(tipoAlert, titulo, mensaje, url){ Swal.fire({ icon: tipoAlert, title: titulo, text: mensaje, imageUrl: '/static/imgs/Siac.png', imageWidth: 200, imageHeight: 55, imageAlt: 'Notifiaciones SIAC', timer: 5000 }).then(function(){ if(window.location.href == url){ location.reload(); } else{ window.location.href = url; } }); } function alertaSwitchRedirectionTiming(tipoAlert, titulo, mensaje, url, timer){ Swal.fire({ icon: tipoAlert, title: titulo, text: mensaje, imageUrl: '/static/imgs/Siac.png', imageWidth: 200, imageHeight: 55, imageAlt: 'Notifiaciones SIAC', showConfirmButton:true, timer: timer, }).then(function(){ if(window.location.href == url){ location.reload(); } else{ window.location.href = url; } }); } function alertaSwitchRedirectionPermanent(tipoAlert, titulo, mensaje, url){ Swal.fire({ icon: tipoAlert, title: titulo, text: mensaje, imageUrl: '/static/imgs/Siac.png', imageWidth: 200, imageHeight: 55, imageAlt: 'Notifiaciones SIAC', }).then(function(){ if(window.location.href == url){ location.reload(); } else{ window.location.href = url; } }); } function alertaSwitchUserChoiceRedirection(tipoAlert, titulo, mensaje, url, mensajeUrl) { Swal.fire({ icon: tipoAlert, title: titulo, text: mensaje, imageUrl: '/static/imgs/Siac.png', imageWidth: 200, imageHeight: 55, imageAlt: 'Notifiaciones SIAC', timer: 5000, showConfirmButton: true, confirmButtonText: mensajeUrl, showCancelButton: true, cancelButtonText: 'Hacerlo más tarde', allowOutsideClick: false }).then(function (result) { if (result.isConfirmed) { window.open(url, '_blank'); // Abre el enlace en una nueva pestaña } }); }