for-pi2 #2

Merged
norbert.tretkowski merged 29 commits from for-pi2 into main 2023-11-24 07:54:19 +01:00
Showing only changes of commit 1f6d85a072 - Show all commits

View file

@ -125,7 +125,7 @@ const updateCarousel = function(slides, posts) {
` `
for( let i = 0; i < posts.length; i++ ) { for( let i = 0; i < posts.length; i++ ) {
let post = posts[i]; let post = posts[i];
console.log( post.content ) /*console.log( post.content )*/
if ( i == 0 ) { if ( i == 0 ) {
newHTML += `<div class="carousel-item active" data-mdb-interval="${duration}" >`; newHTML += `<div class="carousel-item active" data-mdb-interval="${duration}" >`;
} }
@ -139,12 +139,18 @@ const updateCarousel = function(slides, posts) {
<p class="avatar-name">${DOMPurify.sanitize(post.account.display_name)}</p> <p class="avatar-name">${DOMPurify.sanitize(post.account.display_name)}</p>
</div> </div>
<hr> <hr>
<div class="row align-items-center"> <div class="row align-items-center vertical-align-center">
${post.media_attachments[0] ? `<div class="col-md-6"><p class="card-text">${DOMPurify.sanitize(post.content)}</p></div>` : `<div class="col-md-12"><p class="card-text">${DOMPurify.sanitize(post.content)}</p></div>`} ${post.media_attachments[0] ? `<div class="col-md-6"><p class="card-text">${DOMPurify.sanitize(post.content)}</p></div>` : `<div class="col-md-12"><p class="card-text">${DOMPurify.sanitize(post.content)}</p></div>`}
${post.media_attachments[0] ? `<div class="col-md-6"><img src="${post.media_attachments[0].url}" class="card-img-bottom" align="center"> </div>` : ''} ${post.media_attachments[0] ? `<div class="col-md-6"><img src="${post.media_attachments[0].url}" class="card-img-bottom" align="center"> </div>` : ''}
</div> </div>
<hr> <hr>
<p class="card-text text-right"><small class="text-muted"><a href="${post.url}" target="_blank" data-time="${post.created_at}">${timeAgo(secondsAgo(new Date(post.created_at)))}</a>, <b>${post.favourites_count}</b> favorisiert, <b>${post.replies_count}</b> Antworten, <b>${post.reblogs_count}</b> geteilt</small></p> <p class="card-text text-right">
<small class="text-muted"><a href="${post.url}" target="_blank" data-time="${post.created_at}">${timeAgo(secondsAgo(new Date(post.created_at)))}</a>
${post.favourites_count ? `, <b>${post.favourites_count}</b> mal favorisiert` : '' }
${post.replies_count ? `, <b>${post.replies_count}</b> Antworten` : '' }
${post.reblogs_count ? `, <b>${post.reblogs_count}</b> mal geteilt` : '' }
</small>
</p>
</div> </div>
`; `;
newHTML += '</div>'; newHTML += '</div>';