forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
functiongetPagination.php
64 lines (62 loc) · 3.05 KB
/
functiongetPagination.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<button class="btn btn-default btn-block loadInfiniteScrollButton" id="loadInfiniteScrollButton$uid">
<div style="display: inline-flex;">
<div class="scroller-status scroller-status$uid">
<div class="infinite-scroll-request loader-ellips text-center">
<i class="fas fa-spinner fa-pulse text-muted"></i>
</div>
</div>
</div>
<i class="fas fa-angle-double-down"></i>
$loadMore
</button>
<script src="$webSiteRootURLnode_modules/infinite-scroll/dist/infinite-scroll.pkgd.min.js" type="text/javascript"></script>
<script>
var $container$uid;
$(function() {
loadInfiniteScrool$uid();
});
var append_infiniteScroll_timout;
function loadInfiniteScrool$uid() {
if (typeof $('$infinityScrollAppendIntoSelector').infiniteScroll == 'function') {
$container$uid = $('$infinityScrollAppendIntoSelector').infiniteScroll({
path: '.pagination__next$uid',
append: '$infinityScrollGetFromSelector',
status: '.scroller-status$uid',
hideNav: '.infiniteScrollPagination$uid',
debug: false,
prefill: $loadOnScroll,
history: false,
checkLastPage: false,
button: '#loadInfiniteScrollButton$uid',
loadOnScroll: $loadOnScroll
});
$container$uid.on('scrollThreshold.infiniteScroll', function(event) {
//console.log('infiniteScroll Scroll at bottom');
});
$container$uid.on('request.infiniteScroll', function(event, path, fetchPromise) {
//console.log(`infiniteScroll Loading page: ${path}`);
});
let infScroll = $container$uid.data('infiniteScroll');
$container$uid.on('load.infiniteScroll', function(event, body, path, response) {
//console.log(`infiniteScroll Loaded: ${path}`, `Status: ${response.status}`, `Current page: ${infScroll.pageIndex}`, `${infScroll.loadCount} pages loaded`);
});
$container$uid.on('append.infiniteScroll', function(event, body, path, items, response) {
//console.log(`infiniteScroll Appended ${items.length} items on ${path}`, body);
clearTimeout(append_infiniteScroll_timout);
append_infiniteScroll_timout = setTimeout(function() {
lazyImage();
avideoSocket();
}, 1000);
});
$container$uid.on('error.infiniteScroll', function(event, error, path, response) {
console.error(`infiniteScroll Could not load: ${path}. ${error}`);
});
$container$uid.on('last.infiniteScroll', function(event, body, path) {
//console.log(`infiniteScroll Last page hit on ${path}`, body, event);
});
$container$uid.on('history.infiniteScroll', function(event, title, path) {
//console.log(`infiniteScroll History changed to: ${path}`);
});
}
}
</script>