1var AjaxForm = { 2initialize: function (afConfig) { 3if (!jQuery().ajaxForm) { 4document.write('<script src="' + afConfig['assetsUrl'] + 'js/lib/jquery.form.min.js"><\/script>'); 5} 6if (!jQuery().jGrowl) { 7document.write('<script src="' + afConfig['assetsUrl'] + 'js/lib/jquery.jgrowl.min.js"><\/script>'); 8} 9$(document).ready(function () { 10}); 11$(document).off('submit', afConfig['formSelector']).on('submit', afConfig['formSelector'], function (e) { 12$(this).ajaxSubmit({ 13dataType: 'json', 14data: {pageId: afConfig['pageId']}, 15url: afConfig['actionUrl'], 16beforeSerialize: function (form) { 17form.find(':submit').each(function () { 18if (!form.find('input[type="hidden"][name="' + $(this).attr('name') + '"]').length) { 19$(form).append( 20$('<input type="hidden">').attr({ 21name: $(this).attr('name'), 22value: $(this).attr('value') 23}) 24); 25} 26}) 27}, 28beforeSubmit: function (fields, form) { 29if (typeof(afValidated) != 'undefined' && afValidated == false) { 30return false; 31} 32form.find('.error').html(''); 33form.find('.error').removeClass('error'); 34form.find('input,textarea,select,button').attr('disabled', true); 35return true; 36}, 37success: function (response, status, xhr, form) { 38form.find('input,textarea,select,button').attr('disabled', false); 39response.form = form; 40$(document).trigger('af_complete', response); 41if (!response.success) { 42AjaxForm.Message.error(response.message); 43if (response.data) { 44var key, value, focused; 45for (key in response.data) { 46if (response.data.hasOwnProperty(key)) { 47if (!focused) { 48form.find('[name="' + key + '"]').focus(); 49focused = true; 50} 51value = response.data[key]; 52form.find('.error_' + key).html(value).addClass('error'); 53form.find('[name="' + key + '"]').addClass('error'); 54} 55} 56} 57} 58else { 59AjaxForm.Message.success(response.message); 60form.find('.error').removeClass('error'); 61form[0].reset(); 62if (typeof(grecaptcha) != 'undefined') { 63grecaptcha.reset(); 64} 65} 66} 67}); 68e.preventDefault(); 69return false; 70}); 71$(document).on('keypress change', '.error', function () { 72var key = $(this).attr('name'); 73$(this).removeClass('error'); 74$('.error_' + key).html('').removeClass('error'); 75}); 76$(document).on('reset', afConfig['formSelector'], function () { 77$(this).find('.error').html(''); 78AjaxForm.Message.close(); 79}); 80} 81}; 82AjaxForm.Message = { 83success: function (message, sticky) { 84if (message) { 85if (!sticky) { 86sticky = false; 87} 88$.jGrowl(message, {theme: 'af-message-success', sticky: sticky}); 89} 90}, 91error: function (message, sticky) { 92if (message) { 93if (!sticky) { 94sticky = false; 95} 96$.jGrowl(message, {theme: 'af-message-error', sticky: sticky}); 97} 98}, 99info: function (message, sticky) { 100if (message) { 101if (!sticky) { 102sticky = false; 103} 104$.jGrowl(message, {theme: 'af-message-info', sticky: sticky}); 105} 106}, 107close: function () { 108$.jGrowl('close'); 109}, 110};
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.