From 973a3b934234aa81706a884a121d8c5c86d9fc61 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt-Bilkenroth Date: Fri, 15 Nov 2024 11:00:13 +0100 Subject: [PATCH 1/2] update Readme including nbstand=1 argument --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0842360..a67c4d1 100644 --- a/README.md +++ b/README.md @@ -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. +- **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 Mastowall is built using the following technologies: @@ -64,7 +66,7 @@ Mastowall is built using the following technologies: ## 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! From 678e08e681d0a590f823d1c65de6bed697be823e Mon Sep 17 00:00:00 2001 From: Stefan Schmidt-Bilkenroth Date: Fri, 15 Nov 2024 11:00:44 +0100 Subject: [PATCH 2/2] implement nbstand URL argument to enable carousel --- script.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/script.js b/script.js index fa1de1b..4b55ca2 100644 --- a/script.js +++ b/script.js @@ -55,6 +55,8 @@ let duration; let refresh; // extra cards text let extraCards; +// toggle Carousel +let withCarousel=false; // fetchConfig fetches the configuration from the config.json file const fetchConfig = async function() { @@ -336,6 +338,11 @@ $(document).ready(async function() { const hashtagsArray = hashtags ? hashtags.split(',') : []; const serverUrl = getUrlParameter('server') || defaultServerUrl; + const enableCarousel = getUrlParameter('nbstand' ); + if ( enableCarousel == '1' ) + withCarousel = true; + console.log("show carousel: "+withCarousel); + $('#hashtag-display').on('click', function() { handleHashtagDisplayClick(serverUrl); }); @@ -351,13 +358,14 @@ $(document).ready(async function() { $('.masonry-grid').masonry('layout'); }, 2000); - updateCarousel(slides, allPosts.flat()); - - setTimeout(async function() { showCarousel(); }, duration) + if ( withCarousel) { + updateCarousel(slides, allPosts.flat()); + setTimeout(async function() { showCarousel(); }, duration) + } setInterval(async function() { const newPosts = await Promise.all(hashtagsArray.map(hashtag => fetchPosts(serverUrl, hashtag))); let updated = updateWall(newPosts.flat()); - if ( updated > 0 ) { + if ( withCarousel && updated > 0 ) { updateCarousel(slides, newPosts.flat()); } }, refresh);