Difference between revisions of "MediaWiki:Common.js"

Jump to navigation Jump to search
38 bytes added ,  18:44, 1 December 2021
no edit summary
 
Line 2: Line 2:


/* Quick purge function */
/* Quick purge function */
if (mw.config.get('wgCanonicalNamespace') != 'Special') {
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);
}
}

Navigation menu