MediaWiki:Common.js

/* Tabber hash links */ mw.loader.using('ext.Tabber', function {	if(location.hash !=  && location.hash != '#') {		var id = 0;		switch(location.hash.replace('#', ).toLowerCase) {			case 'consortium':				id = 1;				break;			case 'intar':				id = 2;				break;			case 'vectide':				id = 3;				break;		}		if(id != 0) {			$('.tabberactive').removeClass('tabberactive');			$('.tabbertab').hide;			$('.tabberlive div:nth-child(' + (id + 1) + ')').show;			$('.tabbernav li:nth-child(' + id + ')').addClass('tabberactive');		}	}

$('.tabbernav a').click(function {		showTab($(this).attr('title'));	}); });

function showTab(title) { location.hash = '#' + title; switch(title.toLowerCase) { case 'consortium': id = 1; break; case 'intar': id = 2; break; case 'vectide': id = 3; break; }	if(id != 0) { $('.tabberactive').removeClass('tabberactive'); $('.tabbertab').hide; $('.tabberlive div:nth-child(' + (id + 1) + ')').show; $('.tabbernav li:nth-child(' + id + ')').addClass('tabberactive'); } }

/** * Special page reporting * * @athor cblair91 * @version 1.0 */ ( function ( $, mw) {   var pages = [        'BrokenRedirects',        'DoubleRedirects',        'Unusedcategories',        'Unusedimages',        'Wantedcategories',        'Wantedfiles',        'Wantedpages',        'Wantedtemplates'    ];    function getPages( page ) {        $.getJSON( '/api.php?action=query&list=querypage&qppage=' + page + '&qplimit=100&format=json', function ( data ) { $( '#' + page ).text( data.query.querypage.results.length ); });   }    function apiQuery {        for ( var i = 0; i < pages.length; i++ ) {            getPages( pages[i] );        }    }    $( function { if ( document.getElementsByClassName( 'specialMaintenance').length ) { apiQuery; }       if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Specialpages' ) { $('#mw-content-text').before(' ' +               ' Broken redirects  &bull; Double redirects  &bull; Unused categories  &bull; Unused images  ' +                ' Wanted categories  &bull; Wanted files  &bull; Wanted pages  &bull; Wanted templates  ' + ' ');           apiQuery;        }    }); }( jQuery, mediaWiki ) );