1$(document).ready(function () { 2 validatelogin(); 3}); 4$(document).on("click", "#trigger_login", function (e) { 5 if (!e.detail || e.detail == 1) { 6 redirect_to_property = ""; 7 } 8}); 9 10$(document).on('click', ".cs-loginbtn", function(e) { 11 if (!e.detail || e.detail == 1) { 12 e.preventDefault(); 13 var _this = $(this); 14 if($("#loginform").valid()){ 15 let recaptchaToken = grecaptcha.getResponse(signinRecaptchaId); 16 let $form = $("form#loginform"); 17 let formData = getFormData($form); 18 if(recaptchaToken == ""){ 19 $(".ds-signin-recaptcha-error").text("Please verify that you are a human"); 20 return; 21 } 22 formData['recaptcha_token'] = recaptchaToken; 23 $.ajax({ 24 type:'POST', 25 url:'/accounts/signin/', 26 data:formData, 27 beforeSend: function (xhr) { 28 xhr.setRequestHeader("X-CSRFToken", csrf_token); 29 toggleSpinner(_this, _this, true); 30 }, 31 success:function(data) { 32 if(data.code >= 200 && data.code <= 299) { 33 toggleSpinner(_this, _this, false); 34 window.location.href = data.url; 35 } 36 }, 37 error:function(xhr, status, exception) { 38 parseErrors(xhr.responseText); 39 grecaptcha.reset(signinRecaptchaId); 40 toggleSpinner(_this, _this, false); 41 } 42 }); 43 } 44 } 45}); 46 47function validatelogin() { 48 $("#loginform").validate({ 49 rules: { 50 username: { 51 required: true, 52 nospace: true, 53 normalizer: function (value) { 54 return $.trim(value); 55 } 56 }, 57 password: { 58 required: true, 59 normalizer: function (value) { 60 return $.trim(value); 61 } 62 } 63 }, 64 messages: { 65 username: { 66 required: "Enter your username or email address", 67 nospace: "No space allowed", 68 }, 69 password: { 70 required: "Enter your password", 71 }, 72 }, 73 submitHandler: function (form) { 74 75 } 76 }); 77 78 $.validator.setDefaults({ 79 debug: true, 80 success: 'valid' 81 }); 82}
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.