1jQuery(document).ready(function(){ 2 jQuery("form.gdl-contact-form").submit(function(){ 3 var the_form = jQuery(this); 4 var error = false; 5 6 jQuery(this).find('#sending-result').slideUp(200); 7 jQuery(this).find('.require-field').each(function(){ 8 if(jQuery.trim(jQuery(this).val()) == '') { 9 error = true; 10 jQuery(this).siblings('.error').slideDown(200); 11 }else if(jQuery(this).hasClass('email')) { 12 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 13 if(!emailReg.test(jQuery.trim(jQuery(this).val()))) { 14 error = true; 15 jQuery(this).siblings('.error').slideDown(200); 16 }else{ 17 jQuery(this).siblings('.error').slideUp(200); 18 } 19 }else{ 20 jQuery(this).siblings('.error').slideUp(200); 21 } 22 }); 23 24 if(error) return false; 25 26 jQuery(this).find('.contact-loading').fadeIn(); 27 28 var send_data = jQuery(this).serialize(); 29 jQuery.post(MyAjax.ajaxurl, 'action=submit_contact_form&' + send_data, function(data){ 30 the_form.find('.contact-loading').fadeOut(); 31 if( data.success == '1' ){ 32 the_form.find('input[type="text"], textarea').val(''); 33 the_form.find('#sending-result div').each(function(){ 34 jQuery(this).html(data.value); 35 jQuery(this).removeClass('red').addClass('green'); 36 jQuery(this).parent().slideDown(200); 37 }); 38 }else{ 39 the_form.find('#sending-result div').each(function(){ 40 jQuery(this).html(data.value); 41 jQuery(this).removeClass('green').addClass('red'); 42 jQuery(this).parent().slideDown(200); 43 }); 44 } 45 46 }, 'json'); 47 48 49 return false; 50 }); 51});
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.