This commit is contained in:
2019-03-04 15:18:48 +01:00
parent 731a494eb4
commit 2d506a0095
27 changed files with 431 additions and 1547 deletions

View File

@ -95,3 +95,17 @@ if(document.querySelector(".addTag") != null) {
document.querySelector(".addTag").addEventListener("click", addTag);
document.querySelector(".submitPost").addEventListener("click", submit);
}
document.querySelector("#search + a").addEventListener("click", function() {
window.location = window.location.pathname + "?term=" + document.querySelector("#search").value;
});
document.querySelectorAll(".int-search .filtre").forEach(function(el) {
el.addEventListener("click", function() {
var tagW = new URL(window.location).searchParams.get("tag");
var tag = (tagW != null ? "&tag=" + tagW : "");
var termW = new URL(window.location).searchParams.get("term");
var term = (termW != null ? "&term=" + termW : "");
window.location = window.location.pathname + "?category=" + this.getAttribute("data-category") + tag + term;
})
})