MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
Line 47: Line 47:
mw.loader.using('jquery', function () {
mw.loader.using('jquery', function () {
     $(function () {
     $(function () {
         // Only add if it doesn't exist
         // Create the promo banner HTML
        if (!$('#promo-banner').length) {
        var promo = $('<div id="promo-banner">🚀 Need SEO Services? <a href="/wiki/SEO_Services" target="_blank">Click here to learn more</a></div>');
            var promo = $('<div id="promo-banner">🚀 Need SEO Services? <a href="/wiki/SEO_Services" target="_blank">Click here to learn more</a></div>');
 
           
        // Insert into Vector 2022 header area
            // Place the banner right under the header search bar
        var headerArea = $('.vector-header-container');
            $('#siteSub').before(promo);
        if (headerArea.length) {
            headerArea.after(promo); // place right under header
         }
         }
     });
     });
});
});