PageSourceSearch

https://www.eastsussexsab.org.uk/dist/js/component.AddressAutocomplete.min.js?v=

js eastsussexsab.org.uk collected 2026-10-06 06:31:30 UTC 3,093 bytes, 1 lines download raw bytes

1var componentForm={street_number:"short_name",route:"long_name",postal_code:"long_name",administrative_area_level_2:"short_name",postal_town:"short_name",premise:"short_name",locality:"short_name"};function initComponentAddressAutocomplete(){for(var e=$(".address-component"),n=0;n<e.length;n++)configureAddressComponent($(e[n]))}function configureAddressComponent(e){var n=e.find(".address-component-autocomplete"),o=e.find(".address-component-hidden-input"),a=e.find(".address-component-line-1"),t=e.find(".address-component-line-2"),d=e.find(".address-component-town"),s=e.find(".address-component-county"),r=e.find(".address-component-postcode"),l=e.find(".address-component-line-1-label"),u=e.find(".address-component-line-2-label"),c=e.find(".address-component-town-label"),i=e.find(".address-component-county-label"),m=e.find(".address-component-postcode-label"),p=o[0].id;if(a[0].id=p+"_line1",t[0].id=p+"_line2",d[0].id=p+"_town",s[0].id=p+"_county",r[0].id=p+"_postcode",a.change(function(){updateAddressCompononentHidden(o,a,t,d,s,r)}),t.change(function(){updateAddressCompononentHidden(o,a,t,d,s,r)}),d.change(function(){updateAddressCompononentHidden(o,a,t,d,s,r)}),s.change(function(){updateAddressCompononentHidden(o,a,t,d,s,r)}),r.change(function(){updateAddressCompononentHidden(o,a,t,d,s,r)}),l.attr("for",p+"_line1"),u.attr("for",p+"_line2"),c.attr("for",p+"_town"),i.attr("for",p+"_county"),m.attr("for",p+"_postcode"),void 0!==n[0]){var v={bounds:new google.maps.LatLngBounds(new google.maps.LatLng(50.9085955,.2494166)),componentRestrictions:{country:"gb"}},_=new google.maps.places.Autocomplete(n[0],v);_.setFields(["address_component","name"]),_.addListener("place_changed",function(){var e=_.getPlace();a[0].value="",t[0].value="",d[0].value="",s[0].value="",r[0].value="";var l="";console.log(e);for(var u=0;u<e.address_components.length;u++){var c=e.address_components[u].types[0];if(componentForm[c]){var i=e.address_components[u][componentForm[c]];switch(c){case"premise":a[0].value=i;break;case"street_number":t[0].value=i;break;case"route":""==t[0].value?t[0].value=i:t[0].value=t[0].value+" "+i;break;case"postal_town":d[0].value=i;break;case"administrative_area_level_2":s[0].value=i;break;case"postal_code":r[0].value=i;break;case"locality":l=i}}}if(""==a[0].value){var m=getPlaceComponent("route",e),p=getPlaceComponent("street_number",e);try{e.name!=m.short_name&&e.name!=p.short_name+" "+m.short_name&&(a[0].value=e.name)}catch(n){a[0].value=e.name}}a[0].value==t[0].value&&(t[0].value=""),a[0].value==r[0].value&&(a[0].value=t[0].value,t[0].value=""),""==a[0].value&&""!=t[0].value&&(a[0].value=t[0].value,t[0].value=""),""!=l&&""==t[0].value&&(t[0].value=l),updateAddressCompononentHidden(o,a,t,d,s,r),n[0].value=""})}}function updateAddressCompononentHidden(e,n,o,a,t,d){e[0].value=n[0].value+", "+o[0].value+", "+a[0].value+", "+t[0].value+", "+d[0].value}function getPlaceComponent(e,n){for(var o=0;o<n.address_components.length;o++){var a=n.address_components[o];if(a.types[0]==e)return a}}$(document).ready(()=>{initComponentAddressAutocomplete()});

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.