MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus BBS Wiki
Die Seite wurde neu angelegt: „Print-Logo für Timeless-Skin: (function () { var logoUrl = 'https://wiki.demo.lara-cloud.de/images/flexiskin-images-logo.png'; function insertPrintLogo() { if (document.getElementById('mw-printlogo')) return; var content = document.querySelector('#mw-content') || document.body; if (!content) return; var img = document.createElement('img'); img.id = 'mw-printlogo'; img.src = logoUrl; img.alt = 'Logo'; img.style.m…“
(kein Unterschied)

Version vom 1. Oktober 2025, 11:52 Uhr

/* Print-Logo für Timeless-Skin */
(function () {
  var logoUrl = 'https://wiki.demo.lara-cloud.de/images/flexiskin-images-logo.png';

  function insertPrintLogo() {
    if (document.getElementById('mw-printlogo')) return;
    var content = document.querySelector('#mw-content') || document.body;
    if (!content) return;

    var img = document.createElement('img');
    img.id = 'mw-printlogo';
    img.src = logoUrl;
    img.alt = 'Logo';
    img.style.maxHeight = '80px';
    img.style.marginBottom = '10px';

    // Logo ganz oben im Content einfügen
    content.insertBefore(img, content.firstChild);
  }

  // direkt einfügen und zusätzlich bei "beforeprint"
  insertPrintLogo();
  window.addEventListener('beforeprint', insertPrintLogo);
})();