All checks were successful
continuous-integration/drone/push Build is passing
1 line
1.0 KiB
JavaScript
1 line
1.0 KiB
JavaScript
"use strict";(function(){const t=document.querySelector("#gdoc-search-input"),e=document.querySelector("#gdoc-search-results");t.addEventListener("focus",n),t.addEventListener("keyup",s);function n(){t.removeEventListener("focus",n),t.required=!0,o("/js/flexsearch-ad47a5e1ee.min.js"),o("/js/en.search-data.min.0ffb683be720d0aa9a952cdf7965f763bcca508eb33c869653150cce1dcacc46.js",function(){t.required=!1,s()})}function s(){for(;e.firstChild;)e.removeChild(e.firstChild);if(!t.value){console.log("empty"),e.classList.remove("has-hits");return}const n=window.geekdocSearchIndex.search(t.value,10);console.log(n.length),n.length>0?e.classList.add("has-hits"):e.classList.remove("has-hits"),n.forEach(function(t){const n=document.createElement("li"),s=n.appendChild(document.createElement("a"));s.href=t.href,s.textContent=t.parent?t.parent+" / "+t.title:t.title,e.appendChild(n),e.classList.add("DUMMY")})}function o(e,t){const n=document.createElement("script");n.defer=!0,n.async=!1,n.src=e,n.onload=t,document.head.appendChild(n)}})() |