User:NDKilla/global.js

/* Change language to English */ mw.loader.using("mediawiki.user", function {	if ( mw.user.options.get('language') !== 'en' ) {		mw.loader.load("mediawiki.notify");		( new mw.Api ).postWithToken( 'options', { action: "options", change: "language=en" } ).done( function { mw.loader.using("mediawiki.notify", function{				mw.notify( "Language has been changed to English. Please refresh the page." );			} );		} );	} else {		console.log('Language already set to English!');	} } );

function showBackendPerformance { var respTime = mw.config.get( 'wgBackendResponseTime' ), backend = mw.config.get( 'wgPoweredByHHVM' ) ? 'HHVM' : 'PHP5', server = mw.config.get( 'wgHostname' ), caption = respTime.toString + 'ms ( ' + backend + ' at ' + server + ')'; $( '' ).html( caption ).prependTo( '#p-personal ul' ); }

$( window ).on( 'load', showBackendPerformance );

//Mass rollback function //Written by John254 //Adapted from User:Mr.Z-man/rollbackSummary.js //Instructions: Selecting the "rollback all" tab when viewing a user's contributions history //will open all rollback links displayed there. (Use with caution)

jQuery(document).ready(function ($) {

function rollbackEverything { for (var i in document.links) { if (document.links[i].href.indexOf('action=rollback') != -1) { window.open(document.links[i].href); }		}	}

function rollbackEverythingButton { var hasRollback = $("span.mw-rollback-link"); if (hasRollback[0] && (document.title.indexOf("User contributions") !== -1) ) { var link = mw.util.addPortletLink(				'p-cactions',				'#',				'rollback all',				'ca-rollbackeverything',				'rollback all edits displayed here'			); $(link).click(function (e) {				e.preventDefault;				rollbackEverything;			}); }	}

rollbackEverythingButton;

});

// mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/RTRC.js&action=raw&ctype=text/javascript');