MediaWiki:Common.js: Difference between revisions

Created page with "Any JavaScript here will be loaded for all users on every page load.: document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.infobox').forEach(box => { box.querySelectorAll('hr').forEach(hr => { const section = hr.previousSibling; if (section && section.nodeType === Node.TEXT_NODE && !section.textContent.trim()) { hr.style.display = 'none'; } }); }); });"
 
Tag: Replaced
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener('DOMContentLoaded', () => {
  document.querySelectorAll('.infobox').forEach(box => {
    box.querySelectorAll('hr').forEach(hr => {
      const section = hr.previousSibling;
      if (section && section.nodeType === Node.TEXT_NODE && !section.textContent.trim()) {
        hr.style.display = 'none';
      }
    });
  });
});