User:Ap34910/hide-header.js

( function ( mw, $ ) {	var headerSwitch;	function headerHide {		document.getElementById( 'mw-head' ).style.visibility = 'hidden';		document.getElementById( 'content' ).style.marginTop = '-80px';		document.getElementById( 'right-navigation' ).style.visibility = 'visible';		document.getElementById( 'right-navigation' ).style.marginTop = '19px';		if ( headerSwitch ) {			headerSwitch.parentNode.removeChild(headerSwitch);		}		headerSwitch = mw.util.addPortletLink( 'p-cactions', '#', 'Show header', 'ca-header', 'Show the navigation links', 'a' );		$( headerSwitch ).click( function ( e ) { e.preventDefault; headerShow; } );	}	function headerShow {		document.getElementById( 'mw-head' ).style.visibility = ;		document.getElementById( 'content' ).style.marginTop = ;		document.getElementById( 'right-navigation' ).style.visibility = ;		document.getElementById( 'right-navigation' ).style.marginTop = ;		if ( headerSwitch ) {			headerSwitch.parentNode.removeChild(headerSwitch);		}		headerSwitch = mw.util.addPortletLink( 'p-cactions', '#', 'Hide header', 'ca-header', 'Hide the navigation links', 'a' );		$( headerSwitch ).click( function ( e ) { e.preventDefault; headerHide; } );	}	// Only activate on Vector skin	if ( mw.config.get( 'skin' ) === 'vector' ) {		$( function { // Change this if you want to show the sidebar by default headerShow; } );	} }( mediaWiki, jQuery ) );