start of tag based search

This commit is contained in:
crunk 2022-03-08 23:28:33 +01:00
parent afa2f4c578
commit cd09c12826
5 changed files with 21 additions and 2 deletions

View File

@ -180,6 +180,11 @@ div.maincontent{
margin: 1px;
}
.tags .searched {
background: #fff600;
color: black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;

View File

@ -52,3 +52,17 @@ function removeClass(element, name) {
}
element.className = arr1.join(" ");
}
let searchInput = document.getElementById('tagsearch');
let timeout = null;
// Listen for keystroke events
searchInput.addEventListener('keyup', function (e) {
// Clear the timeout if it has already been set.
clearTimeout(timeout);
// Make a new timeout set to go off in 1000ms (1 second)
timeout = setTimeout(function () {
console.log('Input Value:', searchInput.value);
}, 1000);
});

View File

@ -6,7 +6,6 @@
<title>Autonomous Practices X Distribusi-Verse</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css')}}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/selector.css')}}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/tags.css')}}">
<link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon.ico') }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='icons/apple-touch-icon.png')}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='icons/favicon-32x32.png')}}">

View File

@ -24,4 +24,5 @@
{% endfor %}
</div>
</div>
<input id="tagsearch" type="text" placeholder="Search..">
{% endblock menu %}

View File

@ -46,7 +46,7 @@
<ul>
{% for name, distribusi in distribusies.items() %}
<li class='distribusi filter {{ distribusi["term"] }} {{ distribusi["year"] }} {{ distribusi["course"] }}'>
{{distribusi["useremail"]}}: <a href='stash/{{name}}/index.html'>{{name}}</a>
<a href='stash/{{name}}/index.html'>{{distribusi["useremail"]}}:{{name}}</a>
{% for tag in distribusi["tags"] %}
<span class="tags">{{tag}}</span>
{% endfor%}