mirror of
https://github.com/quatalog/site.git
synced 2024-09-30 06:00:36 +00:00
Start working on search
This commit is contained in:
parent
a70d700549
commit
24a6b8514e
|
@ -114,7 +114,7 @@ p a:hover, p a:hover svg {
|
||||||
margin-left: 2vmin;
|
margin-left: 2vmin;
|
||||||
}
|
}
|
||||||
|
|
||||||
#header-search {
|
.header-search {
|
||||||
position: relative;
|
position: relative;
|
||||||
right: 1vmin;
|
right: 1vmin;
|
||||||
width: 12rem;
|
width: 12rem;
|
||||||
|
|
16
js/search_helper.js
Normal file
16
js/search_helper.js
Normal 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();
|
||||||
|
}*/
|
||||||
|
}
|
Loading…
Reference in a new issue