PageSourceSearch

https://www.huepfburgen-mainz.de/media/lib_hdlib/js/selectField.min.js?a24063

js huepfburgen-mainz.de collected 2026-10-06 20:41:38 UTC 3,316 bytes, 13 lines download raw bytes

1jQuery(document).ready(function(){HdLibInitializeSelectFields(document);jQuery(document).on('joomla:updated',function(event){HdLibInitializeSelectFields(event.target)})});function HdLibInitializeSelectFields(scope){jQuery(scope).find('joomla-field-fancy-select.HdSelectFieldSetTreshold').addBack('joomla-field-fancy-select.HdSelectFieldSetTreshold').each(function(){let container=jQuery(this);let selectField=container.find('select');if(selectField.data('setThreshold')&&container[0].choicesInstance&&typeof container[0].choicesInstance=='object'){container[0].choicesInstance.config.fuseOptions.threshold=selectField.data('setThreshold')}});jQuery(scope).find('joomla-field-fancy-select').addBack('joomla-field-fancy-select').each(function(){HdLibPrepareFancySelect(jQuery(this))})}
2function HdLibPrepareFancySelect(container){let selectField=container.find('select');let choices=container[0].choicesInstance;if(!choices||typeof choices!='object'){return}
3if(selectField.data('disableSearch')){choices.config.searchEnabled=!1}
4if(selectField.prop('multiple')&&choices.config.searchEnabled!==!1){choices.config.resetScrollPosition=!1;HdLibKeepFancySelectSearchState(container,choices)}}
5function HdLibKeepFancySelectSearchState(container,choices){if(container.data('hdLibSearchStateInitialized')){return}
6container.data('hdLibSearchStateInitialized',1);let saveState=function(){let textInput=HdLibGetFancySelectSearchInput(container,choices);let choiceList=HdLibGetFancySelectChoiceList(container,choices);container.data('hdLibSearchValue',textInput.length?textInput.val():'');container.data('hdLibChoiceScrollTop',choiceList.length?choiceList.scrollTop():0)};let restoreState=function(){window.setTimeout(function(){let searchValue=container.data('hdLibSearchValue')||'';let scrollTop=container.data('hdLibChoiceScrollTop')||0;let textInput=HdLibGetFancySelectSearchInput(container,choices);let choiceList=HdLibGetFancySelectChoiceList(container,choices);if(!textInput.length||!searchValue.length){return}
7textInput.val(searchValue);if(typeof choices._handleSearch=='function'){choices._handleSearch(searchValue)}else if(textInput[0]){textInput[0].dispatchEvent(new Event('input',{bubbles:!0}))}
8if(typeof choices.showDropdown=='function'){choices.showDropdown()}
9textInput.trigger('focus');if(choiceList.length){choiceList.scrollTop(scrollTop);window.setTimeout(function(){choiceList.scrollTop(scrollTop)},0)}},0)};container.on('input.hdLibSearchState keyup.hdLibSearchState','.choices__input--cloned, input[type="search"], input[type="text"][role="textbox"]',saveState);container.on('mousedown.hdLibSearchState touchstart.hdLibSearchState pointerdown.hdLibSearchState','.choices__item--choice',saveState);container.on('addItem.hdLibSearchState change.hdLibSearchState',restoreState)}
10function HdLibGetFancySelectSearchInput(container,choices){if(choices&&choices.input&&choices.input.element){return jQuery(choices.input.element)}
11return container.find('.choices__input--cloned, input[type="search"], input[type="text"][role="textbox"]').first()}
12function HdLibGetFancySelectChoiceList(container,choices){if(choices&&choices.choiceList&&choices.choiceList.element){return jQuery(choices.choiceList.element)}
13return container.find('.choices__list--dropdown .choices__list, .choices__list[role="listbox"]').first()}

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.