Minecraft Wiki
Advertisement

Documentation may be created at User:RubenVerg/common.js/doc.

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

Google Chrome, Firefox, Microsoft Edge, and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button.
For details and instructions about other browsers, see Wikipedia:Bypass your cache.

//common.js

//Rollback confirmation
(function() {
		$(".mw-rollback-link").on('click', function(e) {
			var linkText = $(e.target).text(),
				count = linkText.match(/\d/) ? linkText.match(/\d+/)[0] : null,
				message = 'Rollback ' + (count ? count + ' edits' : 'edit') + ' by ' + mw.util.getParamValue('from',e.target.href) + '?';
			if(!confirm(message)) return e.preventDefault();
		});
}());

//Show Doc: prefix
if ( 
    $.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 10, 11, 828, 829 ] ) > -1 ||
    $.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 2, 3 ] ) > -1 &&
    mw.config.get( 'wgTitle' ).replace( /\/doc$/, '' ).search( /\.(js|css)$/ ) > -1
) {
    importScript( 'User:Majr/docTabs.js' );
}
Advertisement