User:Douglasfrankfort~enwiki/monobook.js

//  function updatehook { updatelinks(0); }

function updatelinks(count) { for(i=0;i+count=100) {	       setTimeout("updatelinks("+(i+count)+")",1000); return; }   } }

function getupdatedurl(href,loc) { var domain=getpath1(loc); var host=getpath2(loc); var h=new String(href); if(h==hrefstart(h)) {       var url; var server=getserver(href); if(server=="upload.wikimedia.org")return ""; if(server=="mail.wikipedia.org")return ""; if(server=="secure.wikimedia.org") { if(getpath1(h)!=domain || getpath2(h)!=host) url="https://secure.wikimedia.org/"+domain+"/"+host+"/"+getpath(h); else return "/"+getpath(h); }       else url=update(h); return url; }   else return "/"+domain+"/"+host+h; }

function hrefstart(url) { var ret=new String(url); var start=/^(\/)(.*)/; return ret.replace(start,"$2"); }

function getpath1(url) { var ret=new String(url); var path1=/^([A-Za-z0-9_]+):\/\/([^\/]*)\/([^\/]*)\/(.*)/; var tmp=new String(url); ret=ret.replace(path1,"$3"); if(ret==tmp) { return ret.replace(/^([A-Za-z0-9_]+):\/\/([^\/]*)\/(.*)/,"$3"); }   return ret; }

function getpath2(url) { var ret=new String(url); var path2=/^([A-Za-z0-9_]+):\/\/([^\/]*)\/([^\/]*)\/([^\/]*)\/(.*)/; var tmp=new String(url); ret=ret.replace(path2,"$4"); if(ret==tmp){ return ret.replace(/^([A-Za-z0-9_]+):\/\/([^\/]*)\/([^\/]*)\/(.*)/,"$4"); };   return ret; }

function getpath(url) { var ret=new String(url); var path3=/^([A-Za-z0-9_]+):\/\/([^\/]*)\/(.*)/; return ret.replace(path3,"$3"); }

function update(url) { var ret=new String(url); var ud=/^http:\/\/([^\.\/]*).(wikimedia|wikipedia|wiktionary|wikibooks|wikiquote|wikisource|wikinews).org\/(.*)/; return ret.replace(ud,"https://secure.wikimedia.org/$2/$1/$3"); }

function getserver(url) { var ret=new String(url); var server=/^([A-Za-z0-9_]+):\/\/([^\/]*)\/(.*)/; return ret.replace(server,"$2"); }

if(getserver(location)=="secure.wikimedia.org") { addOnloadHook(updatehook); }//  //

// Für dynamische Navigationsleisten (Quelle) var NavigationBarHide = '隐藏 ▲'; var NavigationBarShow = '显示 ▼';

var NavigationBarShowDefault = 0;

function toggleNavigationBar(indexNavigationBar) {  var NavToggle = document.getElementById("NavToggle" + indexNavigationBar); var NavFrame = document.getElementById("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'; }          NavToggle.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'; }          NavToggle.firstChild.data = NavigationBarHide; }  } }

function createNavigationBarToggleButton {  var indexNavigationBar = 0; var subdiv;

for(          var i=0;            NavFrame = document.getElementsByTagName("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); for(var ih=0; subdiv = NavFrame.childNodes[ih]; ih++ ) { if (subdiv.className == "NavHead") { subdiv.appendChild(NavToggle); break; }          }

NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar); }  }

if (NavigationBarShowDefault < indexNavigationBar) { for(              var i=1;                i<=indexNavigationBar;                i++       ) { toggleNavigationBar(i); }  } }

addOnloadHook(createNavigationBarToggleButton); //