MediaWiki:Common.js: Różnice pomiędzy wersjami
Przejdź do nawigacji
Przejdź do wyszukiwania
Nie podano opisu zmian |
Nie podano opisu zmian |
||
| Linia 10: | Linia 10: | ||
$('#content-' + tabId).show(); | $('#content-' + tabId).show(); | ||
$(.header-tab[data-tab-id='${tabId}']).addClass('header-tab-selected').css('background', '#36393F'); | |||
} | } | ||
Wersja z 19:49, 3 lis 2025
/* Umieszczony tutaj kod JavaScript zostanie załadowany przez każdego użytkownika, podczas każdego ładowania strony. */
if (mw.config.get('wgNamespaceNumber')==6 && mw.config.get('wgAction')=='view') {
mw.loader.load('//imagemapedit.toolforge.org/ime.js');
}
$(function() {
function switchHeaderTab(tabId) {
$('.header-tab-content-wrapper').hide();
$('.header-tab').removeClass('header-tab-selected').css('background', '#40444B');
$('#content-' + tabId).show();
$(.header-tab[data-tab-id='${tabId}']).addClass('header-tab-selected').css('background', '#36393F');
}
$('.header-tab').click(function() {
const tabId = $(this).data('tab-id');
switchHeaderTab(tabId);
});
const defaultTab = $('.header-tab-content-wrapper:first').attr('id').replace('content-', '');
switchHeaderTab(defaultTab);
});