1function reloadCaptcha($form) { 2 $('.captcha', $form).attr('src', 'let-securimage-show.php?' + Math.random() ); 3} 4 5function disableSubmit(arr, $form, options) { 6 $('.submit', $form).attr('disabled', 'disabled').css({'opacity': '0.5', 'cursor' : 'default'}); 7 $('.throbber', $form).fadeIn(100); 8} 9 10function enableSubmit($form) { 11 $('.submit', $form).removeAttr('disabled').css({'opacity': '1', 'cursor' : 'pointer'}); 12 $('.throbber', $form).fadeOut(100); 13} 14 15 16 17function showEmailResponse(response, statusText, xhr, $form) { 18 19 if (response.error == 'true') { 20 if (response.message == "Your Captcha Was Incorrect. Please Try Again."){ 21 $(".captcha_code", $form).addClass('error'); 22 $(".captcha_error", $form).html(response.message).show(); 23 24 } else { 25 alert(response.message); 26 reloadCaptcha($form); 27 } 28 } else { 29 reloadCaptcha($form); 30 $($form).slideUp(400); 31 $(".form_success").delay(400).fadeIn(200); 32 } 33 enableSubmit($form); 34} 35 36//CC response 37function showCCResponse(response, statusText, xhr, $form) { 38 if (response.error) { 39 alert(response.error); 40 } else { 41 $($form).slideUp(400); 42 $(".form_success").html(response.success); 43 $(".form_success").delay(400).fadeIn(200); 44 } 45 enableSubmit($form); 46} 47 48jQuery(document).ready(function($) { 49 $('.form .reload').on('click', function() { 50 reloadCaptcha( $('#contact') ); 51 return false; 52 }); 53 //No Required Messages 54 jQuery.validator.messages.required = ""; 55 jQuery.validator.messages.required = ""; 56 57 //Validate Form 58 $('.form, #email').validate({ 59 invalidHandler: function(e, validator) { 60 var errors = $('input.error, textarea.error').length; 61 if (errors) { 62 var message = errors == 1 63 ? 'You missed 1 field. It has been highlighted below' 64 : 'You missed ' + errors + ' fields. They have been highlighted below'; 65 $("div.error span").html(message); 66 $("div.error").show(); 67 } else { 68 $("div.error").hide(); 69 } 70 }, 71 errorElement : "p", 72 focusInvalid: false, 73 onKeyUp: false 74 }); 75 76 77 //Submit Form 78 $('#contact').submit(function() { 79 if ($("#contact").valid()) { 80 $(this).ajaxSubmit({ 81 success: showEmailResponse, 82 beforeSubmit: disableSubmit, 83 dataType: 'json', 84 data: {validatorfield: "true"} 85 }); 86 } 87 return false; 88 }); 89 90 $('#email').submit(function() { 91 if ($("#email").valid()) { 92 $(this).ajaxSubmit({ 93 success: showCCResponse, 94 beforeSubmit: disableSubmit, 95 dataType: 'json', 96 data: {validatorfield: "true"} 97 }); 98 } 99 return false; 100 }); 101});
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.