$(document).ready(function( $ ) { $("input",$(".LoginFrame")).on("keydown", function(event){ if (event.keyCode == 13) login(); }); //$(".LoginFrame").fadeIn("fast"); $(".LoginFrame").css("display","inline-block"); if ($("#login").val()!="") $("#password").focus(); else $("#login").focus(); $('#viewport').attr("content","width=device-width,height=device-height,initial-scale=1, user-scalable=1"); }); $( window ).resize(function() { $('#viewport').attr("content","width=device-width,height=device-height,initial-scale=1, user-scalable=1"); }); var callback = function(data){ if (data.status==="err"){ if (data.error[0].field == "blocked") dialogopen("dialog-login-blocked"); else error_data_highlighter("loginForm",data.error); } else { clearErrors("loginForm"); $(".LoginFrame, table").fadeOut("fast", function(){ document.location = 'https://app.sendberry.com/'+data.language+'/cabinet'; }); } } function login(){ grecaptcha.ready(function() { grecaptcha.execute('6Ld__4waAAAAAPxh96TRI65g2xu-InGzbIT4nRt9', {action:'submit'}) .then(function(token) { document.getElementById('g-recaptcha-response').value = token; form_submit("loginForm",callback); }); }); } function change_language(obj){ document.location = 'https://app.sendberry.com/'+$(obj).val()+'/login'; }