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
značka: ruční vrácení zpět
Řádek 12: Řádek 12:
         }
         }
     }
     }
});
mw.loader.using(['jquery'], function () {
  $(function () {
    function styleAFTButtons() {
      const $buttons = $('.articleFeedbackv5 .articleFeedbackv5-button-placeholder.ui-button');
      if ($buttons.length === 0) {
        // Tlačítka ještě nejsou vykreslena, zkus to znovu za 250ms
        setTimeout(styleAFTButtons, 250);
        return;
      }
      // Jsou na stránce – přepiš styly
      $buttons.css({
        'background-color': '#0052cc',
        'color': '#ffffff',
        'font-weight': 'bold',
        'border': 'none',
        'border-radius': '4px',
        'padding': '8px 16px',
        'box-shadow': '0 2px 4px rgba(0, 0, 0, 0.1)',
        'text-decoration': 'none'
      });
      // Hover efekt (simulovaný)
      $buttons.on('mouseenter', function () {
        $(this).css('background-color', '#003d99');
      }).on('mouseleave', function () {
        $(this).css('background-color', '#0052cc');
      });
    }
    // Spustíme čekací funkci
    styleAFTButtons();
  });
});
});

Verze z 9. 6. 2025, 09:58

/* 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);
        }
    }
});