MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus BBS Wiki
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
/* Print-Logo nur im Druck einfügen (Timeless Skin) */
/* Druck-Logo oben rechts, Timeless Skin */
(function () {
(function () {
   var logoUrl = 'https://wiki.demo.lara-cloud.de/images/flexiskin-images-logo.png';
   var logoUrl = 'https://wiki.demo.lara-cloud.de/images/flexiskin-images-logo.png';


   function insertPrintLogo() {
   function insertPrintLogo() {
    // Logo nur einmal einfügen
     if (document.getElementById('mw-printlogo')) return;
     if (document.getElementById('mw-printlogo')) return;


     var content = document.querySelector('#mw-content') || document.body;
     var body = document.body;
    if (!content) return;
 
     var img = document.createElement('img');
     var img = document.createElement('img');
     img.id = 'mw-printlogo';
     img.id = 'mw-printlogo';
Zeile 15: Zeile 12:
     img.alt = 'Logo';
     img.alt = 'Logo';


     content.insertBefore(img, content.firstChild);
     body.insertBefore(img, body.firstChild);
   }
   }


   window.addEventListener('beforeprint', insertPrintLogo);
   window.addEventListener('beforeprint', insertPrintLogo);
})();
})();

Version vom 1. Oktober 2025, 12:10 Uhr

/* Druck-Logo oben rechts, 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 body = document.body;
    var img = document.createElement('img');
    img.id = 'mw-printlogo';
    img.src = logoUrl;
    img.alt = 'Logo';

    body.insertBefore(img, body.firstChild);
  }

  window.addEventListener('beforeprint', insertPrintLogo);
})();