QOL updates for profile meta
implement filterable meta for issue #158 update translations and use humanizer lib with datetime/timespan for issue #80
This commit is contained in:
@ -5,12 +5,14 @@ let startAt = null;
|
||||
let isLoaderLoading = false;
|
||||
let loadUri = '';
|
||||
let loaderResponseId = '';
|
||||
let additionalParams = [];
|
||||
|
||||
function initLoader(location, loaderId, count = 10, start = count) {
|
||||
function initLoader(location, loaderId, count = 10, start = count, additional) {
|
||||
loadUri = location;
|
||||
loaderResponseId = loaderId;
|
||||
loadCount = count;
|
||||
loaderOffset = start;
|
||||
additionalParams = additional;
|
||||
setupListeners();
|
||||
}
|
||||
|
||||
@ -21,7 +23,13 @@ function loadMoreItems() {
|
||||
|
||||
showLoader();
|
||||
isLoaderLoading = true;
|
||||
$.get(loadUri, { offset: loaderOffset, count: loadCount, startAt: startAt })
|
||||
let params = { offset: loaderOffset, count: loadCount, startAt: startAt };
|
||||
for (i = 0; i < additionalParams.length; i++) {
|
||||
let param = additionalParams[i];
|
||||
params[param.name] = param.value;
|
||||
}
|
||||
|
||||
$.get(loadUri, params)
|
||||
.done(function (response) {
|
||||
$(loaderResponseId).append(response);
|
||||
if (response.trim().length === 0) {
|
||||
|
@ -11,7 +11,15 @@
|
||||
});
|
||||
|
||||
/* set the end time for initial event query */
|
||||
startAt = $('#profile_events').children().last().data('time');
|
||||
startAt = $('.loader-data-time').last().data('time');
|
||||
|
||||
|
||||
$('#filter_meta_container_button').click(function () {
|
||||
$('#filter_meta_container').hide();
|
||||
$('#filter_meta_container').removeClass('d-none');
|
||||
$('#filter_meta_container').addClass('d-block');
|
||||
$('#filter_meta_container').slideDown();
|
||||
});
|
||||
|
||||
/*
|
||||
* load context of chat
|
||||
@ -20,6 +28,14 @@
|
||||
$(document).on('click', '.client-message', function (e) {
|
||||
showLoader();
|
||||
const location = $(this);
|
||||
$('.client-message-prefix').removeClass('oi-chevron-bottom');
|
||||
$('.client-message-prefix').removeClass('oi-chevron-right');
|
||||
|
||||
$('.client-message-prefix').addClass('oi-chevron-right');
|
||||
|
||||
$(this).children().filter('.client-message-prefix').removeClass('oi-chevron-right');
|
||||
$(this).children().filter('.client-message-prefix').addClass('oi-chevron-bottom');
|
||||
|
||||
$.get('/Stats/GetMessageAsync', {
|
||||
'serverId': $(this).data('serverid'),
|
||||
'when': $(this).data('when')
|
||||
|
Reference in New Issue
Block a user