MediaWiki:Vector.css

Aus Harvestopia
Wechseln zu: Navigation, Suche
/* Das folgende CSS wird für Benutzer der Vector-Benutzeroberfläche geladen. Für allgemeingültige Benutzeroberflächen-Anpassungen bitte [[MediaWiki:Common.css]] bearbeiten. */

// Ausklappbare Navigationsleisten
 
 var NavigationBarHide = 'Einklappen ▲';
 var NavigationBarShow = 'Ausklappen ▼';
 var NavigationBarShowDefault = 10;

 //Einstellungen ([[Wiktionary:Einstellungen]]):
 if ( getCookie('WiktionaryUseJSPreferences') != 'true' ) {
         NavigationBarShowDefault = 999;
    } else if ( getCookie('WiktionaryPreferencesHideNav') == 'true' ) {
         NavigationBarShowDefault = 0;
    } else if ( getCookie('WiktionaryPreferencesShowNav') == 'true' ) {
         NavigationBarShowDefault = 999;
    } else {
         NavigationBarShowDefault = 999;
    }

 function toggleNavigationBar(indexNavigationBar) {
  var NavToggle = $("NavToggle" + indexNavigationBar);
  var NavFrame = $("NavFrame" + indexNavigationBar);
  if (!NavFrame || !NavToggle) {return false;}
  if (NavToggle.firstChild.data == NavigationBarHide) {
   for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
    if (NavChild.className == 'NavPic') {NavChild.style.display = 'none';}
    if (NavChild.className == 'NavContent') {NavChild.style.display = 'none';}
    if (NavChild.className == 'NavToggle') {NavChild.firstChild.data = NavigationBarShow;}
   }
  }
  else if (NavToggle.firstChild.data == NavigationBarShow) {
   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;}
   }
  }
 }
 function createNavigationBarToggleButton() {
  var indexNavigationBar = 0;
  for (var i=0; NavFrame = $t("div")[i]; i++) {
   if (NavFrame.className == "NavFrame") {
    indexNavigationBar++;
    var NavToggle = document.createElement("a");
    NavToggle.className = 'NavToggle';
    NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
    NavToggle.setAttribute('href', 'javascript:toggleNavigationBar('+indexNavigationBar+')');
    var NavToggleText = document.createTextNode(NavigationBarHide);
    NavToggle.appendChild(NavToggleText);
    NavFrame.insertBefore(NavToggle, NavFrame.firstChild);
    NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
   }
  }
  if (NavigationBarShowDefault < indexNavigationBar) {
   for (var i=1; i<=indexNavigationBar; i++) {toggleNavigationBar(i);}
  }
 }
 addOnloadHook(createNavigationBarToggleButton);

 function closedNavBar() {
 if ( getCookie('WiktionaryUseJSPreferences') != 'true' ) {
         if (document.getElementById("closedNavBar")) {toggleNavigationBar(1);}
         else { toggleNavigationBar(0); }
    } else if ( getCookie('WiktionaryPreferencesHideNav') == 'true' ) {
         toggleNavigationBar(100);
    } else if ( getCookie('WiktionaryPreferencesShowNav') == 'true' ) {
         toggleNavigationBar(0);
    } else {
         if (document.getElementById("closedNavBar")) {toggleNavigationBar(1);}
         else { toggleNavigationBar(0); }
    }
 }
 addOnloadHook(closedNavBar);