1var require; var requirejs; var define;"use strict"; 2(function ($) { 3 4 $.fn.adjustStateCountyLists = function(reset){ 5 6 if (typeof reset == 'undefined') reset = false; 7 8 $(this).each(function(){ 9 10 var form = $(this).closest('.gform_fields'); 11 var target = form.find('.state-county-target select'); 12 13 if (target.length) { 14 15 // this needs to reference the text of the selected option 16 // because GF forms use the full text, but API requests use the abbreviation 17 var state = $(this).find('.address_state option:selected').text(); 18 19 if (state.length) { 20 21 if(reset) { 22 target.val(""); 23 } 24 25 // hide/show counties filtered by state 26 target.children('optgroup').each(function(){ 27 28 if ($(this).attr('label') == state) 29 $(this).removeAttr('disabled').removeAttr("style"); 30 31 else $(this).prop('disabled', true).css({display: "none"}); 32 33 }); 34 } 35 36 // show all counties 37 else target.children('optgroup').removeAttr('disabled'); 38 } 39 40 }); 41 }; 42 43 $(document).ready(function () { 44 45 // Adjust state/county lists 46 if($('.gfield.state-county-trigger').length) { 47 $('.gfield.state-county-trigger').adjustStateCountyLists(); 48 $('.gfield.state-county-trigger').change(function(){ 49 $(this).adjustStateCountyLists(true); 50 }); 51 } 52 53 54 //multi-page forms 55 $(document).on('gform_page_loaded', function (event, form_id, current_page) { 56 // Adjust state/county lists 57 $('.gfield.state-county-trigger').adjustStateCountyLists(); 58 $('.gfield.state-county-trigger').change(function(){ 59 $(this).adjustStateCountyLists(true); 60 }); 61 }); 62 63 // Portal secure form 64 if(document.getElementById('gf_8')) { 65 //do this on initial page load 66 window.scGravityFormsHelpers.initB2cSecureForm(); 67 68 //and on failed validation, this gets called again 69 $(document).on('gform_page_loaded', function (event, form_id, current_page) { 70 window.scGravityFormsHelpers.initB2cSecureForm(); 71 }); 72 } 73 74 // 4473 form 75 if(document.getElementById('gf_33')) { 76 //do this on initial page load 77 window.scGravityFormsHelpers.init4473Form(); 78 79 //and on failed validation, this gets called again 80 $(document).on('gform_page_loaded', function (event, form_id, current_page) { 81 window.scGravityFormsHelpers.init4473Form(); 82 }); 83 } 84 }); 85 86 window.scGravityFormsHelpers = { 87 initB2cSecureForm: function () { 88 // now handled via fishpig block 89 }, 90 91 init4473Form: function () { 92 // the value of the hidden residential state label 93 $('#residentOf').text( $('#input_33_125').val() ); 94 } 95 } 96 97})(jQuery.noConflict());
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.