MediaWiki:Common.js: Porovnání verzí
Z TEST Wiki
Bez shrnutí editace značka: ruční vrácení zpět |
Bez shrnutí editace značka: revertováno |
||
| Řádek 12: | Řádek 12: | ||
} | } | ||
} | } | ||
}); | |||
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(); | |||
}); | |||
}); | }); | ||
Verze z 9. 6. 2025, 10:52
/* 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();
});
});