MediaWiki:Common.js

Z TEST Wiki

Poznámka: Po zveřejnění musíte vyprázdnit cache vašeho prohlížeče, jinak změny neuvidíte.

  • Firefox / Safari: Při kliknutí na Aktualizovat držte Shift nebo stiskněte Ctrl-F5 nebo Ctrl-R (na Macu ⌘-R)
  • Google Chrome: Stiskněte Ctrl-Shift-R (na Macu ⌘-Shift-R)
  • Edge: Při kliknutí na Aktualizovat držte Ctrl nebo stiskněte Ctrl-F5.
/* 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);
        }
    }
});


mw.loader.using(['jquery'], function () {
  $(function () {
    function restoreButtons(retries = 10) {
      const $buttons = $('.articleFeedbackv5-button-placeholder.ui-button');

      if ($buttons.length === 0 && retries > 0) {
        setTimeout(() => restoreButtons(retries - 1), 300);
        return;
      }

      $buttons.each(function () {
        const $btn = $(this);
        $btn.removeClass('ui-state-disabled');
        $btn.attr('aria-disabled', 'false');
        $btn.css({
          'opacity': '1',
          'pointer-events': 'auto',
          'filter': 'none',
          'background-color': '#0052cc',
          'color': '#ffffff',
          'border': 'none',
          'cursor': 'pointer'
        });

        // Změna textového <span>
        $btn.find('.ui-button-text').css({
          'color': '#ffffff',
          'opacity': '1'
        });
      });
    }

    restoreButtons();
  });
});