2015-04-12 19:27:48 +02:00
|
|
|
$(document).ready(function() {
|
2015-05-27 22:43:49 +02:00
|
|
|
if($('#q').length) {
|
2015-04-12 19:27:48 +02:00
|
|
|
$('#categories label').click(function(e) {
|
|
|
|
$('#categories input[type="checkbox"]').each(function(i, checkbox) {
|
|
|
|
$(checkbox).prop('checked', false);
|
|
|
|
});
|
2016-07-17 19:03:42 +02:00
|
|
|
$(document.getElementById($(this).attr("for"))).prop('checked', true);
|
2015-05-27 23:26:24 +02:00
|
|
|
if($('#q').val()) {
|
2020-06-16 23:00:46 +02:00
|
|
|
if (getHttpRequest() == "GET") {
|
|
|
|
$('#search_form').attr('action', $('#search_form').serialize());
|
|
|
|
}
|
2015-05-27 23:26:24 +02:00
|
|
|
$('#search_form').submit();
|
|
|
|
}
|
2015-04-12 19:27:48 +02:00
|
|
|
return false;
|
|
|
|
});
|
2017-11-30 22:33:54 +01:00
|
|
|
$('#time-range').change(function(e) {
|
2016-07-25 23:40:31 +02:00
|
|
|
if($('#q').val()) {
|
2020-06-16 23:00:46 +02:00
|
|
|
if (getHttpRequest() == "GET") {
|
|
|
|
$('#search_form').attr('action', $('#search_form').serialize());
|
|
|
|
}
|
2016-07-25 23:40:31 +02:00
|
|
|
$('#search_form').submit();
|
|
|
|
}
|
|
|
|
});
|
2016-09-20 22:19:02 +02:00
|
|
|
$('#language').change(function(e) {
|
|
|
|
if($('#q').val()) {
|
2020-06-16 23:00:46 +02:00
|
|
|
if (getHttpRequest() == "GET") {
|
|
|
|
$('#search_form').attr('action', $('#search_form').serialize());
|
|
|
|
}
|
2016-09-20 22:19:02 +02:00
|
|
|
$('#search_form').submit();
|
|
|
|
}
|
|
|
|
});
|
2015-04-12 19:27:48 +02:00
|
|
|
}
|
|
|
|
});
|
2020-06-16 23:00:46 +02:00
|
|
|
|
|
|
|
function getHttpRequest() {
|
|
|
|
httpRequest = "POST";
|
|
|
|
urlParams = new URLSearchParams(window.location.search);
|
|
|
|
if (urlParams.has('method')) {
|
|
|
|
httpRequest = urlParams.get('method');
|
|
|
|
}
|
|
|
|
return httpRequest;
|
|
|
|
}
|