MediaWiki:Monobook.js

/* Any JavaScript here will be loaded for users using the MonoBook skin */ /**Taken from Uncylopedia **/

jQuery( document ).ready( function {	$( '.collapsed > *' ).next.css( 'display', 'none' );	$( '.expanded > *' ).click( function { $( this ).next.toggle; $( this ).parent.toggleClass( 'expanded' ); $( this ).parent.toggleClass( 'collapsed' ); });	$( '.collapsed > *' ).click( function { $( this ).next.toggle; $( this ).parent.toggleClass( 'collapsed' ); $( this ).parent.toggleClass( 'expanded' ); }); }); /* * Trivial plugin for hiding the portals in the sidebar panel * Written by Silent Penguin */ (function( $ ) {	$.fn.hidingToolbox = function( options ) {		var settings = {			'initClosed': true,			'duration': 200,			'contentSelector': '.pBody',			'handleSelector': 'h5',			'slide': function( visible ) {				if( visible ) {					this.parent.addClass( 'hidden' ).removeClass( 'visible' );				} else {					this.parent.addClass( 'visible' ).removeClass( 'hidden' );				}			}		};		// where the magic happens		var handleClick = function {			var handle = $( this ).parent.find( settings['contentSelector'] );			var visible = handle.is( ':visible' )			handle[visible ? 'slideUp' : 'slideDown'](settings['duration'], function { return settings['slide'].apply( $( this ), [visible] ); } );		}		var handleHoverIn = function {			$( this ).addClass( 'hover' );		}		var handleHoverOut = function {			$( this ).removeClass( 'hover' );		}		var length = this.length;		if ( typeof( options ) == typeof( Object ) ) {			$.extend( settings, options );		}		// If options exist and is the right type, lets merge them with our default settings		if ( typeof( settings['initClosed'] ) == typeof( Array ) && !settings['initClosed'].length )		{			settings['initClosed'] = true;		}		// if our init closed is an empty array, define it to the default again.		return this.each( function( key ) { var self = $( this ); self.find( settings['handleSelector'] ) .hover( handleHoverIn, handleHoverOut ) // detect hovers, style accordingly .click( handleClick ); // click event to open and close var initClosed = typeof( settings['initClosed'] ) == typeof( Array ) ? settings['initClosed'][Math.min( key, length - 1 )] : settings['initClosed']; self.find( settings['contentSelector'] )[initClosed ? 'hide' : 'show'].parent.addClass( initClosed ? 'hidden' : 'visible' ); });	}; })( jQuery ); jQuery( document ).ready( function {	jQuery( '.generated-sidebar:not(#p-navigation), #p-tb, #p-wikicities-nav, #p-lang, #p-community' ).hidingToolbox({'initClosed': [false, true, true, true, true]});	jQuery( '#column-one' ).addClass( 'collapsible_pile' ); });