Feature: Added new News date filter to the news page

This commit is contained in:
Jorit Tijsen
2025-06-30 16:40:44 +02:00
parent 34f5cfca73
commit 7f1688ee89
6 changed files with 91 additions and 24 deletions

View File

@@ -9,14 +9,16 @@
loadingElementId: '#loading',
container: '',
url: document.location.pathname,
nextPage: 2
nextPage: 2,
dateStart: null,
dateEnd:null
};
$.extend(options, _options);
var $isLoading = $(options.loadingElementId, this);
$isLoading.hide();
this.click(function (e) {
this.unbind('click').click(function (e) {
e.preventDefault();
if (!isLoading) {
// Set flag and update UI
@@ -26,7 +28,7 @@
var $container = $(options.container)
// Fire request for the next page
$.ajax({url: options.url + (options.url.indexOf('?') >= 0 ? '&' : '?') + 'pagina=' + options.nextPage})
$.ajax({url: options.url + (options.url.indexOf('?') >= 0 ? '&' : '?') + 'pagina=' + options.nextPage + (options.dateStart ? '&dateStart=' + options.dateStart : '') + (options.dateEnd ? '&dateEnd=' + options.dateEnd : '')})
.always(function () {
// Whether success or failure, update the UI again
isLoading = 0;