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 5 mezilehlých verzí od stejného uživatele.)
Řádek 14: Řádek 14:
});
});


 
$(function () {
mw.loader.using(['jquery'], function () {
   // Zruš jQuery UI vzhled tlačítka
   $(function () {
  $('.articleFeedbackv5-submit').button('destroy');
    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();
  });
});
});

Aktuální verze z 9. 6. 2025, 11:31

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

$(function () {
  // Zruš jQuery UI vzhled tlačítka
  $('.articleFeedbackv5-submit').button('destroy');
});