Jump to content

User:Gerbrant/gui/taskbar.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
document.write("\
<style>\
#gerbrant-taskbar\
{\
	position:absolute;\
	z-index:256;\
	left:0;top:0;width:100%;\
	padding:2px 0 2px;\
	border-bottom:1px solid #888;\
	background:#eee;\
	display:none;\
}\
.gerbrant-taskbarbutton\
{\
	margin:0 0.5em 0;\
	border:1px solid #88f;\
	background:#ddf;\
	color:#000;\
}\
</style>");

module("Gerbrant.gui.taskbar", new function()
{
	var s;
	var divTaskbar = document.createElement("DIV");
	divTaskbar.id = "gerbrant-taskbar";

	this.addWindow = function(w)
	{
		var a = document.createElement("A");
		a.className = "gerbrant-taskbarbutton";
		a.innerHTML = w.getCaption();
		a.onclick = function()
		{
			w.setVisible(!w.getVisible());
		}

		divTaskbar.appendChild(a);
		divTaskbar.style.display = "block";

//Ugly temporary hack waiting for a restyle. Well, nobody is using this script so I guess it doesn't matter.
document.getElementById("globalWrapper").style.cssText="top:1em;border-top:1px solid white;position:relative";
document.getElementById("column-one").style.cssText="top:0em";

	};

	hookEvent("load", function()
	{
		document.body.insertBefore(divTaskbar, document.body.firstChild);
	});
});