User:Lifebaka/purge.js

//This script adds a tab up at the top of every page to purge the server cache

//To use this script, just add "importScript('User:Lifebaka/purge.js');" to your monobook.js page

//The code is based very loosely off of Wikipedia:WikiProject User scripts/Scripts/CloseAFD.js written by User:Johnleemk

function add_purge_tab()

{

// Only add for pages with the right string somewhere in the title

if ((wgCanonicalNamespace != "Special") && (document.title.indexOf("Editing ") == -1))

{

var URL = 'http://en.wikipedia.org/w/index.php?title=' + wgCanonicalNamespace + ':' + wgTitle + '&action=purge'

mw.util.addPortletLink('p-cactions', URL, "purge");

}

}

addOnloadHook(add_purge_tab);