MediaWiki:Common.js

Innen: Sanctum2 Wikipédia
A lap korábbi változatát látod, amilyen Hermesz (vitalap | szerkesztései) 2024. június 24., 09:25-kor történt szerkesztése után volt.
Ugrás a navigációhozUgrás a kereséshez

Megjegyzés: közzététel után frissítened kell a böngésződ gyorsítótárát, hogy lásd a változásokat.

  • Firefox / Safari: tartsd lenyomva a Shift gombot és kattints a Frissítés gombra a címsorban, vagy használd a Ctrl–F5 vagy Ctrl–R (Macen ⌘–R) billentyűkombinációt
  • Google Chrome: használd a Ctrl–Shift–R (Macen ⌘–Shift–R) billentyűkombinációt
  • Internet Explorer / Edge: tartsd nyomva a Ctrl-t, és kattints a Frissítés gombra, vagy nyomj Ctrl–F5-öt
  • Opera: Nyomj Ctrl–F5-öt
// MediaWiki:Common.js
$(document).ready(function() {
    // Add search box with styled input
    $('table.wikitable').before('<div id="searchBox" style="margin-bottom: 10px; padding: 10px; background-color: #333; border-radius: 5px;">' +
                                '<label for="tableSearch" style="color: #fff; font-size: 1.2em; margin-right: 10px;">Keresés név alapján:</label>' +
                                '<input type="text" id="tableSearch" placeholder="Írd be a tárgy nevét..." style="padding: 5px; border-radius: 5px; border: 1px solid #72716F; color: #333;">' +
                                '</div>');

    $('#tableSearch').on('keyup', function() {
        var value = $(this).val().toLowerCase();
        $('table.wikitable tr').filter(function() {
            $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
        });
    });

    // Fix search box position
    var searchBox = $('#searchBox');
    $(window).scroll(function() {
        var offset = searchBox.offset().top - $(window).scrollTop();
        if (offset < 0) {
            searchBox.css({
                'position': 'fixed',
                'top': '0',
                'left': '0',
                'background-color': '#000',
                'color': '#fff',
                'z-index': '1000',
                'width': '100%',
                'padding': '10px',
                'border-radius': '0'
            });
        } else {
            searchBox.css({
                'position': 'static',
                'width': 'auto',
                'padding': '10px',
                'border-radius': '5px'
            });
        }
    });
});