User:Color probe/rtl.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//

// Revert to last diff, by color probe (beta v.0.1)
// Please leave these lines

addOnloadHook(function () {
    z=document.getElementById("content").childNodes;
    for (var n=0;n<z.length;n++) { 
      if (z[n].className=="firstHeading") {
        var pname=z[n].textContent;
      }
    }
    var l=addTab("http://en.wikipedia.org/w/index.php?title=" + pname + "&action=edit&autoclick=wpSave&autosummary=Revert%20vandalism&autosummaryprompt=true&oldid=prev", 'RTL', '');
    l.lastChild.title="Revert to last diff";
});

//