1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
This commit is contained in:
Daniel Neto 2023-04-20 13:18:04 -03:00
parent ce05fa5593
commit 6feeba74b3

View file

@ -9,7 +9,7 @@
<script src="$webSiteRootURLnode_modules/infinite-scroll/dist/infinite-scroll.pkgd.min.js" type="text/javascript"></script>
<script>
var $container$uid;
$(function () {
$(function() {
loadInfiniteScrool$uid();
});
/*
@ -26,6 +26,7 @@
}
});*/
var append_infiniteScroll_timout;
function loadInfiniteScrool$uid() {
if (typeof $('$infinityScrollAppendIntoSelector').infiniteScroll == 'function') {
$container$uid = $('$infinityScrollAppendIntoSelector').infiniteScroll({
@ -37,36 +38,34 @@
prefill: true,
history: false,
checkLastPage: false,
button: '#loadInfiniteScrollButton$uid'
button: '#loadInfiniteScrollButton$uid',
// Remove document.write statements
scrollThreshold: false,
loadOnScroll: false,
responseType: 'document',
});
$container$uid.on('scrollThreshold.infiniteScroll', function (event) {
//console.log('infiniteScroll Scroll at bottom');
});
$container$uid.on('request.infiniteScroll', function (event, path, fetchPromise) {
$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) {
$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`);
// Remove document.write statements
var $response = $(response);
var items = $response.find('$infinityScrollGetFromSelector').get();
$container$uid.infiniteScroll('appendItems', items, $response);
lazyImage();
avideoSocket();
});
$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) {
$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) {
$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) {
$container$uid.on('history.infiniteScroll', function(event, title, path) {
//console.log(`infiniteScroll History changed to: ${path}`);
});
}
}
</script>
</script>