1((function(){ 2 var findAncestor = function(el, selector) { 3 while ((el = el.parentElement) && !((el.matches || el.matchesSelector).call(el, selector))) {} 4 return el; 5 }; 6 7 var fields = document.querySelectorAll('input[name="searchfield"][data-search-input]'); 8 fields.forEach(function(field) { 9 var form = findAncestor(field, 'form[data-simplesearch-form]'), 10 min = field.getAttribute('min') || false, 11 location = field.getAttribute('data-search-input'), 12 separator = field.getAttribute('data-search-separator'); 13 14 if (min) { 15 var invalid = field.getAttribute('data-search-invalid'); 16 field.addEventListener('keydown', function() { 17 field.setCustomValidity(field.value.length >= min ? '' : invalid); 18 }); 19 } 20 21 form.addEventListener('submit', function(event) { 22 event.preventDefault(); 23 24 if (field.checkValidity()) { 25 window.location.href = location + separator + field.value; 26 } 27 }); 28 }); 29})());
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.