forked from KABI/fedi.camp_Website
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
|
// Find the section and update its content
|
||||||
const section = document.getElementById(sectionId);
|
const section = document.getElementById(sectionId);
|
||||||
if (section) {
|
if (section) {
|
||||||
|
// Preserve the close button
|
||||||
|
const closeButton = section.querySelector('.close');
|
||||||
section.innerHTML = html;
|
section.innerHTML = html;
|
||||||
|
if (closeButton) {
|
||||||
|
section.insertBefore(closeButton, section.firstChild);
|
||||||
|
}
|
||||||
console.log(`Successfully updated content for ${sectionId}`);
|
console.log(`Successfully updated content for ${sectionId}`);
|
||||||
} else {
|
} else {
|
||||||
console.error(`Section element not found for ${sectionId}`);
|
console.error(`Section element not found for ${sectionId}`);
|
||||||
|
@ -29,7 +34,11 @@ async function loadContent(sectionId, contentFile) {
|
||||||
// Show error message in the section
|
// Show error message in the section
|
||||||
const section = document.getElementById(sectionId);
|
const section = document.getElementById(sectionId);
|
||||||
if (section) {
|
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>`;
|
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
|
// Load content when the page loads
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
console.log('DOM Content Loaded - Starting content loading');
|
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 = {
|
const contentMap = {
|
||||||
'announce': 'announce.html',
|
'announce': 'announce.html',
|
||||||
'date': 'date.html',
|
'date': 'date.html',
|
||||||
'showmetheway': 'directions.html',
|
'showmetheway': 'directions.html',
|
||||||
'rsvp': 'rsvp.html',
|
'rsvp': 'rsvp.html',
|
||||||
'campinfos': 'campinfos.html',
|
'campinfos': 'campinfos.html'
|
||||||
'y2024': 'y2024.html'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Load content for each section
|
// Load content for each section
|
||||||
|
|
|
@ -396,4 +396,19 @@
|
||||||
$main._show(location.hash.substr(1), true);
|
$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);
|
})(jQuery);
|
22
index.html
22
index.html
|
@ -64,32 +64,38 @@
|
||||||
|
|
||||||
<!-- Announcement -->
|
<!-- Announcement -->
|
||||||
<article id="announce">
|
<article id="announce">
|
||||||
|
<button class="close">×</button>
|
||||||
<!-- Content will be loaded from announce.html -->
|
<!-- Content will be loaded from announce.html -->
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<!-- Date -->
|
<!-- Date -->
|
||||||
<article id="date">
|
<article id="date">
|
||||||
|
<button class="close">×</button>
|
||||||
<!-- Content will be loaded from date.html -->
|
<!-- Content will be loaded from date.html -->
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<!-- Show me the way-->
|
<!-- Show me the way-->
|
||||||
<article id="showmetheway">
|
<article id="showmetheway">
|
||||||
|
<button class="close">×</button>
|
||||||
<!-- Content will be loaded from directions.html -->
|
<!-- Content will be loaded from directions.html -->
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<!-- RSVP -->
|
<!-- RSVP -->
|
||||||
<article id="rsvp">
|
<article id="rsvp">
|
||||||
|
<button class="close">×</button>
|
||||||
<!-- Content will be loaded from rsvp.html -->
|
<!-- Content will be loaded from rsvp.html -->
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<!-- Camp Infos -->
|
<!-- Camp Infos -->
|
||||||
<article id="campinfos">
|
<article id="campinfos">
|
||||||
|
<button class="close">×</button>
|
||||||
<!-- Content will be loaded from campinfos.html -->
|
<!-- Content will be loaded from campinfos.html -->
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<!-- TimeTable -->
|
<!-- TimeTable -->
|
||||||
<!-- CALL FOR PAPERS/PRESENTATIONS - CHANGE LATER TO TIMETABLE -->
|
<!-- CALL FOR PAPERS/PRESENTATIONS - CHANGE LATER TO TIMETABLE -->
|
||||||
<article id="timetable">
|
<article id="timetable">
|
||||||
|
<button class="close">×</button>
|
||||||
<h2 class="major">Call for Presentation</h2>
|
<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>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>
|
<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 -->
|
<!--ARCHIVE 2024 -->
|
||||||
<article id="y2024">
|
<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>
|
</article>
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,6 +133,7 @@
|
||||||
|
|
||||||
<!-- ARCHIVE 2023 -->
|
<!-- ARCHIVE 2023 -->
|
||||||
<article id="y2023">
|
<article id="y2023">
|
||||||
|
<button class="close">×</button>
|
||||||
<h2 class="major">Archiv</h2>
|
<h2 class="major">Archiv</h2>
|
||||||
<h1>Berichte aus 2023</h1>
|
<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>
|
<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>
|
||||||
|
|
||||||
<article id="y2022">
|
<article id="y2022">
|
||||||
|
<button class="close">×</button>
|
||||||
<h2 class="major">Archiv</h2>
|
<h2 class="major">Archiv</h2>
|
||||||
<h1>Berichte aus 2022</h1>
|
<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>
|
<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 -->
|
<!-- Contact -->
|
||||||
<article id="contact">
|
<article id="contact">
|
||||||
|
<button class="close">×</button>
|
||||||
<h2 class="major">Kontakt</h2>
|
<h2 class="major">Kontakt</h2>
|
||||||
<p>Hier findet Ihr aktuelle Informationen. Kommt auch gern in den Matrix Raum!</p>
|
<p>Hier findet Ihr aktuelle Informationen. Kommt auch gern in den Matrix Raum!</p>
|
||||||
<!--<p><a href="#showmetheway" class="button">Anfahrt</a></p>-->
|
<!--<p><a href="#showmetheway" class="button">Anfahrt</a></p>-->
|
||||||
|
@ -224,6 +243,7 @@
|
||||||
|
|
||||||
<!-- Impressum -->
|
<!-- Impressum -->
|
||||||
<article id="impressum">
|
<article id="impressum">
|
||||||
|
<button class="close">×</button>
|
||||||
<h2 class="major">Impressum/DSGVO</h2>
|
<h2 class="major">Impressum/DSGVO</h2>
|
||||||
<p>This website is designed and hosted by KABI.tk</p>
|
<p>This website is designed and hosted by KABI.tk</p>
|
||||||
<p>A commissioned production by FediCamp.</p>
|
<p>A commissioned production by FediCamp.</p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue