MediaWiki:Common.js: Porovnání verzí

Z TEST Wiki
Ofara (diskuse | příspěvky)
Bez shrnutí editace
značka: revertováno
Ofara (diskuse | příspěvky)
Bez shrnutí editace
 
(Není zobrazeno 8 mezilehlých verzí od stejného uživatele.)
Řádek 1: Řádek 1:
/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky */
/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky */
$(document).ready(function() {
    var searchForm = $("#searchform");
    if (searchForm.length > 0) {
        var searchInput = searchForm.find("input[name='search']");
        if (searchInput.length > 0) {
            var currentAction = searchForm.attr("action");


$( function () {
            // Přepíšeme `profile=default` na `profile=all`
var elems = document.getElementsByClassName('mw-headline'); // *** NOTE: ClassName may need to be 'mw-editsection' instead
            var newAction = currentAction.replace("profile=default", "profile=all");
for (i = 0; i < elems.length; i++) {
            searchForm.attr("action", newAction);
var span = document.createElement('span');
        }
var link = document.createElement('a');
    }
link.href = '#top';
link.appendChild(document.createTextNode('Zpět nahoru'));
span.appendChild(document.createTextNode('['));
span.appendChild(link);
span.appendChild(document.createTextNode('] '));
elems[i].insertBefore(span, elems[i].firstChild);
}
});
});

Aktuální verze z 5. 2. 2025, 13:43

/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky */
$(document).ready(function() {
    var searchForm = $("#searchform");
    if (searchForm.length > 0) {
        var searchInput = searchForm.find("input[name='search']");
        if (searchInput.length > 0) {
            var currentAction = searchForm.attr("action");

            // Přepíšeme `profile=default` na `profile=all`
            var newAction = currentAction.replace("profile=default", "profile=all");
            searchForm.attr("action", newAction);
        }
    }
});