User:Bobogoobo/common.js

From NPOWiki
Revision as of 00:11, 6 July 2022 by Bobogoobo (talk | contribs) (element changes)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
$(function() {
	//Add PrefixIndex to toolbox
	$('#p-tb li:nth-of-type(2)').after(
		'<li id="t-prefixindex">' +
			'<a href="/view/Special:PrefixIndex?prefix=&namespace=' +
				mw.config.get('wgNamespaceNumber') +
				'">Prefix Index</a>' +
		'</li>'
	);
	
	//Add Purge to "More" box
	if (mw.config.get('wgArticleId') && mw.config.get('wgNamespaceNumber') !== '-1') {
		$('#p-cactions .vector-menu-content-list').append(
			'<li id="ca-purge" class="mw-list-item">' +
				'<a href="?action=purge">Purge</a>' +
			'</li>'
		);
	}
});