MediaWiki:Common.js: Difference between revisions

From Helbreath Portal
No edit summary
No edit summary
Line 1: Line 1:
$(document).ready(function() {
$(document).ready(function() {
     if ($('#custom-top-logo').length === 0) {
     if ($('#custom-top-logo').length === 0) {
        // wstawiamy logo **po headerze** i search boxie
         var logo = $('<a>', {
         var logo = $('<a>', {
             id: 'custom-top-logo',
             id: 'custom-top-logo',
Line 7: Line 6:
             css: {
             css: {
                 display: 'block',
                 display: 'block',
                 margin: '10px auto 20px auto', // trochę odstępu od search boxa
                 margin: '20px auto', // centrowanie
                 width: '250px',
                 width: '250px',
                 height: '100px',
                 height: '100px',
Line 15: Line 14:
             }
             }
         });
         });
 
         // wstawiamy logo **po headerze**, a nie w sidebarze
         // wstawiamy logo po #p-search (search box)
         $('#mw-header-container').after(logo);
         $('#p-search').after(logo);
     }
     }
});
});

Revision as of 23:09, 18 August 2025

$(document).ready(function() {
    if ($('#custom-top-logo').length === 0) {
        var logo = $('<a>', {
            id: 'custom-top-logo',
            href: mw.util.getUrl('Main_Page'),
            css: {
                display: 'block',
                margin: '20px auto', // centrowanie
                width: '250px',
                height: '100px',
                background: 'url(/images/portallogo.png) no-repeat center',
                backgroundSize: 'contain',
                zIndex: 1000
            }
        });
        // wstawiamy logo **po headerze**, a nie w sidebarze
        $('#mw-header-container').after(logo);
    }
});