User:Vuccala/common.js

//// Fades away bot edits on the Revision history page so it's easier to see human edits: (function {   function containsBot(text) {        return text.toLowerCase.includes('bot');    }

var contributionLists = document.querySelectorAll('ul.mw-contributions-list');

contributionLists.forEach(function(contributionList) {       var bdiElements = contributionList.querySelectorAll('bdi');

bdiElements.forEach(function(bdiElement) {           if (containsBot(bdiElement.textContent)) {                contributionList.style.opacity = '0.5';            }        }); }); });

//// Hides the nonsense ===Anagrams=== section from pages // Find all elements with a child having id="Anagrams" var headings = document.querySelectorAll('h3 > span#Anagrams');

// Loop through each matching element and hide the and its immediate  for (var i = 0; i < headings.length; i++) { var span = headings[i]; var h3Element = span.parentNode; // Find the parent element var ulElement = h3Element.nextElementSibling; // Find the immediate following  if (h3Element && ulElement) { h3Element.style.display = 'none'; ulElement.style.display = 'none'; } }