MediaWiki:Common.js

//DO NOT EDIT THIS PAGE WITHOUT AT LEAST A BASIC UNDERSTANDING OF JAVASCRIPT! $j( function {	var name = mw.config.get( 'wgUserName' );	if ( !window.disableUsernameReplace && name ) {		$j( 'span.insertusername' ).text( name );	} } ); //enables CSS2 JS message var cont = mw.config.get([	'wgServer',	'wgPageName',	'wgCanonicalSpecialPageName',	'wgUserLanguage' ]); if (cont.wgPageName === 'CSS/2') { $(function {		var myElement = document.getElementById('mw-mywiki');		alert('I have ruined this page using JavaScript');		alert('I actually had to add this JavaScript to the site-wide JavaScript page, so, if you\'re reading this over there, uh... hi?');		alert('Are you Suffusion of Yellow by any chance?');		alert('If not, please tell them I said hi.');		alert('Hopefully then we\'ll be able to have a new member of our abuse filter manager user group!'); }); } var cont2 = mw.config.get([	'wgServer',	'wgPageName',	'wgCanonicalSpecialPageName',	'wgUserLanguage' ]); if (cont2.wgPageName === 'CSS') { $(function {		var myElement = document.getElementById('mw-mywiki-example');		if (window.confirm('If you want a version that doesn\'t spin like this, try pressing "OK"'))			{			window.open('http://life.miraheze.org/wiki/CSS/normal', '_blank');			}

}); } if (cont2.wgPageName === 'LifeWiki:Cabal/Wizard') { $(function there_is_no_cabal(apiobj) { var response = apiobj.getResponse; var titles = response.query.allpages;

// There has been no earlier entries with this prefix, just go on. if (titles.length <= 0) { apiobj.params.numbering = apiobj.params.number = ''; } else { var number = 0; for (var i = 0; i < titles.length; ++i) { var title = titles[i].title;

// First, simple test, is there an instance with this exact name? if (title === 'Wikipedia:Articles for deletion/' + Morebits.pageNameNorm) { number = Math.max(number, 1); continue; }

var order_re = new RegExp('^' +						Morebits.string.escapeRegExp('LifeWiki:Cabal/Noticeboard') +						'\\s*\\(\\s*(\\d+)(?:(?:th|nd|rd|st) nom(?:ination)?)?\\s*\\)\\s*$'); var match = order_re.exec(title);

// No match; A non-good value if (!match) { continue; }

// A match, set number to the max of current number = Math.max(number, Number(match[1])); }				apiobj.params.number = utils.num2order(parseInt(number, 10) + 1); apiobj.params.numbering = number > 0 ? ' (' + apiobj.params.number + ' nomination)' : ''; }			apiobj.params.discussionpage = 'LifeWiki:Cabal/Noticeboard';

Morebits.status.info('Next discussion page',  + apiobj.params.discussionpage + );

// Updating data for the action completed event Morebits.wiki.actionCompleted.redirect = apiobj.params.discussionpage; Morebits.wiki.actionCompleted.notice = 'Nomination completed, now redirecting to the discussion page';

// Tagging article var wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Adding deletion tag to article'); wikipedia_page.setFollowRedirect(true); // should never be needed, but if the article is moved, we would want to follow the redirect wikipedia_page.setChangeTags(Twinkle.changeTags); // Here to apply to triage wikipedia_page.setCallbackParameters(apiobj.params); wikipedia_page.load(Twinkle.xfd.callbacks.afd.taggingArticle); }

); }