User:JYolkowski/monobook.js

var request if (wgPageName.substr(0, 10) == "User_talk:" && window.location.toString.indexOf("action=edit") > 0) { if (window.XMLHttpRequest) { request = new XMLHttpRequest; requesttype = "Mozilla" }   else if (window.ActiveXObject) { request = new ActiveXObject("Microsoft.XMLHTTP") requesttype = "MSIE" }

if (request) { request.onreadystatechange = documentDone; request.open("GET", "/w/query.php?format=xml&what=revisions&titles="+wgPageName+"&rvlimit=5&rvcomments", true) if (requesttype == "MSIE") request.send else request.send(null) } } function documentDone { if (request.readyState == 4 && request.status == 200) { mydocument = request.responseXML.documentElement stuff = "Last five edits: " for (i = 0; i < 5; i++) { if (mydocument.getElementsByTagName("rv")[i]) { stuff = stuff + "" + mydocument.getElementsByTagName("rv")[i].getAttribute("user") + " &mdash; " + mydocument.getElementsByTagName("rv")[i].getAttribute("timestamp") + " &mdash; " + mydocument.getElementsByTagName("rv")[i].getAttribute("comment") }       }        stuff = stuff + "" document.getElementById("toolbar").innerHTML = stuff + document.getElementById("toolbar").innerHTML } }