User:Rgoodermote/purge.js

// /* Almost universal purge button for Wikia. Written Primarily by Splarka and Adapted from http://www.wikia.com/index.php?title=User:Splarka/fastdelete.js Original Purge Script by Rgoodermote http://www.spongebob.wikia.com/wiki/User:Rgoodermote re-fixed by uberfuzzy (no more fastdelete conflicts)

if(wgNamespaceNumber != -1 && wgCurRevisionId != 0) addOnloadHook(addPurgeButton) function addPurgeButton { switch(skin) { case 'wow': /* pass to slate */ case 'wookie': /* pass to slate */ case 'memalpha': /* pass to slate */ case 'smoke': /* pass to slate */ case 'slate': addMSBlink_purge(wgScriptPath + '/index.php?title=' + encodeURIComponent(wgPageName) + '&action=purge', 'purge'); break;

case 'chick': /* pass to monobook */ case 'simple': /* pass to monobook */ case 'myskin': /* pass to monobook */ case 'uncyclopedia': /* pass to monobook */ case 'monobook': addPortletLink('p-cactions',wgScriptPath + '/index.php?title=' + encodeURIComponent(wgPageName) + '&action=purge', 'purge'); break;

case 'monaco': case 'answers': case 'awesome': addPageBarlink_purge(wgScriptPath + '/index.php?title=' + encodeURIComponent(wgPageName) + '&action=purge', 'purge'); break; } }

function addMSBlink_purge(url, text) { var msbs = document.getElementById('myStuffBar').getElementsByTagName('a')[0].parentNode; var link = document.createElement('a'); link.href = url; link.appendChild(document.createTextNode(text)); link.style.marginLeft = '10px'; link.style.color = 'red'; msbs.appendChild(link); }

function addPageBarlink_purge(url, text) { var pc = document.getElementById('page_controls'); if(pc.length < 1) return var d = document.createElement('div'); var link = document.createElement('a'); link.href = url; link.appendChild(document.createTextNode(text)); var nuli = document.createElement('li'); nuli.id = 'control_purge'; nuli.appendChild(d); nuli.appendChild(link); pc.appendChild(nuli); }

//