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. */ | ||
// Margin-Anpassung für Überschriften | |||
mw.util.addCSS('h2, h3 { margin-block-start: 0.5em; }'); | |||
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 6: | Zeile 9: | ||
const sections = document.querySelectorAll('.citizen-section'); | const sections = document.querySelectorAll('.citizen-section'); | ||
sections.forEach(function(section, index) { | sections.forEach(function(section, index) { | ||
if (index === 0) return; | if (index === 0) return; | ||
section.hidden = 'until-found'; | 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'; | |||
} | |||
}); | |||
}); | }); | ||
}); | }); | ||
Version vom 23. Mai 2026, 11:31 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */
// Margin-Anpassung für Überschriften
mw.util.addCSS('h2, h3 { margin-block-start: 0.5em; }');
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';
}
});
});
});