MediaWiki:Mobile.js: Difference between revisions

From Formula One Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the mobile site */
/* All JavaScript here will be loaded for users of the mobile site */


mw.loader.using( 'mediawiki.util' ).then( function () {
mw.loader.using('mediawiki.util').then(function () {
    var header = document.querySelector('.minerva-header .branding-box');
  var header = document.querySelector('.minerva-header .branding-box');
    if (header) {
  if (header) {
        var img = document.createElement('img');
    var img = document.createElement('img');
        img.style.height = '100px'; // Or larger if you like
    img.src = '/w/images/FormulaOneLogo.svg'; // Replace with your correct path
        img.style.verticalAlign = 'middle';
    img.alt = 'Formula One Wiki';
        img.style.display = 'block';
    img.style.width = '120px'; // You can use %, em, or px
        header.innerHTML = '';
    img.style.height = 'auto'; // Maintain aspect ratio
        header.appendChild(img);
    img.style.display = 'block';
    }
    img.style.margin = '0 auto';
    header.innerHTML = '';
    header.appendChild(img);
  }
});
});

Revision as of 09:10, 5 August 2025

/* All JavaScript here will be loaded for users of the mobile site */

mw.loader.using('mediawiki.util').then(function () {
  var header = document.querySelector('.minerva-header .branding-box');
  if (header) {
    var img = document.createElement('img');
    img.src = '/w/images/FormulaOneLogo.svg'; // Replace with your correct path
    img.alt = 'Formula One Wiki';
    img.style.width = '120px'; // You can use %, em, or px
    img.style.height = 'auto'; // Maintain aspect ratio
    img.style.display = 'block';
    img.style.margin = '0 auto';
    header.innerHTML = '';
    header.appendChild(img);
  }
});