Start working on search

This commit is contained in:
3eef8a28f26fb2bcc514e6f1938929a1f931762 2023-02-10 15:50:06 -05:00 committed by powe97
parent 017dad7143
commit a34a9d923d
2 changed files with 17 additions and 1 deletions

View File

@ -114,7 +114,7 @@ p a:hover, p a:hover svg {
margin-left: 2vmin;
}
#header-search {
.header-search {
position: relative;
right: 1vmin;
width: 12rem;

16
js/search_helper.js Normal file
View File

@ -0,0 +1,16 @@
const search_helper = function() {
const input = document.getElementById("search").value;
console.log(input);
/*
const courseCodeInput = elem.value.replace(" ", "").replace("-", "");
const subCode = courseCodeInput.substring(0,4).toUpperCase();
const courseNum = courseCodeInput.substring(courseCodeInput.length-4,courseCodeInput.length);
if(`${subCode}-${courseNum}` in catalog){
// course exists
window.location.href = "./coursedisplay.html?course="+subCode+"-"+courseNum;
} else {
// course doesn't exist
window.location.href = "./search.html?search="+encodeURIComponent(elem.value);
showSearchResults();
}*/
}