User:Cryptic/relatedchanges.js

// // Only show the most recent change to each article in Related Changes. // Also change the diff links so they're the same urls as the History page (and thus show up in the "visited" color). addOnloadHook(function {  if (document.title == 'Related changes - Wikipedia, the free encyclopedia')    {      var uls = document.getElementsByTagName('ul');      var entries = new Object;      for (var i = 0; i < uls.length; ++i)        if (uls[i].className && uls[i].className.indexOf('special') >= 0)          {            var ul = uls[i];            var li = ul.getElementsByTagName('li');            for (var j = 0; j < li.length; ++j)              {                var a = li[j].getElementsByTagName('a');                if (a[0].firstChild.data == "diff")                  if (entries[a[2].href] == 'y')                    li[j].style.display = 'none';                  else                    {                      a[0].href = a[0].href.replace(/&curid=[0-9]+/, '');                      entries[a[2].href] = 'y';                    }              }          }    } }); //