mirror of
https://github.com/celisej567/wiki.git
synced 2025-12-31 01:49:32 +03:00
37 lines
1.3 KiB
HTML
37 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<script>
|
|
const documentlist = @DOCUMENTLIST
|
|
const namelist = @NAMELIST
|
|
|
|
function updateSearch() {
|
|
searchtext = document.getElementById("searchbox").value.toLowerCase();
|
|
var res = [];
|
|
var searchresults = document.getElementById("searchresults")
|
|
searchresults.innerHTML = ""
|
|
if(searchtext === "")
|
|
return;
|
|
for (var i = 0; i < namelist.length; i++)
|
|
{
|
|
if(!namelist[i].toLowerCase().includes(searchtext)) continue;
|
|
var searchelement = document.createElement("li");
|
|
var link = document.createElement("a");
|
|
searchelement.appendChild(link);
|
|
link.setAttribute("href", documentlist[i]);
|
|
link.innerHTML = namelist[i];
|
|
searchresults.appendChild(searchelement);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
</script>
|
|
<div style="position:fixed; display:block; top: 0px; left: 0px; height:100%; width:200px;border-color: black; border-width: 1px; border-style:solid;">
|
|
<input type="text" placeholder="search..." autocomplete="off" id="searchbox" oninput="updateSearch();" style="width:192px;">
|
|
<nav>
|
|
<ul id="searchresults">
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
<div style="margin-left:200px;">
|
|
@CONTENT
|
|
</div> |