MediaWiki:Common.js: Difference between revisions

From Helbreath Portal
(Created page with "// Auto-insert logo centralnie nad stroną $(document).ready(function() { // sprawdź, czy logo już istnieje if ($('#mw-logo').length === 0) { var logo = $('<a>', { id: 'mw-logo', href: mw.util.getUrl('Main_Page'), css: { display: 'block', margin: '20px auto', width: '150px', height: '50px', background: 'url(/images/portallogo.png) no-repea...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
// Auto-insert logo centralnie nad stroną
$(document).ready(function() {
$(document).ready(function() {
    // sprawdź, czy logo już istnieje
     if ($('#custom-top-logo').length === 0) {
     if ($('#mw-logo').length === 0) {
         var logo = $('<a>', {
         var logo = $('<a>', {
             id: 'mw-logo',
             id: 'custom-top-logo',
             href: mw.util.getUrl('Main_Page'),
             href: mw.util.getUrl('Main_Page'),
             css: {
             css: {
                 display: 'block',
                 display: 'block',
                 margin: '20px auto',
                 margin: '20px auto', // centrowanie
                 width: '150px',
                 width: '450px',
                 height: '50px',
                 height: '250px',
                 background: 'url(/images/portallogo.png) no-repeat center',
                 background: 'url(/images/portallogo.png) no-repeat center',
                 backgroundSize: 'contain',
                 backgroundSize: 'contain',
Line 16: Line 14:
             }
             }
         });
         });
         // wstaw logo na początek headera
         // wstawiamy logo **po headerze**, a nie w sidebarze
         $('#mw-header').prepend(logo);
         $('#mw-header-container').after(logo);
     }
     }
});
});

Latest revision as of 23:19, 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: '450px',
                height: '250px',
                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);
    }
});