bug fixing
This commit is contained in:
parent
7e753fe4cb
commit
34ab7eec0f
3 changed files with 47 additions and 4 deletions
|
@ -13,7 +13,12 @@ async function loadContent(sectionId, contentFile) {
|
|||
// Find the section and update its content
|
||||
const section = document.getElementById(sectionId);
|
||||
if (section) {
|
||||
// Preserve the close button
|
||||
const closeButton = section.querySelector('.close');
|
||||
section.innerHTML = html;
|
||||
if (closeButton) {
|
||||
section.insertBefore(closeButton, section.firstChild);
|
||||
}
|
||||
console.log(`Successfully updated content for ${sectionId}`);
|
||||
} else {
|
||||
console.error(`Section element not found for ${sectionId}`);
|
||||
|
@ -29,7 +34,11 @@ async function loadContent(sectionId, contentFile) {
|
|||
// Show error message in the section
|
||||
const section = document.getElementById(sectionId);
|
||||
if (section) {
|
||||
const closeButton = section.querySelector('.close');
|
||||
section.innerHTML = `<h2 class="major">Error</h2><p>Could not load content. Please try refreshing the page.</p><p>Error details: ${error.message}</p>`;
|
||||
if (closeButton) {
|
||||
section.insertBefore(closeButton, section.firstChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,14 +46,13 @@ async function loadContent(sectionId, contentFile) {
|
|||
// Load content when the page loads
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
console.log('DOM Content Loaded - Starting content loading');
|
||||
// Map of section IDs to content files
|
||||
// Map of section IDs to content files - only for sections that need external content
|
||||
const contentMap = {
|
||||
'announce': 'announce.html',
|
||||
'date': 'date.html',
|
||||
'showmetheway': 'directions.html',
|
||||
'rsvp': 'rsvp.html',
|
||||
'campinfos': 'campinfos.html',
|
||||
'y2024': 'y2024.html'
|
||||
'campinfos': 'campinfos.html'
|
||||
};
|
||||
|
||||
// Load content for each section
|
||||
|
|
|
@ -396,4 +396,19 @@
|
|||
$main._show(location.hash.substr(1), true);
|
||||
});
|
||||
|
||||
// Add close button functionality
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Add click event listeners to all close buttons
|
||||
document.querySelectorAll('.close').forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
// Find the closest article element
|
||||
const article = button.closest('article');
|
||||
if (article) {
|
||||
// Use the existing _hide method
|
||||
$main._hide(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
22
index.html
22
index.html
|
@ -64,32 +64,38 @@
|
|||
|
||||
<!-- Announcement -->
|
||||
<article id="announce">
|
||||
<button class="close">×</button>
|
||||
<!-- Content will be loaded from announce.html -->
|
||||
</article>
|
||||
|
||||
<!-- Date -->
|
||||
<article id="date">
|
||||
<button class="close">×</button>
|
||||
<!-- Content will be loaded from date.html -->
|
||||
</article>
|
||||
|
||||
<!-- Show me the way-->
|
||||
<article id="showmetheway">
|
||||
<button class="close">×</button>
|
||||
<!-- Content will be loaded from directions.html -->
|
||||
</article>
|
||||
|
||||
<!-- RSVP -->
|
||||
<article id="rsvp">
|
||||
<button class="close">×</button>
|
||||
<!-- Content will be loaded from rsvp.html -->
|
||||
</article>
|
||||
|
||||
<!-- Camp Infos -->
|
||||
<article id="campinfos">
|
||||
<button class="close">×</button>
|
||||
<!-- Content will be loaded from campinfos.html -->
|
||||
</article>
|
||||
|
||||
<!-- TimeTable -->
|
||||
<!-- CALL FOR PAPERS/PRESENTATIONS - CHANGE LATER TO TIMETABLE -->
|
||||
<article id="timetable">
|
||||
<button class="close">×</button>
|
||||
<h2 class="major">Call for Presentation</h2>
|
||||
<p>Um den Timetable zu füllen, brauchen wir Eure Workshops, Vorträge, Aktivitäten - was Ihr schon immer gern mit anderen Menschen machen wolltet.<p>
|
||||
<p><a href="https://orga.fedi.camp/index.php/apps/forms/s/MCeqwaqH23bN4jBEaBeaAEWe" class="button enabled">Call for Participation</a></p>
|
||||
|
@ -109,7 +115,17 @@
|
|||
|
||||
<!--ARCHIVE 2024 -->
|
||||
<article id="y2024">
|
||||
<!-- Content will be loaded from y2024.html -->
|
||||
<button class="close">×</button>
|
||||
<h2 class="major">Archiv</h2>
|
||||
<h1>Berichte aus 2024</h1>
|
||||
<p><b>Berichte und Fotos des ersten FediCamp im Jahre 2022 findet Ihr <a href="#y2022">hier</a>.</b></p>
|
||||
<p><b>Berichte und Fotos des zweiten FediCamp im Jahre 2023 findet Ihr <a href="#y2023">hier</a>.</b></p>
|
||||
<p><a href="fc24-fotos/index.html" class="button">Fotos 2024</a></p>
|
||||
<p>Du warst Teilnehmende oder Teilnehmer? Dann kannst Du die Bilder (und noch mehr) auch im Original und ohne Blurring bekommen. Schreibe dazu eine Mail oder teile das im Matrix-Raum mit!</p><br>
|
||||
<h2>Das Camp 2024 - Bericht</h2>
|
||||
<p>Hier werden die Berichte und Informationen zum Fedi.Camp 2024 gesammelt.</p>
|
||||
<p>Das Fedi.Camp 2024 findet vom 23. bis 25. August 2024 statt.</p>
|
||||
<p>Weitere Informationen folgen in Kürze.</p>
|
||||
</article>
|
||||
|
||||
|
||||
|
@ -117,6 +133,7 @@
|
|||
|
||||
<!-- ARCHIVE 2023 -->
|
||||
<article id="y2023">
|
||||
<button class="close">×</button>
|
||||
<h2 class="major">Archiv</h2>
|
||||
<h1>Berichte aus 2023</h1>
|
||||
<p><b>Berichte und Fotos des ersten FediCamp im Jahre 2022 findet Ihr <a href="#y2022">hier</a>.</b></p>
|
||||
|
@ -155,6 +172,7 @@
|
|||
</article>
|
||||
|
||||
<article id="y2022">
|
||||
<button class="close">×</button>
|
||||
<h2 class="major">Archiv</h2>
|
||||
<h1>Berichte aus 2022</h1>
|
||||
<p><b>Berichte und Fotos des zweiten FediCamp im Jahre 2023 findet Ihr <a href="#y2023">hier</a>.</b></p>
|
||||
|
@ -216,6 +234,7 @@
|
|||
|
||||
<!-- Contact -->
|
||||
<article id="contact">
|
||||
<button class="close">×</button>
|
||||
<h2 class="major">Kontakt</h2>
|
||||
<p>Hier findet Ihr aktuelle Informationen. Kommt auch gern in den Matrix Raum!</p>
|
||||
<!--<p><a href="#showmetheway" class="button">Anfahrt</a></p>-->
|
||||
|
@ -224,6 +243,7 @@
|
|||
|
||||
<!-- Impressum -->
|
||||
<article id="impressum">
|
||||
<button class="close">×</button>
|
||||
<h2 class="major">Impressum/DSGVO</h2>
|
||||
<p>This website is designed and hosted by KABI.tk</p>
|
||||
<p>A commissioned production by FediCamp.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue