Открыть меню
Переключить меню настроек
Открыть персональное меню
Вы не представились системе
Ваш IP-адрес будет виден всем, если вы внесёте какие-либо изменения.

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

Страница интерфейса MediaWiki
Нет описания правки
Нет описания правки
Строка 1: Строка 1:
const pageName = mw.config.get("wgPageName");
const pageName = mw.config.get("wgPageName");
document.querySelectorAll(".server-hook").forEach(function(element) {
        var ip = element.getAttribute("data-ip");
        var port = element.getAttribute("data-port");
        var url = "https://wiki.ss13-bluemoon.ru/nodeapi/status?ip="+encodeURIComponent(ip)+"&port="+encodeURIComponent(port);
        fetch(url)
            .then(function(response) {
                    if (!response.ok) {
                        throw new Error(response.status);
                    }
                    return response.json();
            })
            .then(function(data) {
                element.textContent = data.response.players;
            })
            .catch(function(error) {
                element.textContent = "⨉";
            });
  });
if (pageName == "Заглавная_страница") {
  document.documentElement.classList.replace('skin-theme-clientpref-day', 'skin-theme-clientpref-night');
}


if (pageName != "Шаблон:Таблица_Космический_Закон") {
if (pageName != "Шаблон:Таблица_Космический_Закон") {
Строка 78: Строка 102:
     isJopa = true;
     isJopa = true;
   });
   });
}
document.querySelectorAll(".server-hook").forEach(function(element) {
        var ip = element.getAttribute("data-ip");
        var port = element.getAttribute("data-port");
        var url = "https://wiki.ss13-bluemoon.ru/nodeapi/status?ip="+encodeURIComponent(ip)+"&port="+encodeURIComponent(port);
        fetch(url)
            .then(function(response) {
                    if (!response.ok) {
                        throw new Error(response.status);
                    }
                    return response.json();
            })
            .then(function(data) {
                element.textContent = data.response.players;
            })
            .catch(function(error) {
                element.textContent = "⨉";
            });
  });
if (pageName == "Заглавная_страница") {
  document.documentElement.classList.replace('skin-theme-clientpref-day', 'skin-theme-clientpref-night');
}
}