mirror of https://github.com/kurisufriend/frontend
parent
b2ace9d1dd
commit
929dc38c9b
@ -1,22 +0,0 @@ |
||||
// -------------------------------------------------------------
|
||||
// Search bar function
|
||||
// -------------------------------------------------------------
|
||||
|
||||
function search_bar() { |
||||
var query = document.querySelector("#header #search_bar").value; |
||||
if(query != ""){ |
||||
query = query.toLowerCase().replaceAll(" ", "+"); |
||||
var url = "https://amangathing.ddns.net/search.html?title=" + query; |
||||
console.log(query); |
||||
window.location.href = url; |
||||
} |
||||
} |
||||
|
||||
document.querySelector("#header #search_bar").addEventListener("keydown", function (e) { |
||||
e = e || window.event; |
||||
if(e.keyCode == 13){ |
||||
search_bar(); |
||||
e.preventDefault(); |
||||
} |
||||
}); |
||||
|
Loading…
Reference in new issue