MediaWiki:Common.js: различия между версиями

мНет описания правки
мНет описания правки
Строка 135: Строка 135:


function updateServerInfo(serverObj, serverName) {
function updateServerInfo(serverObj, serverName) {
if (currentURL.includes("Kerisar")) {
var serverStatusFrame = document.getElementById(serverName);
var serverStatusFrame = document.getElementById(serverName);
var statusText = {
var statusText = {
Строка 170: Строка 169:
percentageDisplay.textContent = serverObj.percentage + '%'; // Устанавливаем текст с процентом
percentageDisplay.textContent = serverObj.percentage + '%'; // Устанавливаем текст с процентом
}
}
}
}
}


Строка 211: Строка 209:
}
}
$(document).ready(function() {
$(document).ready(function() {
if (currentURL.includes("Kerisar")) {
var serversStatus = document.querySelectorAll('.serversStatus');
if (serversStatus.length > 0) {
updateAllServersInfo();
updateAllServersInfo();
// Перезапускать каждую минуту (60000 мс)
// Перезапускать каждую минуту (60000 мс)
setInterval(updateAllServersInfo, 60000);
setInterval(updateAllServersInfo, 60000);
}
}
var cssEls = document.querySelectorAll('.customCSS');
var cssEls = document.querySelectorAll('.customCSS');
if (cssEls.length > 0) {
if (cssEls.length > 0) {