PageSourceSearch

https://homebrewersassociation.org/wp-content/plugins/directories-…/js/location-textfield.min.js?ver=2.0.29

js homebrewersassociation.org collected 2026-10-01 10:36:46 UTC 7,130 bytes, 1 lines download raw bytes

1"use strict";!function(t){DRTS.Location=DRTS.Location||{},DRTS.Location.textfield=DRTS.Location.textfield||function(e){var a=t(e);if(a.length){var o,s=a.find(".drts-location-text-input"),n=a.find(".drts-location-text-center"),i=a.find(".drts-location-text-viewport"),l=a.find(".drts-location-text-zoom"),c=a.find(".drts-location-text-radius"),g=c.hasClass("drts-location-text-radius-slider"),r=function(){g?c.data("ionRangeSlider").reset():c.val("")};if(s.length){var d={suggest_place:void 0===a.data("suggest-place")||(a.data("suggest-place")||!1),suggest_place_header:a.data("suggest-place-header")||"",suggest_place_footer:a.data("suggest-place-footer")||"",suggest_place_icon:a.data("suggest-place-icon")||"fas fa-map-pin",suggest_place_country:a.data("suggest-place-country")||null,suggest_place_minlength:a.data("suggest-place-minlength")||1,suggest_location:a.data("suggest-location"),suggest_location_header:a.data("suggest-location-header")||"",suggest_location_icon:a.data("suggest-location-icon")||"",suggest_location_url:a.data("suggest-location-url")||null,suggest_location_top_url:a.data("suggest-location-top-url")||null,suggest_location_count:a.data("suggest-location-count")||null,suggest_location_parents:a.data("suggest-location-parents")||!1,geolocation:void 0===a.data("geolocation")||(a.data("geolocation")||!1)},u=a.find(".drts-location-text-term-id"),p=a.find(".drts-location-text-taxonomy"),v=a.find(".drts-clear").css("visibility",s.val().length>0?"visible":"hidden"),h=[];if(d.suggest_location&&d.suggest_location_url){var _={},f=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("title","pt"),queryTokenizer:Bloodhound.tokenizers.whitespace,prefetch:{url:d.suggest_location_url}});d.suggest_location_header&&(_.header="<h4>"+d.suggest_location_header+"</h4>"),_.suggestion=function(e){var a=t("<span>").text(e.title);if(d.suggest_location_count){var o=t("<span>").addClass(DRTS.bsPrefix+"badge "+DRTS.bsPrefix+"badge-pill "+DRTS.bsPrefix+"text-bg-light "+DRTS.bsPrefix+"ms-1").text(e.count||"0");a.append(o)}if(d.suggest_location_parents&&e.pt){var s=t("<span>").text(" - "),n=t("<span>").text(e.pt.join(" > "));a.append(s).append(n)}var i,l=t("<div/>").append(a);return e.icon_src?i=t("<img/>").attr("class","drts-icon drts-icon-sm").attr("src",e.icon_src):d.suggest_location_icon&&(i=t("<i/>").attr("class","drts-icon drts-icon-sm "+d.suggest_location_icon)),i&&l.prepend(i),l[0].outerHTML},h.push({name:d.suggest_location,source:function(t,e,a){t.length>0&&f.search(t,e,a)},display:d.suggest_location_parents?function(t){return t.pt?t.pt.join(" > ")+" > "+t.title:t.title}:"title",templates:_,limit:a.data("suggest-location-num")||100})}if(d.suggest_location_top_url){var m={},x=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("title"),queryTokenizer:Bloodhound.tokenizers.whitespace,prefetch:{url:d.suggest_location_top_url}});m.suggestion=function(e){var a=t("<span>").text(e.title);if(d.suggest_location_count){var o=t("<span>").addClass(DRTS.bsPrefix+"badge "+DRTS.bsPrefix+"badge-pill "+DRTS.bsPrefix+"text-bg-light "+DRTS.bsPrefix+"ms-1").text(e.count||"0");a.append(o)}var s,n=t("<div/>").append(a);return e.icon_src?s=t("<img/>").attr("class","drts-icon drts-icon-sm").attr("src",e.icon_src):d.suggest_location_icon&&(s=t("<i/>").attr("class","drts-icon drts-icon-sm "+d.suggest_location_icon)),s&&n.prepend(s),n[0].outerHTML},h.push({name:"top-"+d.suggest_location,source:function(t,e,a){t.length||e(x.all())},display:"title",templates:m,limit:100})}if(d.suggest_place){var y={};d.suggest_place_header&&(y.header=t("<h4/>").text(d.suggest_place_header)[0].outerHTML),d.suggest_place_icon&&(y.suggestion=function(e){var a=t("<div/>");return a.append(t("<i/>").attr("class","drts-icon drts-icon-sm "+d.suggest_place_icon)).append(t("<span/>").text(e.text)),a[0].outerHTML}),d.suggest_place_footer&&(y.footer=t("<div/>").attr("class","tt-footer").css({"text-align":"right",margin:"0 5px 3px"}).html(d.suggest_place_footer)[0].outerHTML),h.push({name:"place",display:"text",templates:y,source:function(t,e,a){t.length<d.suggest_place_minlength||DRTS.Location.api.getSuggestions(t,a)}})}if(d.geolocation&&navigator.geolocation&&("https:"===document.location.protocol||"localhost"===document.location.hostname)){var b=function(){var t=!1;s.addClass("drts-ajax-loading"),navigator.geolocation.getCurrentPosition(function(e){s.removeClass("drts-ajax-loading"),t=o=!0,DRTS.Location.api.reverseGeocode([e.coords.latitude,e.coords.longitude],function(t){s.val(t.address).typeahead("val",t.address),p.val(""),u.val(""),i.val(""),l.val(""),g||c.val()&&!(c.val()<5)||c.val(c.data("default-value")>5?c.data("default-value"):5),v.css("visibility",s.val().length>0?"visible":"hidden");var a=e.coords.latitude+","+e.coords.longitude;a!==n.val()&&(n.val(a),s.trigger("change"))},function(t){DRTS.flash(t.message,"danger")})},function(e){s.removeClass("drts-ajax-loading"),t||1!==e.code&&DRTS.flash(e.message,"danger"),console.log(e.message+" ("+e.code+")")},{enableHighAccuracy:!0,timeout:1e4,maximumAge:1/0})};h.push({name:"geolocate",source:function(t,e){o||e([{content:""}])},display:"content",templates:{suggestion:function(){var e=t("<i/>").attr("class","drts-icon drts-icon-sm fas fa-location-arrow");return t("<div/>").html(t("<span/>").text(a.data("geolocation-text")||"Current location")).prepend(e)[0].outerHTML}}})}else a.addClass("drts-location-no-geolocation");h.length?(s.typeahead({highlight:!0,autoselect:!0,minLength:0},h),s.on("typeahead:select",function(t,e,c){if(n.val(""),i.val(""),l.val(""),o=!1,g||r(),c===d.suggest_location||c==="top-"+d.suggest_location)p.val(d.suggest_location),u.val(e.id),s.val("").trigger("change");else if("place"===c)if(p.val(""),u.val(""),e.latlng)n.val(e.latlng[0]+","+e.latlng[1]);else{var h=function(t,e){n.val(t.join(",")),e&&i.val(e.join(","))},_=function(t){console.log(t)};DRTS.Location.api.geocodeSuggestion&&a.data("suggest-place-geocode")?DRTS.Location.api.geocodeSuggestion(e,h,_):DRTS.Location.api.geocode(e.text,h,_)}else"geolocate"===c&&b();v.css("visibility","visible")}).on("keyup",function(t){"Enter"!==t.key&&"Escape"!==t.key&&" "!==t.key&&(p.val(""),u.val(""),n.val(""),i.val(""),l.val(""),g||r(),v.css("visibility",s.val().length>0?"visible":"hidden")),o=!1}).on("typeahead:open",function(){s.closest(".twitter-typeahead").addClass("twitter-typeahead-open")}).on("typeahead:close",function(){s.closest(".twitter-typeahead").removeClass("twitter-typeahead-open")}),v.on("click",function(){p.val(""),u.val(""),n.val(""),i.val(""),l.val(""),g||r(),v.css("visibility","hidden"),s.typeahead("val","").focus(),s.trigger("change"),o=!1,s.typeahead("open")})):(s.on("keyup",function(t){"Enter"!==t.key&&"Escape"!==t.key&&" "!==t.key&&v.css("visibility",s.val().length>0?"visible":"hidden")}),v.on("click",function(){v.css("visibility","hidden"),s.val("").trigger("focus").trigger("change")})),g&&c.on("change",function(){l.val()||i.val("")}
1)}a.on("entity_reset_form_field.sabai",function(){s.length&&(h.length?s.typeahead("val",""):s.val(""),p.val(""),u.val("")),n.val(""),i.val(""),l.val(""),r()})}}}(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.