User:Sannse/monobook.js

function checklink { if(!document.title.indexOf("User contributions") == 0) return;

if(document.getElementById("contentSub").getElementsByTagName("a")[0].innerHTML == "Talk") { var link = document.getElementById("contentSub").getElementsByTagName("a")[3]; checkhref = "subip=OK&ip=" + document.getElementById("contentSub").innerHTML.substring(4,document.getElementById("contentSub").innerHTML.indexOf("(")-1);   } else {        var link = document.getElementById("contentSub").getElementsByTagName("a")[4];        checkhref = "subuser=OK&user=" + document.getElementById("contentSub").getElementsByTagName("a")[0].innerHTML;    }    var chLink = document.createElement("a");    chLink.href = "\/wiki\/Special:CheckUser?" + checkhref;    chLink.textContent = "Checkuser";    var space = insertAfter(link.parentNode, document.createTextNode(" | "), link);    insertAfter(link.parentNode, chLink, space); } addOnloadHook(checklink); ta['ca-checkuser'] = ['', 'CheckUser this person'];

// insertAfter by Volte function insertAfter(parent, node, referenceNode) { if(referenceNode.nextSibling) { return parent.insertBefore(node, referenceNode.nextSibling); } else { return parent.appendChild(node); } }