Weitere Optionen
Admin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Admin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
/* Das folgende JavaScript wird für alle Benutzer geladen. */ | /* Das folgende JavaScript wird für alle Benutzer geladen. */ | ||
mw.hook('wikipage.content').add(function($content) { | mw.hook('wikipage.content').add(function($content) { | ||
const headings = document.querySelectorAll('.citizen-section-heading'); | const headings = document.querySelectorAll('.citizen-section-heading'); | ||
| Zeile 23: | Zeile 20: | ||
}); | }); | ||
}); | }); | ||
}) | }) | ||
Version vom 23. Mai 2026, 11:33 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */
mw.hook('wikipage.content').add(function($content) {
const headings = document.querySelectorAll('.citizen-section-heading');
if (headings.length === 0) return;
const sections = document.querySelectorAll('.citizen-section');
sections.forEach(function(section, index) {
if (index === 0) return;
section.hidden = 'until-found';
});
// Klick-Handler für <center>-Seiten neu registrieren
document.querySelectorAll('.citizen-section-heading').forEach(function(heading) {
heading.addEventListener('click', function(e) {
if (e.target.closest('.mw-editsection, .mw-editsection-like')) return;
const section = heading.nextElementSibling;
if (section && section.classList.contains('citizen-section')) {
section.hidden = section.hidden ? false : 'until-found';
}
});
});
})