1(function ($) { 2 'use strict'; 3 4 if (typeof $ === 'undefined') return; 5 6 // The Google Places Autocomplete shim lives in freshpaint-places-shim.js, 7 // which is enqueued in the document head so it can patch the constructor 8 // before bundle.min.js runs in the footer. This file only handles the 9 // Freshpaint attach + selection callbacks. 10 11 function attachFreshpaintTo(input, callbackName) { 12 if (!input || input.hasAttribute('data-fp-autocomplete')) return; 13 input.setAttribute('data-fp-autocomplete', ''); 14 input.setAttribute('data-fp-on-select', 'callback'); 15 input.setAttribute('data-fp-callback', callbackName); 16 if (window.FreshpaintAutocomplete && typeof window.FreshpaintAutocomplete.scan === 'function') { 17 window.FreshpaintAutocomplete.scan(); 18 } 19 } 20 21 // Gravity Form CTA: AJAX-rendered, fires gform_post_render on initial load 22 // and on every re-render (validation, multi-page navigation). 23 $(document).on('gform_post_render', function () { 24 attachFreshpaintTo(document.getElementById('input_16_16'), 'fpGformOnSelect'); 25 }); 26 27 // Salesforce form: server-side rendered, available on DOMContentLoaded. 28 $(function () { 29 attachFreshpaintTo(document.getElementById('sf_location_search'), 'fpSfformOnSelect'); 30 }); 31 32 function makeOnSelect(formType) { 33 return function (sel) { 34 if (!sel || typeof sel.lat !== 'number' || typeof sel.lng !== 'number') return; 35 if (typeof window.loadSearchResultsForFormFromCurrentBounds === 'function') { 36 window.loadSearchResultsForFormFromCurrentBounds(sel.lat, sel.lng, formType); 37 } 38 }; 39 } 40 41 window.fpGformOnSelect = makeOnSelect('gform'); 42 window.fpSfformOnSelect = makeOnSelect('sfform'); 43})(window.jQuery);
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.