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

Страница интерфейса MediaWiki
Нет описания правки
(Полностью удалено содержимое страницы)
Метки: очистка ручная отмена
Строка 1: Строка 1:
<script>
document.addEventListener('DOMContentLoaded', function () {
  document.querySelectorAll('.recipe-card').forEach(function (card) {
    var borderColor = card.getAttribute('data-border');
    if (borderColor) {
      card.style.borderColor = borderColor;
      card.querySelectorAll('.collapsible-content').forEach(function (block) {
        block.style.borderLeftColor = borderColor;
      });
    }
  });


  document.querySelectorAll('.recipe-list li').forEach(function (item) {
    if (item.classList.contains('instruction')) return;
    if (item.querySelector('.chem-icon')) return;
    var icon = document.createElement('img');
    icon.className = 'chem-icon';
    icon.src = 'Beaker.png';
    item.insertBefore(icon, item.firstChild);
  });
  document.querySelectorAll('.collapsible-header').forEach(function (header) {
    header.addEventListener('click', function () {
      var content = this.nextElementSibling;
      content.classList.toggle('active');
    });
  });
});
</script>

Версия от 17:48, 5 мая 2025