MediaWiki:Common.js: различия между версиями
Перейти к навигации
Перейти к поиску
Tsostik (обсуждение | вклад) Нет описания правки Метки: с мобильного устройства из мобильной версии |
Tsostik (обсуждение | вклад) Нет описания правки Метки: с мобильного устройства из мобильной версии |
||
| Строка 20: | Строка 20: | ||
}); | }); | ||
$(function () { | $(function () { | ||
if (mw.config.get('skin') !== 'minerva') { | |||
return; | return; | ||
} | } | ||
if ($('#ca-donate').length) { | if ($('#ca-donate').length) { | ||
return; | return; | ||
} | } | ||
const donate = $( | const donate = $( | ||
'< | '<li><a id="ca-donate" href="https://helpua.rubikus.de/#helpus" title="Помочь проекту">💙💛</a></li>' | ||
); | ); | ||
$('.minerva-notifications').prepend(donate); | |||
$('.minerva-notifications ul').prepend(donate); | |||
}); | }); | ||
Версия от 20:28, 7 июня 2026
/* Размещённый здесь код JavaScript будет загружаться пользователям при обращении к каждой странице */
$(function () {
const button = $('<button id="back-to-top">Наверх ↑</button>');
$('body').append(button);
button.hide();
$(window).on('scroll', function () {
if ($(window).scrollTop() > 200) {
button.fadeIn(150);
} else {
button.fadeOut(150);
}
});
button.on('click', function () {
$('html, body').animate({ scrollTop: 0 }, 250);
});
});
$(function () {
if (mw.config.get('skin') !== 'minerva') {
return;
}
if ($('#ca-donate').length) {
return;
}
const donate = $(
'<li><a id="ca-donate" href="https://helpua.rubikus.de/#helpus" title="Помочь проекту">💙💛</a></li>'
);
$('.minerva-notifications ul').prepend(donate);
});