$(document).ready(function() { jconfirm.defaults = { title: '', type: 'default', theme: 'supervan', lazyOpen: false, animation: 'none' }; }); function logingoogle() { location.href="/vip/login-google.php"; } function loginfacebook() { location.href="/vip/login-facebook.php"; } function logintwitter() { location.href="/vip/login-twitter.php"; } function loginapple() { document.removeEventListener('AppleIDSignInOnFailure',null); document.addEventListener('AppleIDSignInOnFailure', (error) => { alerta('An error has occurred. Please try again. If the problem persists, contact us.'); }); document.removeEventListener('AppleIDSignInOnSuccess',null); document.addEventListener('AppleIDSignInOnSuccess', (data) => { var datos = data.detail["authorization"]; var code = datos["code"]; var idtoken = datos["id_token"]; $.post('login-apple.php',{code:code,id_token:idtoken},function(data) { if(data["resultado"] == "ok") { location.reload(); } else { alerta('An error has occurred. Please try again. If the problem persists, contact us.'); } }); }); AppleID.auth.init({ clientId : 'com.u4bear.web', scope : 'email', redirectURI : 'https://www.u4bear.com/vip/login-apple.php', usePopup : true }); setTimeout(function(){ try { AppleID.auth.signIn(); } catch(error) { alerta('An error has occurred. Please try again. If the problem persists, contact us.'); } },300); } function loginemail() { $('#botoneslogin').hide(); $('#loginemail').show(); $('#formulario1').disableAutoFill(); } function accederconemail() { var emaillogin = $('#emaillogin').val(); var passwordlogin = $('#passwordlogin').val(); if(emaillogin && passwordlogin) { $('#loginemailclaves').hide(); $('#cargandologinemail').show(); $.post('login-email.php',{email:emaillogin,password:passwordlogin},function(data) { if(data == "ok") { location.href="/vip"; } else { alerta('Email and/or password incorrect. Please, try again.'); $('#loginemailclaves').show(); $('#cargandologinemail').hide(); } }); } } /* ###################################################################################################################### # # ALERTA # ###################################################################################################################### */ function alerta(texto) { $.confirm({ content: texto, buttons: { aceptar: { text: 'Accept' } } }); }