This commit is contained in:
David Wu
2017-12-20 01:48:30 +01:00
parent cc1287be7a
commit 6c53b6ea06

View File

@ -23,22 +23,21 @@
<link rel="stylesheet" href="prism.css">
</head>
<script>
document.addEventListener("load", alert("Attention! This site is only a fork of the original project demonstrating the newest changes made by myself. The original project can be found by clicking on the logo."));
function search() {
var input, filter, nav,a, i;
input = document.getElementById('searchInput');
var input, filter, i;
input = document.querySelector('#searchInput');
filter = input.value.toUpperCase();
nav = document.getElementById("snippetListDrawer");
tags = nav.getElementsByTagName("a");
tags = Array.from(document.querySelector('#snippetListDrawer').getElementsByTagName('a'));
for(var i = 0; i < tags.length; i++) {
var snippetLink = tags[i].getAttribute("href");
if (snippetLink.toUpperCase().indexOf(filter) > -1) {
tags[i].style.display = "";
} else {
tags[i].style.display = "none";
}
}
tags.forEach(x => {x.getAttribute("href").toUpperCase().indexOf(filter) > -1 ? x.style.display = "" : x.style.display = "none"});
// for(var i = 0; i < tags.length; i++) {
// var snippetLink = tags[i].getAttribute("href");
// if (snippetLink.toUpperCase().indexOf(filter) > -1) {
// tags[i].style.display = "";
// } else {
// tags[i].style.display = "none";
// }
// }
}
</script>
<body>