1,124
edits
Line 2: | Line 2: | ||
/* Quick purge function */ | /* Quick purge function */ | ||
if (mw.config.get(' | if (mw.config.get('wgNamespaceNumber') >= 0 && mw.config.get('wgUserName') != null) { | ||
purgeUri = window.location.href + '?action=purge'; | purgeUri = window.location.href + '?action=purge'; | ||
purgeShell = document.createElement('a'); | purgeShell = document.createElement('a'); | ||
purgeShell.innerHTML='Purge'; | purgeShell.innerHTML='Purge'; | ||
purgeShell.setAttribute('href', purgeUri); | purgeShell.setAttribute('href', purgeUri); | ||
moreOptions = document.getElementById('p-cactions'); | moreOptions = document.getElementById('p-cactions'); | ||
moreOptions = moreOptions.getElementsByClassName('vector-menu-content-list'); | moreOptions = moreOptions.getElementsByClassName('vector-menu-content-list'); | ||
newChild = document.createElement('li'); | newChild = document.createElement('li'); | ||
newChild.setAttribute('id', 'ca-purge'); | newChild.setAttribute('id', 'ca-purge'); | ||
newChild.appendChild(purgeShell); | newChild.appendChild(purgeShell); | ||
moreOptions[0].appendChild(newChild); | moreOptions[0].appendChild(newChild); | ||
} | } |