Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.

  • Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
  • Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
  • Internet Explorer/Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
  • Opera: Strg+F5
function spoilAll() {
	var els = document.getElementsByTagName('*');
	var spoiler = new Array();
	var pattern = new RegExp("(^|\\s)spoiler(\\s|$)");
	for (i = 0; i < els.length; i++) {  
		if(pattern.test(els[i].className)){
			spoiler.push(els[i]);
		}
	}
	for (j = 0; j < spoiler.length; j++){
		if(pattern.test(spoiler[j].className)){
			if("closed" == spoiler[j].getAttribute("value")){
				spoiler[j].style.display = 'block';
				spoiler[j].setAttribute("value","open");
				var link = findLink(j);
				if(null != link){
				link.firstChild.data = "verstecke Spoiler";
				}
			}
			else{
				spoiler[j].style.display = 'none';
				spoiler[j].setAttribute("value","closed");
				var link = findLink(j);
				if(null != link){
				link.firstChild.data = "zeige Spoiler";
				}
			}
		}
	}
}

function spoil(j) {
  var els = document.getElementsByTagName('*');
  var spoiler = new Array();
  var pattern = new RegExp("(^|\\s)spoiler(\\s|$)");
  for (i = 0; i < els.length; i++) {  
	if(pattern.test(els[i].className)){
		spoiler.push(els[i]);
	}
  }
  if(j < spoiler.length){
	  if("closed" == spoiler[j].getAttribute("value")){
		  spoiler[j].style.display = 'block';
		  spoiler[j].setAttribute("value","open");
		  var link = findLink(j);
		  if(null != link){
			link.firstChild.data = "verstecke Spoiler";
		  }
	  }
	  else{
		  spoiler[j].style.display = 'none';
		  spoiler[j].setAttribute("value","closed");
		  var link = findLink(j);
		  if(null != link){
			link.firstChild.data = "zeige Spoiler";
		  }
	  }
  }
}

function spoilReset() {
  var els = document.getElementsByTagName('*');
  var spoiler = new Array();
  var pattern = new RegExp("(^|\\s)spoiler(\\s|$)");
  for (i = 0; i < els.length; i++) {  
	if(pattern.test(els[i].className)){
		spoiler.push(els[i]);
	}
  }
  for (j = 0; j < spoiler.length; j++){
      	if(pattern.test(spoiler[j].className)){
	  spoiler[j].style.display = 'none';
	  spoiler[j].setAttribute("value","closed");
	  var link = findLink(j);
	  if(null != link){
		link.firstChild.data = "zeige Spoiler";
	  }
	}
  }
}

function spoilOpenAll() {
  var els = document.getElementsByTagName('*');
  var spoiler = new Array();
  var pattern = new RegExp("(^|\\s)spoiler(\\s|$)");
  for (i = 0; i < els.length; i++) {  
	if(pattern.test(els[i].className)){
		spoiler.push(els[i]);
	}
  }
  for (j = 0; j < spoiler.length; j++){
      	if(pattern.test(spoiler[j].className)){ 
	  spoiler[j].style.display = 'block';
	  spoiler[j].setAttribute("value","open");
	  var link = findLink(j);
	  if(null != link){
		link.firstChild.data = "verstecke Spoiler";
	  }
	}
    }
}

function findLink(j) {
  var linksAll = document.getElementsByName("spoilerlink-"+j);
  if(0<linksAll.length){
  	return linksAll[0];
  }
  return null;
}

function buildSpoitertags(){
  var els = document.getElementsByTagName('*');
  var spoiler = new Array();
  var pattern = new RegExp("(^|\\s)spoiler(\\s|$)");
  for (i = 0; i < els.length; i++) {  
	if(pattern.test(els[i].className)){
		spoiler.push(els[i]);
	}
  }
  for(j=0;j < spoiler.length;j++){
	var value = document.createAttribute("value");
	value.nodeValue = "open";
	spoiler[j].setAttributeNode(value);
	//baue link...
	var par = document.createElement("p");
	var link = document.createElement("link");
	link.href = "javascript:spoil("+j+")";
	var text = document.createTextNode("verstecke spoiler");
	var value = document.createAttribute("name");
	value.nodeValue = "spoilerlink-"+j;
	link.setAttributeNode(value);
	link.appendChild(text);
	//insert link...
	par.appendChild(link);
	spoiler[j].parentNode.insertBefore(par, spoiler[j]);
    }
    spoilReset();
}

addOnloadHook(buildSpoitertags);