User:Gerbrant/hidePane.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

document.write("<style>\
.portlet\
{\
	width:2em;\
	position:relative;\
	z-index:3\
}\
#content\
{\
	margin-left:2em!important\
}\
#column-one\
{\
	padding-top:3em!important\
}\
.portlet .pBody\
{\
	width:10em!important\
}\
.portlet ul\
{\
	margin-left:0!important\
}\
#p-logo\
{\
	display:none\
}\
#p-cactions\
{\
	left:2em!important;\
	z-index:auto\
}\
</style>");

addOnloadHook(function()
{
	var l = [];

	function doPortlet(e)
	{
		if(!e) return;
		e.onmouseover = function(evt)
		{
			if(!evt) evt = event;
			e.style.width="12em";
			evt.cancelBubble=true;
		};
		l.push(e);
	}

	document.body.onmouseover = function()
	{
		var e;
		for(e in l) l[e].style.width="";
	};

	doPortlet(document.getElementById("p-navigation"));
	doPortlet(document.getElementById("p-search"));
	doPortlet(document.getElementById("p-tb"));
	doPortlet(document.getElementById("p-lang"));
});