MediaWiki:Beichtomat.js: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
K (mal ein bischen mehr script ... wenn's nicht läuft, weiß ich schon woran's liegen tut ...)
K (ein bischen schneller machen, dann fallen die Fehler nicht so auf ...)
Zeile 11: Zeile 11:
 
//* }
 
//* }
  
var resizespeed = 5;
+
var resizespeed = 8;
  
 
function reduceheight(page)
 
function reduceheight(page)

Version vom 25. September 2008, 22:24 Uhr

window.onload = function()
	{
	document.getElementById("insertadditionalhtml0").innerHTML = '<center><div class="handbutton" onclick="skipcontent(' + "'step0', 'step1'" + ')"><div class="text" onclick="step1()">Beichte starten</div></div></center>';
	};

//*function step1()
//*	{
//*	document.getElementsByTagName("h1")[0].innerHTML = document.getElementsByTagName("h1")[0].innerHTML + " online – mit dem Beichtomat™ v1.0 (beta)";
//*	document.getElementById("beichte").style.padding = '10px';
//*	document.getElementById("beichte").innerHTML = 'so weit bin ich noch nicht ... erstmal bei mir zuhause zum Laufen kriegen';
//*	}

var resizespeed = 8;

function reduceheight(page)
	{
	currentheight = document.getElementById(page).offsetHeight;
	if(currentheight - resizespeed >= 0)
		{
		document.getElementById(page).style.height = currentheight - resizespeed + "px";
		} else {
		document.getElementById(page).style.height = "0px";
		document.getElementById(page).style.display = "none";
		return "invisible";
		};
	};

function enlargeheight(page)
	{
	if (document.getElementById(page).style.display == "none")
		{
		document.getElementById(page).style.display = "";
		};
	if (document.getElementById(page).offsetHeight > document.getElementById(page + "inner").offsetHeight)
		{
		document.getElementById(page).style.height = "";
		return "visible";
		} else {
		currentheight = document.getElementById(page).offsetHeight;
		document.getElementById(page).style.height = currentheight + resizespeed + "px";
		};
	};
	
function hidecontent(page)
	{
	if (reduceheight(page) != "invisible")
		{
		reduceheight(page);
		setTimeout('hidecontent("' + page + '")', 1);
		};
	};

function showcontent(page)
	{
	if (enlargeheight(page) != "visible")
		{
		enlargeheight(page);
		setTimeout('showcontent("' + page + '")', 1);
		};
	};

function skipcontent(page1, page2)
	{
	if (reduceheight(page1) + enlargeheight(page2) != "invisiblevisible")
		{
		reduceheight(page1);
		enlargeheight(page2);
		setTimeout('skipcontent("' + page1 + '", "' + page2 + '")', 1);		
		};
	};