Merge pull request 'script.js aktualisiert' (#7) from paulusr1/mastowall:main into main

Reviewed-on: #7
Reviewed-by: Norbert Tretkowski <norbert@tretkowski.de>
This commit is contained in:
Norbert Tretkowski 2024-11-15 19:05:09 +01:00
commit 02fb2c023f

View file

@ -244,6 +244,7 @@ const updateCarousel = function(slides, posts) {
const showCarousel = function() {
// show popover
document.getElementById('popover').style.opacity = '1';
document.getElementById('popover').style.display = 'block';
// Activate Carousel
$('#myCarousel').carousel("cycle");
}
@ -254,8 +255,8 @@ const strip = function(html) {
}
const hideCarousel = function() {
// show popover
document.getElementById('popover').style.opacity = '0';
// hide popover
document.getElementById('popover').style.display = 'none';
// Activate Carousel
}
@ -360,8 +361,9 @@ $(document).ready(async function() {
if ( withCarousel) {
updateCarousel(slides, allPosts.flat());
setTimeout(async function() { showCarousel(); }, duration)
setTimeout(async function() { showCarousel(); }, duration);
}
else setTimeout(async function() { hideCarousel(); }, duration);
setInterval(async function() {
const newPosts = await Promise.all(hashtagsArray.map(hashtag => fetchPosts(serverUrl, hashtag)));
let updated = updateWall(newPosts.flat());