User:Amalthea/History hidden UTC.js

// Add a hidden "(UTC)|" into page histories to make using Template:Unsigned2 or Template:Signing2 easier. if (mw.config.get('wgAction')=='history') addOnloadHook(function { var nodes = document.getElementsByTagName('span');  var regexSpanClass = /(^| )history-user( |$)/;  for (i=0; i<nodes.length; i++)  {    if (!regexSpanClass.test(nodes[i].className)) continue;    var hidden=document.createElement("span");    hidden.appendChild(document.createTextNode("(UTC)|"));    hidden.setAttribute("style", "display:none");    nodes[i].childNodes[0].insertBefore(hidden,nodes[i].childNodes[0].childNodes[0]);  } });