User:PerfektesChaos/js/prettyPageHeading/r.js

/// Gadget-prettyPageHeading.js /// 2018-08-25 PerfektesChaos@de.wikipedia /// Fingerprint:#0#C2E22EF1# /// (function(mw,$){ "use strict"; var Version=1.4,Sign="prettyPageHeading",Shift="0.25em",Shop="w:en:User:PerfektesChaos/js/",Config,Nnsp,Rooms,Store; function $flip($assembly,apply,ahead,above){ var $el=$(above?"":" "); if(above){ $el.attr("href",Store+encodeURI(above));} $assembly.prepend($el.attr("class",Sign).css(ahead,Shift).text(apply));} function fiat{ var $h1=$("#firstHeading,#section_0"),env,i,k,ns,parts,plus,shift,space,story,superior,support,$ch,$el,$space; if($h1.length){ $h1=$h1.eq(0); }else{ $h1=$(" ");} $ch=$h1.children; ns=$ch.length; for(i=ns-1;i>=0;i--){ $el=$ch.eq(i); if($el.get(0).nodeName.toUpperCase==="MARK"){ ns=i; }else if($el.hasClass("title-shortlink-container")||$el.hasClass("title-shortlink-icon")){ plus=plus||[]; plus.push($el.detach); ns=i; }else{ break;}} if(!ns){ env=mw.config.get(["wgContentLanguage","wgFormattedNamespaces","wgUserLanguage"]); if(Store){ space=env.wgFormattedNamespaces[Nnsp+""]; Store=Store+encodeURI(space)+":"; $(".subpages").hide;} if($("html").attr("dir")==="rtl"){ shift="margin-right"; }else{ shift="margin-left";} story=$h1.text; $h1.empty; ns=story.indexOf(":")+1; space=story.substr(0,ns); parts=story.substr(ns).split("/"); for(i=parts.length-1;i>=0;i--){ $flip($h1,parts[i],shift,superior); if(i){ $flip($h1,"/",shift);} if(Store){ superior=""; for(k=0;k=0;i--){ $h1.append(plus[i]);}}}} function fire{ var signature="ext.gadget."+Sign,rls; if(mw.loader.getState(signature)!=="ready"){ rls={}; rls[signature]="ready"; mw.loader.state(rls); Nnsp=mw.config.get("wgNamespaceNumber"); if(Nnsp>0){ if(typeof mw.libs[Sign]==="object"){ Config=mw.libs[Sign]; if(Config){ Config.vsn=Version; Config.doc=""+Shop+Sign+""; if(typeof Config.link==="boolean"&&Config.link){ Store="/wiki/";} if(typeof Config.shift==="string"){ Shift=Config.shift;}}} $(fiat);}}} fire; }(window.mediaWiki,window.jQuery)); /// EOF prettyPageHeading.js