Leaderboard
This commit is contained in:
@@ -291,7 +291,7 @@ async function findNearestLocation() {
|
||||
let errorMessage = currentLanguage === 'de' ? 'Standort konnte nicht ermittelt werden.' : 'Location could not be determined.';
|
||||
|
||||
if (error.code) {
|
||||
switch(error.code) {
|
||||
switch (error.code) {
|
||||
case error.PERMISSION_DENIED:
|
||||
errorMessage = currentLanguage === 'de' ?
|
||||
'Standortzugriff wurde verweigert. Bitte erlaube den Standortzugriff in den Browser-Einstellungen.' :
|
||||
@@ -583,7 +583,7 @@ function updateLeaderboard(data) {
|
||||
// Event Listeners Setup
|
||||
function setupEventListeners() {
|
||||
// Location select event listener
|
||||
document.getElementById('locationSelect').addEventListener('change', function() {
|
||||
document.getElementById('locationSelect').addEventListener('change', function () {
|
||||
// Save location selection to cookie
|
||||
const selectedOption = this.options[this.selectedIndex];
|
||||
if (selectedOption.value) {
|
||||
@@ -595,7 +595,7 @@ function setupEventListeners() {
|
||||
|
||||
// Time tab event listeners
|
||||
document.querySelectorAll('.time-tab').forEach(tab => {
|
||||
tab.addEventListener('click', function() {
|
||||
tab.addEventListener('click', function () {
|
||||
// Remove active class from all tabs
|
||||
document.querySelectorAll('.time-tab').forEach(t => t.classList.remove('active'));
|
||||
// Add active class to clicked tab
|
||||
@@ -715,7 +715,7 @@ function loadLanguagePreference() {
|
||||
}
|
||||
|
||||
// Start the application when DOM is loaded
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
loadLanguagePreference();
|
||||
changeLanguage(); // Apply saved language
|
||||
init();
|
||||
@@ -724,7 +724,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
// Add cookie settings button functionality
|
||||
const cookieSettingsBtn = document.getElementById('cookie-settings-footer');
|
||||
if (cookieSettingsBtn) {
|
||||
cookieSettingsBtn.addEventListener('click', function() {
|
||||
cookieSettingsBtn.addEventListener('click', function () {
|
||||
if (window.cookieConsent) {
|
||||
window.cookieConsent.resetConsent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user