MediaWiki:Common.js: различия между версиями
Kerisar (обсуждение | вклад) мНет описания правки |
Kerisar (обсуждение | вклад) мНет описания правки |
||
| Строка 135: | Строка 135: | ||
function updateServerInfo(serverObj, serverName) { | function updateServerInfo(serverObj, serverName) { | ||
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 ( | 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) { | ||