$(document).ready(function(){ jconfirm.defaults = { title: '', type: 'default', theme: 'supervan', lazyOpen: false, animation: 'none', onClose: function () {alertaabierta = null;}, onDestroy: function () {alertaabierta = null;}, }; }); function googleok(googleUser) { var profile = googleUser.getBasicProfile(); var id = profile.getId(); var email = profile.getEmail(); if(email == null) { email = ""; } $.post("login-google.php",{id:id,email:email},function(data) { if(data == "ok") { top.location.href="/delete"; } else if(data == "ko") { var auth2 = gapi.auth2.getAuthInstance(); auth2.signOut().then(function () { location.href="/delete"; }); auth2.disconnect(); } }); } function googleko(data) { console.log("error login google:"+JSON.stringify(data)); } function loginfacebook() { top.location.href="login-fb.php"; } function accesoconmail() { $('#botonesacceso').hide(); $('#capaloginconmail').show(); } function cancelarconmail() { $('#botonesacceso').show(); $('#capaloginconmail').hide(); } function loginconmail() { var usuario = $('#username').val(); var contrasena = $('#password').val(); if(!usuario || !contrasena) { alerta('Error!','Email and password of u4Bear is required to login. Thank you.'); } else { $('#botonloginconmail').hide(); $('#cargando').show(); var captcha = turnstile.getResponse(); $.post('login.php',{usuario:usuario,contrasena:contrasena,captcha:captcha},function(data) { console.log("D:"+data); if(data == "error") { $('#botonloginconmail').show(); $('#cargando').hide(); alerta('Error!','Email and/or password are incorrect. Please, check it and try again.'); } else if(data == "ok") { location.href="/delete"; } }); } } function alertafacebook() { alerta('Error!','There are not accounts registered in u4Bear with this Facebook access.'); } function alertagoogle() { alerta('Error!','There are not accounts registered in u4Bear with this Google access.'); } function alertaapple() { alerta('Error!','There are not accounts registered in u4Bear with this Apple access.'); } function confirmareliminar() { $.confirm({ title: 'Delete your account', content: 'Are you sure you want to completely delete your account and all associated data?', buttons: { aceptar: { text: 'No, cancel', action: function(){ $('#botonesconfirmar').hide(); $('#espere').show(); setTimeout(function(){location.href="logout.php";},500); return true; } }, cancelar: { text: 'Yes, I am sure', action: function() { $('#botonesconfirmar').hide(); $('#espere').show(); setTimeout(function(){location.href="./?vip=1&coins=1&diam=1&conf=1";},500); return true; } } } }); } function confirmarvip() { $.confirm({ title: 'Delete your account', content: 'Are you sure you want to lose unconsumed VIP time and that you have canceled your VIP subscription so that you do not continue to be charged?', buttons: { aceptar: { text: 'No, cancel', action: function(){ $('#botonesconfirmar').hide(); $('#espere').show(); setTimeout(function(){location.href="logout.php";},500); return true; } }, cancelar: { text: 'Yes, I am sure', action: function() { $('#botonesconfirmar').hide(); $('#espere').show(); setTimeout(function(){location.href="./?vip=1";},500); return true; } } } }); } function confirmarmonedas() { $.confirm({ title: 'Delete your account', content: 'Are you sure you want to lose your coins balance permanently?', buttons: { aceptar: { text: 'No, cancel', action: function(){ $('#botonesconfirmar').hide(); $('#espere').show(); setTimeout(function(){location.href="logout.php";},500); return true; } }, cancelar: { text: 'Yes, I am sure', action: function() { $('#botonesconfirmar').hide(); $('#espere').show(); setTimeout(function(){location.href="./?vip=1&coins=1";},500); return true; } } } }); } function confirmardiamantes() { $.confirm({ title: 'Delete your account', content: 'Are you sure you want to permanently lose your diamond balance?', buttons: { aceptar: { text: 'No, cancel', action: function(){ $('#botonesconfirmar').hide(); $('#espere').show(); setTimeout(function(){location.href="logout.php";},500); return true; } }, cancelar: { text: 'Yes, I am sure', action: function() { $('#botonesconfirmar').hide(); $('#espere').show(); setTimeout(function(){location.href="./?vip=1&coins=1&diam=1";},500); return true; } } } }); } function alerta(titulo,texto) { alertaabierta = $.confirm({ title: titulo, content: texto, buttons: { aceptar: { text: 'OK' } } }); } function volverdelcaptcha() { $('#botonloginconmail').show(); $('#botonloginconmailbloqueado').hide(); }