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