User:AuFCL/common.js/jsleader.js

// //This code is not linked to from anywhere and is simply being maintained for //the historical horror it represents.

function jsleader{ var AllTags=document.getElementsByTagName('*'); for(var S=0;S<AllTags.length;S++){ if(AllTags[S].hasAttributes('class')){ if(/JavaScriptTagDotTestLeaderPrototype/.test(AllTags[S].getAttribute('class'))){ var leaderProto=AllTags[S].innerHTML; AllTags[S].innerHTML=""; AllTags[S].setAttribute("style",AllTags[S].getAttribute("style")+"display:inline-block;word-wrap:break-word;word-break:break-all;"); var container=AllTags[S].parentNode, baseHeight=container.clientHeight; while(container && !baseHeight){ container=container.parentNode; baseHeight=container.clientHeight; }   if(container){ var leaderFill="", guard=0; while((guard<500) && (container.clientHeight==baseHeight)){ guard++; AllTags[S].innerHTML=leaderFill+leaderProto; if(container.clientHeight==baseHeight){ leaderFill=AllTags[S].innerHTML; }    }     AllTags[S].innerHTML=leaderFill; }  }  } }; for(var S=AllTags.length-1;S>=0;S--){ if(AllTags[S].hasAttributes('class')){ if(/JavaScriptTagDotTestLeaderPrototype/.test(AllTags[S].getAttribute('class'))){ var container=AllTags[S].parentNode, baseHeight=container.clientHeight; while(container && !baseHeight){ container=container.parentNode; baseHeight=container.clientHeight; }   if(container){ var guard=0, maxFill=0, leaderFill=AllTags[S].innerHTML; while((guard<1000) && (container.clientHeight==baseHeight)){ guard++; AllTags[S].innerHTML=leaderFill+ "&thinsp; "; if(container.clientHeight==baseHeight){ maxFill=guard; }    }     AllTags[S].innerHTML=leaderFill+ (maxFill?      "&thinsp; ":       ""); }  }  } }; }

$(jsleader);

//