mirror of https://github.com/kurisufriend/frontend
parent
2a255c3808
commit
9562a029c4
@ -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