User:Mike Dillon/Scripts/tabs.js

This is an old revision of this page, as edited by Mike Dillon (talk | contribs) at 06:38, 12 February 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
// Add a 'purge' link to the tabs
function addPurge(){
    ta['ca-purge'] = ['g', 'Purge the internal cache for this page'];
    var x = document.getElementById('ca-history');
    if(!x) return;
    if(x.children) x = x.children[0].href;
    else x = x.childNodes[0].href;
    addTab(x.replace(/=history/, "=purge"), 'purge', 'ca-purge');
    akeytt();
}

if (window.addEventListener) window.addEventListener("load", addPurge, false);
else if (window.attachEvent) window.attachEvent("onload", addPurge);

// Add a 'last' link to the tabs to show last diff
function doLastDiff() {
  var nurl = "http://en.wikipedia.org/w/index.php?title=" + getPname() + "&diff=cur&oldid=prev";
  document.___location = nurl
}
function addLastDiff() {
  var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
  var l=addlilink(tabs, "javascript:doLastDiff()", 'last', '');
  l.lastChild.title="Show most recent diff";
}

if (window.addEventListener) window.addEventListener("load", addLastDiff, false);
else if (window.attachEvent) window.attachEvent("onload", addLastDiff);