MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Gerard (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Gerard (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung Markierung: Zurückgesetzt |
||
| Zeile 1: | Zeile 1: | ||
/* Das folgende JavaScript wird für alle Benutzer geladen. */ | /* Das folgende JavaScript wird für alle Benutzer geladen. */ | ||
/ | // STOPP-ALERT (manuell schließen) | ||
document.addEventListener('DOMContentLoaded', function () { | document.addEventListener('DOMContentLoaded', function () { | ||
const | const alertBox = document.createElement('div'); | ||
alertBox.textContent = "⚠ STOPP: Common.js wurde geladen!"; | |||
alertBox.style.position = "fixed"; | |||
alertBox.style.top = "20px"; | |||
alertBox.style.left = "20px"; | |||
alertBox.style.background = "red"; | |||
alertBox.style.color = "white"; | |||
alertBox.style.padding = "15px 20px"; | |||
alertBox.style.border = "3px solid black"; | |||
alertBox.style.fontSize = "18px"; | |||
alertBox.style.fontWeight = "bold"; | |||
alertBox.style.zIndex = "999999999"; | |||
alertBox.style.cursor = "pointer"; | |||
alertBox.style.boxShadow = "0 0 10px black"; | |||
alertBox.addEventListener('click', () => { | |||
alertBox.remove(); | |||
}); | |||
document.body.appendChild(alertBox); | |||
}); | |||
// Sidebar einklappbar | // Sidebar einklappbar | ||
Version vom 24. Mai 2026, 15:25 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */
// STOPP-ALERT (manuell schließen)
document.addEventListener('DOMContentLoaded', function () {
const alertBox = document.createElement('div');
alertBox.textContent = "⚠ STOPP: Common.js wurde geladen!";
alertBox.style.position = "fixed";
alertBox.style.top = "20px";
alertBox.style.left = "20px";
alertBox.style.background = "red";
alertBox.style.color = "white";
alertBox.style.padding = "15px 20px";
alertBox.style.border = "3px solid black";
alertBox.style.fontSize = "18px";
alertBox.style.fontWeight = "bold";
alertBox.style.zIndex = "999999999";
alertBox.style.cursor = "pointer";
alertBox.style.boxShadow = "0 0 10px black";
alertBox.addEventListener('click', () => {
alertBox.remove();
});
document.body.appendChild(alertBox);
});
// Sidebar einklappbar
const portals = document.querySelectorAll('.vector-menu.mw-portlet');
portals.forEach(portal => {
const heading = portal.querySelector('.vector-menu-heading');
const content = portal.querySelector('.vector-menu-content');
if (!heading || !content) return;
if (heading.textContent.trim() === 'Navigation') return;
heading.style.cursor = 'pointer';
heading.addEventListener('click', () => {
content.classList.toggle('ts-collapsed');
});
});
}); // ← WICHTIG: Block sauber schließen
//
// Icons für Bearbeiten / Quelltext bearbeiten (Vector‑2022)
// (Dieser Hook MUSS außerhalb von DOMContentLoaded bleiben!)
//
mw.hook('wikipage.content').add(function($content) {
$content.find('.mw-editsection a').each(function() {
var $a = $(this);
var text = $a.text().trim();
$a.css({
'font-size': '0',
'display': 'inline-block',
'width': '22px',
'height': '22px',
'background-size': 'contain',
'background-repeat': 'no-repeat',
'background-position': 'center',
'vertical-align': 'middle',
'margin-left': '4px'
});
if (text === 'Bearbeiten') {
$a.css('background-image', 'url("/Wiki_BlueX/images/e/e6/EditIcon.png")');
}
if (text === 'Quelltext bearbeiten') {
$a.css('background-image', 'url("/Wiki_BlueX/images/f/f6/QEditIcon.png")');
}
});
$content.find('.mw-editsection').css('font-size', '0');
});