MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Mikl (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „→Das folgende JavaScript wird für alle Benutzer geladen.: function toggleSectionVisibility(fieldObj, id, txt1, txt2) { var e = document.getElementById…“) |
Porod (Diskussion | Beiträge) |
||
| Zeile 1: | Zeile 1: | ||
| − | |||
function toggleSectionVisibility(fieldObj, id, txt1, txt2) | function toggleSectionVisibility(fieldObj, id, txt1, txt2) | ||
{ | { | ||
Version vom 3. Februar 2015, 18:03 Uhr
function toggleSectionVisibility(fieldObj, id, txt1, txt2)
{
var e = document.getElementById('sectionblock'+id);
if(txt1.search(/gif:/i) >= 0) txt1 = '<img src="'+txt1.replace(':', '">');
if(txt2.search(/gif:/i) >= 0) txt2 = '<img src="'+txt2.replace(':', '">');
if(fieldObj.innerHTML == txt1)
{
fieldObj.innerHTML = txt2;
e.style.display = 'block';
}
else
{
fieldObj.innerHTML = txt1;
e.style.display = 'none';
}
}