Files
wiki/template.html
2023-09-24 10:41:03 +02:00

116 lines
2.7 KiB
HTML

<!DOCTYPE html>
<title>SourceBox Wiki</title>
<script>
documentlist = @DOCUMENTLIST;
namelist = @NAMELIST;
function toggleTree(element)
{
nested = element.parentNode.childNodes[3];
if(nested.className.indexOf("active",0) != -1)
{
nested.className = "nested";
element.parentNode.childNodes[0].innerHTML = "+";
}
else
{
nested.className = "nested active";
element.parentNode.childNodes[0].innerHTML = "-";
}
if(element.className.indexOf("active",0) != -1)
{
element.className = ""
}
else
{
element.className = "active"
}
}
function updateSearch() {
searchtext = document.getElementById("searchbox").value.toLowerCase();
var res = [];
var searchresults = document.getElementById("searchresults")
searchresults.innerHTML = ""
if(searchtext === "")
{
document.getElementById("filetree").style.display = "block"
return;
}
else
{
document.getElementById("filetree").style.display = "none"
}
for (var i = 0; i < namelist.length; i++)
{
if(namelist[i].toLowerCase().indexOf(searchtext) == -1) 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>
<style>
pre {
margin-left:16px;
background-color: #EEE;
border-color: #CCC;
border-style:solid;
border-width:1px;
}
.nested {
display: none;
border-left: 1px solid #000;
}
ul.active {
display: block !important;
}
ul {
padding-left: 8px;
}
li ::marker {
color:#00000000;
display:none;
}
li {
list-style-type: none !important;
}
li b {
cursor: pointer;
display: inline-block;
}
.liicon {
display:inline-block;
width:12px;
height:100%;
font-family: monospace;
font-size: 16px;
}
</style>
<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>
<ul id="filetree">
@FILETREE
</ul>
</nav>
</div>
<div style="margin-left:200px;">
<p id="errorp"></p>
@CONTENT
</div>