Merge pull request 'main' (#6) from stefan.schmidt-bilkenroth/mastowall:main into main
Reviewed-on: #6
This commit is contained in:
commit
f52d2d2c25
2 changed files with 15 additions and 5 deletions
|
@ -38,6 +38,8 @@ JSON config file:
|
||||||
|
|
||||||
- **Including Replies:** By default, replies are excluded from the wall. However, this behavior can be changed by setting includeReplies to true in the `config.json` file.
|
- **Including Replies:** By default, replies are excluded from the wall. However, this behavior can be changed by setting includeReplies to true in the `config.json` file.
|
||||||
|
|
||||||
|
- **Configurable Overlay:** By default only the MastoWall is shown. For use with large displays eg during trade shows, conferences, booths, you can enable the Carousel with enlarged display of the 10 most recent posts. Just add `nbstand=1` to the argument in the URL.
|
||||||
|
|
||||||
## Technology Stack
|
## Technology Stack
|
||||||
|
|
||||||
Mastowall is built using the following technologies:
|
Mastowall is built using the following technologies:
|
||||||
|
@ -64,7 +66,7 @@ Mastowall is built using the following technologies:
|
||||||
|
|
||||||
## Sharing via URL
|
## Sharing via URL
|
||||||
|
|
||||||
Mastowall supports URL parameters to easily share specific hashtag configurations and the Mastodon server. Simply append the desired hashtags and the server URL to the URL following this format: `?hashtags=hashtag1,hashtag2,hashtag3&server=serverUrl`
|
Mastowall supports URL parameters to easily share specific hashtag configurations and the Mastodon server. Simply append the desired hashtags and the server URL to the URL following this format: `?hashtags=hashtag1,hashtag2,hashtag3&server=serverUrl&nbstand=0`
|
||||||
|
|
||||||
Enjoy using Mastowall!
|
Enjoy using Mastowall!
|
||||||
|
|
||||||
|
|
16
script.js
16
script.js
|
@ -55,6 +55,8 @@ let duration;
|
||||||
let refresh;
|
let refresh;
|
||||||
// extra cards text
|
// extra cards text
|
||||||
let extraCards;
|
let extraCards;
|
||||||
|
// toggle Carousel
|
||||||
|
let withCarousel=false;
|
||||||
|
|
||||||
// fetchConfig fetches the configuration from the config.json file
|
// fetchConfig fetches the configuration from the config.json file
|
||||||
const fetchConfig = async function() {
|
const fetchConfig = async function() {
|
||||||
|
@ -336,6 +338,11 @@ $(document).ready(async function() {
|
||||||
const hashtagsArray = hashtags ? hashtags.split(',') : [];
|
const hashtagsArray = hashtags ? hashtags.split(',') : [];
|
||||||
const serverUrl = getUrlParameter('server') || defaultServerUrl;
|
const serverUrl = getUrlParameter('server') || defaultServerUrl;
|
||||||
|
|
||||||
|
const enableCarousel = getUrlParameter('nbstand' );
|
||||||
|
if ( enableCarousel == '1' )
|
||||||
|
withCarousel = true;
|
||||||
|
console.log("show carousel: "+withCarousel);
|
||||||
|
|
||||||
$('#hashtag-display').on('click', function() {
|
$('#hashtag-display').on('click', function() {
|
||||||
handleHashtagDisplayClick(serverUrl);
|
handleHashtagDisplayClick(serverUrl);
|
||||||
});
|
});
|
||||||
|
@ -351,13 +358,14 @@ $(document).ready(async function() {
|
||||||
$('.masonry-grid').masonry('layout');
|
$('.masonry-grid').masonry('layout');
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
updateCarousel(slides, allPosts.flat());
|
if ( withCarousel) {
|
||||||
|
updateCarousel(slides, allPosts.flat());
|
||||||
setTimeout(async function() { showCarousel(); }, duration)
|
setTimeout(async function() { showCarousel(); }, duration)
|
||||||
|
}
|
||||||
setInterval(async function() {
|
setInterval(async function() {
|
||||||
const newPosts = await Promise.all(hashtagsArray.map(hashtag => fetchPosts(serverUrl, hashtag)));
|
const newPosts = await Promise.all(hashtagsArray.map(hashtag => fetchPosts(serverUrl, hashtag)));
|
||||||
let updated = updateWall(newPosts.flat());
|
let updated = updateWall(newPosts.flat());
|
||||||
if ( updated > 0 ) {
|
if ( withCarousel && updated > 0 ) {
|
||||||
updateCarousel(slides, newPosts.flat());
|
updateCarousel(slides, newPosts.flat());
|
||||||
}
|
}
|
||||||
}, refresh);
|
}, refresh);
|
||||||
|
|
Loading…
Reference in a new issue