Benutzer:FWHS/scripte
Erscheinungsbild
/* This script shows all NavigationBars on a page in Wikipedia
* made by FWHS (http://de.wikipedia.org/wiki/Benutzer:FWHS)
* code based on the embedded script in a NavigationBar template
* found at http://de.wikipedia.org/w/index.php?title=-&action=raw&smaxage=0&gen=js
* To use this script you must be logged on and put it in the .js-File of the
* skin you use (e.g. /monobook.js for Monobook-Skin).
* It can be started with window.onload = showallNavigationBars()
* This script works with de.wikipedia, Mozilla Firefox 1.07.
* It has not been tested with other systems. Use at own risk.
* For comment, questions or whatever please use my discussion page
* (http://de.wikipedia.org/wiki/Benutzer_Diskussion:FWHS)
* FWHS (de:Benutzer:FWHS)
*/
function showallNavigationBars() {
// give each NavigationBar an indexNavigationBar if not done by another script
if (!indexNavigationBar>0) {
var indexNavigationBar = 0;
// iterate over all < div >-elements
for(
var i=0;
NavFrame = document.getElementsByTagName("div")[i];
i++
) {
// if found a navigation bar
if (NavFrame.className == "NavFrame") {
indexNavigationBar++;
NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
}
}
}
//for all existing NavigationBars
for(
var i=1;
i<=indexNavigationBar;
i++
) {
// show NavigationBar with index i
var NavToggle = document.getElementById("NavToggle" + i);
var NavFrame = document.getElementById("NavFrame" + i);
if (!NavFrame || !NavToggle) {
return false;
}
// if hidden or not
for (
var NavChild = NavFrame.firstChild;
NavChild != null;
NavChild = NavChild.nextSibling
) {
if (NavChild.className == 'NavPic') {
NavChild.style.display = 'block';
}
if (NavChild.className == 'NavContent') {
NavChild.style.display = 'block';
}
if (NavChild.className == 'NavToggle') {
NavChild.firstChild.data = NavigationBarHide;
}
}
}
}
//to do it after the page loaded delete "//" at the beginning of the following line
// window.onload = showallNavigationBars()
/* end of showallNavigationBars */