1jQuery(document).ready(function ($) { 2 // Perform AJAX login/register on form submit 3 // $('form#login').on('submit', function (e) { 4 // if (!$(this).valid()) return false; 5 // $('p.status', this).show().text(ajax_auth_object.loadingmessage); 6 // action = 'ajaxlogin'; 7 // username = $('form#login #username').val(); 8 // password = $('form#login #password').val(); 9 // email = ''; 10 // security = $('form#login #security').val(); 11 // ctrl = $(this); 12 // $.ajax({ 13 // type: 'POST', 14 // dataType: 'json', 15 // url: ajax_auth_object.ajaxurl, 16 // data: { 17 // 'action': action, 18 // 'username': username, 19 // 'password': password, 20 // 'email': email, 21 // 'security': security 22 // }, 23 // success: function (data) { 24 // $('p.status', ctrl).text(data.message); 25 // if (data.loggedin == true) { 26 // document.location.href = ajax_auth_object.redirecturl; 27 // } 28 // } 29 // }); 30 // e.preventDefault(); 31 // }); 32 33 // Perform AJAX login/register on form submit 34 $('form#login, form#register').on('submit', function (e) { 35 if (!$(this).valid()) return false; 36 $('p.status', this).show().text(ajax_auth_object.loadingmessage); 37 action = 'ajaxlogin'; 38 username = $('form#login #username').val(); 39 password = $('form#login #password').val(); 40 email = ''; 41 security = $('form#login #security').val(); 42 ctrl = $(this); 43 if ($(this).attr('id') == 'register') { 44 action = 'ajaxregister'; 45 username = $('#signonname').val(); 46 password = $('#signonpassword').val(); 47 email = $('#email').val(); 48 security = $('#signonsecurity').val(); 49 } 50 51 function submitAuthRequest(token) { 52 var payload = { 53 'action': action, 54 'username': username, 55 'password': password, 56 'email': email, 57 'security': security 58 } 59 60 if (token) { 61 payload['g-recaptcha-response'] = token; 62 } 63 64 $.ajax({ 65 type: 'POST', 66 dataType: 'json', 67 url: ajax_auth_object.ajaxurl, 68 data: payload, 69 success: function (data) { 70 $('p.status', ctrl).text(data.message); 71 if (data.loggedin == true) { 72 document.location.href = ajax_auth_object.redirecturl; 73 } 74 } 75 }); 76 } 77 78 if (typeof window.myXooGetToken === 'function') { 79 window.myXooGetToken(ctrl, 12000).then(function (ok) { 80 if (!ok) { 81 $('p.status', ctrl).text('The reCAPTCHA verification failed. Please try again.'); 82 return; 83 } 84 85 submitAuthRequest((ctrl.find('input[name="g-recaptcha-response"]').first().val() || '').trim()); 86 }); 87 } else { 88 submitAuthRequest(''); 89 } 90 91 e.preventDefault(); 92 }); 93 94 // Client side form validation 95 if ($("#register").length) 96 $("#register").validate(); 97 else if ($("#login").length) 98 $("#login").validate(); 99 if ($('#forgot_password').length) { 100 $('#forgot_password').validate(); 101 $('#reset-password').hide(); 102 $('#reset-password-success').hide(); 103 } 104});
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.