1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

added top player stats

fix for some commands returning multiple matches found when target not required
This commit is contained in:
RaidMax
2018-05-28 20:30:31 -05:00
parent 045260c648
commit ebda1984fa
137 changed files with 426 additions and 41 deletions

View File

@ -67,6 +67,10 @@ a.nav-link {
border-bottom: 2px solid $primary !important;
}
.border-top {
border-top: 1px solid $primary !important;
}
#client_search {
background-color: #222222 !important;
border-radius: 0;
@ -174,3 +178,8 @@ select {
border-bottom: 1px solid $secondary;
margin-top: -3px;
}
.stats-ranking-icon {
width: 32px;
height: 32px;
}

View File

@ -0,0 +1,84 @@
let offset = 15;
let loadCount = 15;
let isLoading = false;
let loadUri = '';
let loaderResponseId = '';
function initLoader(location, loaderId) {
loadUri = location;
loaderResponseId = loaderId;
setupListeners();
}
function loadMoreItems() {
if (isLoading) {
return false;
}
showLoader();
isLoading = true;
$.get(loadUri, { offset: offset, count : loadCount })
.done(function (response) {
$(loaderResponseId).append(response);
if (response.trim().length === 0) {
staleLoader();
}
hideLoader();
isLoading = false;
})
.fail(function (jqxhr, statis, error) {
errorLoader();
isLoading = false;
});
offset += loadCount;
}
function setupListeners() {
if ($(loaderResponseId).length === 1) {
/*
https://stackoverflow.com/questions/19731730/jquery-js-detect-users-scroll-attempt-without-any-window-overflow-to-scroll
*/
$('html').bind('mousewheel DOMMouseScroll', function (e) {
var delta = (e.originalEvent.wheelDelta || -e.originalEvent.detail);
if (delta < 0 && !hasScrollBar) {
loadMoreItems();
}
});
/*
https://stackoverflow.com/questions/3898130/check-if-a-user-has-scrolled-to-the-bottom
*/
var _throttleTimer = null;
var _throttleDelay = 100;
var $window = $(window);
var $document = $(document);
var hasScrollBar = false;
$document.ready(function () {
$window
.off('scroll', ScrollHandler)
.on('scroll', ScrollHandler);
/*$('#load_penalties_button').click(function () {
loadMorePenalties();
});*/
});
function ScrollHandler(e) {
//throttle event:
hasScrollBar = true;
clearTimeout(_throttleTimer);
_throttleTimer = setTimeout(function () {
//do work
if ($window.scrollTop() + $window.height() > $document.height() - 100) {
loadMoreItems();
}
}, _throttleDelay);
}
}
}