MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

/** * Element animator (used in Template:Grid) * * Will cycle the active class on any child elements within an element with the animated class. */ if ( $( '.animated' ).length ) { setInterval( function {       $( '.animated' ).each( function { var current = $( this ).find( '.active' ).removeClass( 'active' ), next = current.next; if ( !current.next.length ) { next = $( this ).children.eq( 0 ); }           next.addClass( 'active' ); } );   }, 2000 ); }

/** * Pause grid templates with lots of cells in them (e.g. Template:Grid/Crafting Table) on mouseover * * This is so people have a chance to look at each image on the cell * and click on pages they want to view. */ function pauseGrid( grid ) { $( grid ).hover( function {        $( this ).find( '.grid .animated' ).removeClass( 'animated' ).addClass( 'paused' );    }, function {        $( this ).find( '.grid .paused' ).removeClass( 'paused' ).addClass( 'animated' );    } ); } pauseGrid( '.grid-Crafting_Table' ); pauseGrid( '.grid-Furnace' ); pauseGrid( '.grid-Brewing_Stand' );