Improvements for display #1

Merged
norbert.tretkowski merged 11 commits from max.lissowski/mastowall:for-pi2 into for-pi2 2023-11-24 07:53:19 +01:00
2 changed files with 11 additions and 6 deletions
Showing only changes of commit eb85222ea3 - Show all commits

View file

@ -2,5 +2,7 @@
"navbarBrandText": "Netzbegrünung Mastowall",
"defaultServerUrl": "https://gruene.social",
"navbarColor": "#008939",
"duration": 10,
"refreshDuration": 30,
"includeReplies": true
}

View file

@ -1,12 +1,6 @@
// The existingPosts array is used to track already displayed posts
let existingPosts = [];
// below times are in milliseconds
// duration for slide animations
let duration = 5000;
// refresh rate
let refresh = 30000;
// getUrlParameter helps to fetch URL parameters
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
@ -40,6 +34,11 @@ const timeAgo = function(seconds) {
};
let includeReplies;
// below times are in milliseconds
// duration for slide animations
let duration;
// refresh rate
let refresh;
// fetchConfig fetches the configuration from the config.json file
const fetchConfig = async function() {
@ -48,12 +47,16 @@ const fetchConfig = async function() {
$('#navbar-brand').text(config.navbarBrandText);
$('.navbar').css('background-color', config.navbarColor);
includeReplies = config.includeReplies;
duration = config.duration * 1000;
refresh = config.refreshDuration * 1000;
return config.defaultServerUrl;
} catch (error) {
console.log("Error loading config.json:", error);
$('#navbar-brand').text("Netzbegrünung Mastowall");
$('.navbar').css('background-color', "#008939");
includeReplies = true;
duration = 10000;
refresh = 30000;
return "https://gruene.social";
}
}