1/* 2 * Additions on top of the compiled bundle (resources/js, built by Vite). 3 */ 4 5/* 6 * Links kept out of the link graph. Messenger and the catalog's links to the 7 * listed sites carry their URL in data-href instead of href: a crawler sees no 8 * link to follow, pass weight to or report as a redirect or a dead site, and a 9 * visitor gets the same link through this handler. 10 */ 11(function () { 12 function target(event) { 13 return event.target.closest ? event.target.closest('[data-href]') : null; 14 } 15 16 function open(el, newTab) { 17 var url = el.getAttribute('data-href'); 18 19 if (!url) { 20 return; 21 } 22 23 if (newTab || el.getAttribute('data-target') === '_blank') { 24 window.open(url, '_blank', 'noopener'); 25 } else { 26 window.location.href = url; 27 } 28 } 29 30 document.addEventListener('click', function (event) { 31 var el = target(event); 32 33 if (el) { 34 event.preventDefault(); 35 open(el, event.ctrlKey || event.metaKey || event.shiftKey); 36 } 37 }); 38 39 // Middle click, which a real link would open in a new tab. 40 document.addEventListener('auxclick', function (event) { 41 var el = event.button === 1 ? target(event) : null; 42 43 if (el) { 44 event.preventDefault(); 45 open(el, true); 46 } 47 }); 48 49 // Enter, as on a link; the elements carry tabindex="0" to be reachable. 50 document.addEventListener('keydown', function (event) { 51 var el = event.key === 'Enter' ? target(event) : null; 52 53 if (el) { 54 event.preventDefault(); 55 open(el, false); 56 } 57 }); 58})(); 59 60// API landing: "View all providers" expands the provider table. 61(function () { 62 document.addEventListener('click', function (event) { 63 var button = event.target.closest('[data-api-lp-providers-toggle]'); 64 if (!button) { 65 return; 66 } 67 var box = button.closest('[data-api-lp-providers]'); 68 var expanded = box.classList.toggle('is-expanded'); 69 button.textContent = expanded ? button.dataset.labelLess : button.dataset.labelMore; 70 }); 71})();
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.