MediaWiki:Common.js: Unterschied zwischen den Versionen

Zur Navigation springen Zur Suche springen
keine Bearbeitungszusammenfassung
 
Keine Bearbeitungszusammenfassung
Zeile 1:
/* Jedes JavaScript hier wird für alle Benutzer für jede Seite geladen. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
// <syntax type="javascript">
 
/**
Toggles the display of elements on a page
Author/contact: Austin Che http://openwetware.org/wiki/User:Austin_J._CheAustin
See http://openwetware.org/wiki/OpenWetWare:Toggle for examples and documentation
*/
 
Zeile 85 ⟶ 79:
var togglerElems = new Array();
var toggleGroup = new Array();
 
// initialize/clear any old information
togglers = new Array();
allClasses = new Object();
// make list of all document classes
Zeile 163 ⟶ 153:
addOnloadHook(toggleInit);
 
function unToggle()
// </syntax>
{
var path=window.location.href;
var parts=path.split("#");
if(parts.length > 1)
{
path=parts[parts.length-1];
parts=path.split(".23");
togglers var untogglerGroup = new Array();
var untogglerClass = new Array();
// make list of all document classes
var elems = document.getElementsByTagName("*");
var numelems = elems.length;
for (var c=0; c < parts.length; c++)
{
for (var i = 0; i < elems.length; i++)
{
var elem = elems[i];
if (!elem.className)
continue;
var elemClasses = elem.className.split(' '); // get list of classes
for (var j = 0; j < elemClasses.length; j++)
{
var elemClass=elemClasses[j];
if (elemClass != parts[c])
continue;
else
{
untogglerGroup.push(elem);
untogglerClass.push(elemClass);
}
}
}
}
// add javascript links to all toggler elements
for (var i = 0; i < untogglerGroup.length; i++)
{
untogglerGroup[i].style.display = '';
}
}
}
 
addOnloadHook(unToggle);
 
// </syntaxpre>

Navigationsmenü