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"> <link rel="stylesheet" href="prism.css">
</head> </head>
<script> <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() { function search() {
var input, filter, nav,a, i; var input, filter, i;
input = document.getElementById('searchInput'); input = document.querySelector('#searchInput');
filter = input.value.toUpperCase(); filter = input.value.toUpperCase();
nav = document.getElementById("snippetListDrawer"); tags = Array.from(document.querySelector('#snippetListDrawer').getElementsByTagName('a'));
tags = nav.getElementsByTagName("a");
for(var i = 0; i < tags.length; i++) { tags.forEach(x => {x.getAttribute("href").toUpperCase().indexOf(filter) > -1 ? x.style.display = "" : x.style.display = "none"});
var snippetLink = tags[i].getAttribute("href"); // for(var i = 0; i < tags.length; i++) {
if (snippetLink.toUpperCase().indexOf(filter) > -1) { // var snippetLink = tags[i].getAttribute("href");
tags[i].style.display = ""; // if (snippetLink.toUpperCase().indexOf(filter) > -1) {
} else { // tags[i].style.display = "";
tags[i].style.display = "none"; // } else {
} // tags[i].style.display = "none";
} // }
// }
} }
</script> </script>
<body> <body>