PageSourceSearch

https://www.bayareaanimalrescuecrew.org/min/static/js/forms/forms.js?1742372938.1

js bayareaanimalrescuecrew.org collected 2026-10-05 22:01:21 UTC 7,091 bytes, 46 lines download raw bytes

1function formsInitAddressAutocomplete(){if(typeof(google)=='undefined'||typeof(google.maps)=='undefined'||typeof(google.maps.places)=='undefined'||typeof(google.maps.places.Autocomplete)=='undefined')
2return;$('.forms').find('.field_title').each(function(){if(!this.innerHTML||!this.innerHTML.match(/address/i)||this.innerHTML.match(/e.?mail/i))
3return;var field=$(this).closest('.field');var input=field.find('input[type="text"]');if(!input.length)
4return;var autocomplete=new google.maps.places.Autocomplete(input.get(0),{types:['address']});autocomplete.addListener('place_changed',function(){var place=autocomplete.getPlace();var address=input,city,state,zip,country;field.parent().find('.field_title').each(function(){if(!this.innerHTML)
5return;if(this.innerHTML.match(/(^|[\t\n\r\s])city/i))
6city=$(this).closest('.field').find('input[type="text"]');else if(this.innerHTML.match(/(^|[\t\n\r\s])state/i))
7state=$(this).closest('.field').find('input[type="text"],select');else if(this.innerHTML.match(/(^|[\t\n\r\s])zip/i))
8zip=$(this).closest('.field').find('input[type="text"]');else if(this.innerHTML.match(/(^|[\t\n\r\s])country/i))
9country=$(this).closest('.field').find('input[type="text"],select');});address.val('');for(var i=0;i<place.address_components.length;i++){for(var j=0;j<place.address_components[i].types.length;j++){if(place.address_components[i].types[j]=="street_number"){if(address&&address.length)
10address.val((address.val()?address.val()+' ':'')+place.address_components[i].short_name).change();}else if(place.address_components[i].types[j]=="route"){if(address&&address.length)
11address.val((address.val()?address.val()+' ':'')+place.address_components[i].long_name).change();}else if(place.address_components[i].types[j]=="locality"){if(city&&city.length)
12city.val(place.address_components[i].long_name).change();else
13address.val((address.val()?address.val()+', ':'')+place.address_components[i].long_name);}else if(place.address_components[i].types[j]=="country"){if(country&&country.length){if(country.is('select')){var matchedCountry=country.find('option[value*="'+place.address_components[i].long_name+'"]');if(!matchedCountry.length)
14matchedCountry=country.find('option[value*="'+place.address_components[i].short_name+'"]');if(matchedCountry.length)
15country.val(matchedCountry.attr('value')).change();}else{country.val(place.address_components[i].long_name).change();}}else{address.val((address.val()?address.val()+', ':'')+place.address_components[i].long_name);}}else if(place.address_components[i].types[j]=="administrative_area_level_1"){if(state&&state.length){if(state.is('select')){var stateComponent=place.address_components[i];setTimeout(function(){var matchedState=state.find('option[value*="'+stateComponent.long_name+'"]');if(!matchedState.length)
16matchedState=state.find('option[value*="'+stateComponent.short_name+'"]');if(matchedState.length)
17state.val(matchedState.attr('value')).change();});}else{state.val(place.address_components[i].short_name).change();}}else{address.val((address.val()?address.val()+', ':'')+place.address_components[i].long_name);}}else if(place.address_components[i].types[j]=="postal_code"){if(zip&&zip.length)
18zip.val(place.address_components[i].short_name).change();else
19address.val((address.val()?address.val()+', ':'')+place.address_components[i].short_name);}}}
20address.change();});})}
21function formsRetainFieldData(formid){if(typeof(localStorage)=='undefined'||!formid)
22return;let jform=$('form input[name="form_id"][value="'+formid+'"]').closest('form');if(!jform.length)
23return;let data;try{data=JSON.parse(localStorage.getItem('form_'+formid));}catch(e){console.log(e);}
24jform.find('input[name^="form_field_"], textarea[name^="form_field_"], select[name^="form_field_"]').each(function(){let jthis=$(this);let name=jthis.attr('name');if(this.type=='hidden')
25return;if(data&&data[name]){if(this.type=='checkbox'||this.type=='radio'){if(data[name]instanceof Array){jform.find('input[name="'+this.name+'"]').each(function(){if($.inArray(this.value,data[name])!=-1){if(!this.checked){this.checked=true;$(this).change();}}else{if(this.checked){this.checked=false;$(this).change();}}});}}else{if(jthis.val()!=data[name])
26jthis.val(data[name]).change();}}
27jthis.unbind('.forms_retain').bind('change.forms_retain',function(){if(!data)
28data={};
28if(this.type=='checkbox'||this.type=='radio'){let selected_value=new Array();jform.find('input[name="'+this.name+'"]').each(function(){if(this.checked)
29selected_value.push(this.value);});data[name]=selected_value;}else{data[name]=jthis.val();}
30try{localStorage.setItem('form_'+formid,JSON.stringify(data));}catch(e){console.log(e);}});});}
31$(function(){$.FI.extend(function(){$(this).find('.forms form [data-parent-id]').each(function(){var jthis=$(this);var jforms=jthis.closest('.forms');var parent=jthis.parent();var parent_id=jthis.attr('data-parent-id');var parent_value=jthis.attr('data-parent-value').split('|');var neg_parent_value=[];for(var i in parent_value){if(parent_value[i].indexOf('!')!=-1)
32neg_parent_value.push(parent_value[i].substring(1));}
33jforms.find('input[name="form_field_'+parent_id+'"],input[name^="form_field_'+parent_id+'["], '+'textarea[name="form_field_'+parent_id+'"],textarea[name^="form_field_'+parent_id+'["], '+'select[name="form_field_'+parent_id+'"],select[name^="form_field_'+parent_id+'["]').change(function(){var show=false;var ithis=$(this);var ifield=ithis.closest('.field');var selected_value=ithis.val();if(this.type=='checkbox'||this.type=='radio'){selected_value=new Object();jforms.find('input[name="'+this.name+'"]').each(function(i){if(this.checked)
34selected_value[i]=this.value;});if($.isEmptyObject(selected_value))
35selected_value[0]='';}
36if(typeof(selected_value)!='object')
37selected_value={0:selected_value};if(!ifield.attr('data-parent-id')||ifield.css('display')!='none'||jthis.is('optgroup')){for(var i in selected_value){if($.inArray(selected_value[i],parent_value)!=-1||(neg_parent_value.length>0&&$.inArray(selected_value[i],neg_parent_value)==-1))
38show=true;}}
39if(jthis.is('optgroup')){if(show){if(!jthis.parent().length)
40jthis.appendTo(parent);var selected=jthis.find('option[selected]');if(!selected.length)
41selected=jthis.find('option:first');parent.val(selected.val());}else{jthis.detach();}
42return true;}
43var isDisplayNone=(jthis.css('display')=='none');if((show&&!isDisplayNone)||(!show&&isDisplayNone))
44return;jthis.showHide(show,function(){jthis.find('input,textarea,select').change();});}).change();});$(this).find('.forms form .fc_content').unbind('.forms').bind('fctoggle.forms',function(content,show,fccontent){if(!show)
45return;fccontent.find('[data-parent-id]').each(function(){var jthis=$(this);var parent_id=parseInt(jthis.attr('data-parent-id'));if(!parent_id)
46return;fccontent.find('input[name="form_field_'+parent_id+'"],input[name^="form_field_'+parent_id+'["], '+'textarea[name="form_field_'+parent_id+'"],textarea[name^="form_field_'+parent_id+'["], '+'select[name="form_field_'+parent_id+'"],select[name^="form_field_'+parent_id+'["]').change();});});formsInitAddressAutocomplete();});});

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.