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

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

Страница интерфейса MediaWiki
Нет описания правки
Нет описания правки
Строка 1: Строка 1:
/* Размещённый здесь код JavaScript будет загружаться пользователям при обращении к каждой странице */
const table = document.getElementById("law");
if(mw.config.get( 'wgPageName' ) === 'test') {
if(!table) return;
    const table = document.getElementById("law");
current = null;
    current = null;
table.addEventListener("click", function (event) {
    table.addEventListener("click", function (event) {
const cell = event.target.closest("td");
    const cell = event.target.closest("td");
if (!cell) return;
    if (!cell) return;
if(current != null) document.getElementById(current).style.display = "none"
    if(current != null) document.getElementById(current).style.display = "none"
if(cell.dataset.id == current) return;
    if(cell.dataset.id == current) return;
current = cell.dataset.id
    current = cell.dataset.id
document.getElementById(current).style.display = "block"
    document.getElementById(current).style.display = "block"
});
  });
}

Версия от 19:36, 3 августа 2025

const table = document.getElementById("law");
if(!table) return;
current = null;
table.addEventListener("click", function (event) {
const cell = event.target.closest("td");
if (!cell) return;
if(current != null) document.getElementById(current).style.display = "none"
if(cell.dataset.id == current) return;
current = cell.dataset.id
document.getElementById(current).style.display = "block"
});