1 2jQuery(document).ready(function ($) { 3 "use strict"; 4 5 $('.rit_popup').on('click', function(e){ 6 e.preventDefault(); 7 window.open($(this).attr('href'), 'newwindow', 'width=500, height=350'); 8 return false; 9 }) 10 11 // donate form 12 $('.rit-paypal-form').each(function(){ 13 14 $(this).find('.rit-amount-button').click(function(){ 15 16 var amount = $(this).attr('data-val'); 17 $(this).addClass('active').siblings().removeClass('active'); 18 $(this).parent('.rit-paypal-amount-wrapper').siblings('[name="amount"]').val(amount); 19 }); 20 21 $(this).find('.custom-amount').change(function(){ 22 var amount = parseInt($(this).val()); 23 $(this).siblings().removeClass('active'); 24 $(this).parent('.rit-paypal-amount-wrapper').siblings('[name="amount"]').val(amount); 25 }); 26 27 $(this).submit(function(e){ 28 var valid = true; 29 var rit_form = $(this); 30 31 // check require fields 32 $(this).find('.rit-require').each(function(){ 33 if( valid && $(this).val() == '' ){ 34 rit_form.children('.rit-notice.require-field').slideDown(200) 35 .siblings('.rit-notice').slideUp(200); 36 valid = false; 37 } 38 }); 39 40 // check email 41 $(this).find('.rit-email').each(function(){ 42 var re = /\S+@\S+/; 43 if( valid && !re.test($(this).val()) ){ 44 rit_form.children('.rit-notice.email-invalid').slideDown(200) 45 .siblings('.rit-notice').slideUp(200); 46 valid = false; 47 } 48 }); 49 50 if( valid ){ 51 rit_form.children('.rit-notice').slideUp(200); 52 rit_form.children('.rit-paypal-loader').slideDown(200); 53 54 var ajax_url = rit_form.attr('data-ajax'); 55 56 $.ajax({ 57 type: 'POST', 58 url: ajax_url, 59 data: jQuery(this).serialize(), 60 dataType: 'json', 61 error: function(a, b, c){ 62 console.log(a, b, c); 63 }, 64 success: function(data){ 65 rit_form.children('.rit-notice.alert-message') 66 .html(data.message).slideDown(200).addClass('rit-' + data.status); 67 rit_form.children('.rit-paypal-loader').slideUp(200); 68 69 if( data.status == 'success' ){ 70 rit_form[0].submit(); 71 } 72 } 73 }); 74 } 75 76 e.preventDefault(); 77 e.returnValue = false; 78 }); 79 }); 80}); 81
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.