MediaWiki:Vector.js: различия между версиями
Aylong (обсуждение | вклад) Нет описания правки Метка: ручная отмена |
Aylong (обсуждение | вклад) Нет описания правки Метка: отменено |
||
| Строка 1: | Строка 1: | ||
$(document).ready(function() { | |||
$('a').click(function(event) { | |||
event.preventDefault(); | |||
var href = $(this).attr('href'); | |||
setTimeout(function() { | |||
window.location.href = href; | |||
}, 5000); | |||
}); | |||
}); | |||
$(document).ready(function() { | $(document).ready(function() { | ||
var button = document.createElement("button"); | var button = document.createElement("button"); | ||
Версия от 17:28, 4 мая 2024
$(document).ready(function() {
$('a').click(function(event) {
event.preventDefault();
var href = $(this).attr('href');
setTimeout(function() {
window.location.href = href;
}, 5000);
});
});
$(document).ready(function() {
var button = document.createElement("button");
button.innerHTML = "Сменить тему";
button.className = "theme-button";
button.onclick = toggleTheme;
var container = document.getElementById("p-personal");
if (container) {
container.parentNode.insertBefore(button, container);
}
var isLightTheme = localStorage.getItem("isLightTheme");
if (isLightTheme === "true") {
document.documentElement.classList.add('light');
} else {
document.documentElement.classList.remove('light');
}
});
function toggleTheme() {
var isLightTheme = document.documentElement.classList.toggle('light');
localStorage.setItem("isLightTheme", isLightTheme);
}