User:PerfektesChaos/js/WikiSyntaxTextMod/r.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/// PerfektesChaos/js/WikiSyntaxTextMod/r.js
/// 2018-09-19 [email protected]
/// Fingerprint:#0#595F4A01#
///<nowiki>
if(typeof mediaWiki!=="object"){
    mw={config:false,libs:{},log:function(){"use strict";},str:{},util:{}
    };}
    if(typeof mw.libs.WikiSyntaxTextMod!=="object"||!mw.libs.WikiSyntaxTextMod){
    mw.libs.WikiSyntaxTextMod={bb:{}};}
    if(!mw.libs.WikiSyntaxTextMod.vsn){
    mw.libs.WikiSyntaxTextMod.vsn=7.1;}
    if(typeof mw.libs.WikiSyntaxTextMod.bb!=="object"){
    mw.libs.WikiSyntaxTextMod.bb={};}
    mw.libs.WikiSyntaxTextMod.bb.util=function(WSTM){
    "use strict";
    if(typeof WSTM.util!=="object"){
    WSTM.util={};}
    WSTM.util.fiatObjects=function(adult,activate,assign){
    var elt,obj,s;
    if(typeof(adult[activate])!=="object"){
    adult[activate]=(assign?assign:{});}
    if(assign){
    obj=adult[activate];
    for(s in assign){
    if(assign.hasOwnProperty(s)){
    elt=assign[s];
    if(typeof(elt)==="object"){
    WSTM.util.fiatObjects(obj,s,elt);}}}}
    };
    WSTM.util.yymmddhhmmss=function(align){
    var s=(align.getFullYear()%100)*10000+(align.getMonth()+1)*100+align.getDate(),t=align.getHours()*10000+align.getMinutes()*100+align.getSeconds();
    return(WSTM.str.fromNum(s)+WSTM.str.fromNum(t));
    };
    WSTM.util.fiatObjects(WSTM,"debugging",{loud:false});
    };
    mw.libs.WikiSyntaxTextMod.bb.util(mw.libs.WikiSyntaxTextMod);
    delete mw.libs.WikiSyntaxTextMod.bb.util;
    mw.libs.WikiSyntaxTextMod.bb.config=function(WSTM){
    "use strict";
    WSTM.type="WikiSyntaxTextMod";
    WSTM.doc="[[w:de:User:PerfektesChaos/js/"+WSTM.type+"]]";
    if(typeof(WSTM.g)!=="object"){
    WSTM.g={learnt:false,mediaWiki:false,wDBname:undefined,wNsIds:undefined,wNsNumber:undefined,wPageName:undefined,wRevID:undefined,wServer:undefined,wTitle:undefined,wUserLang:undefined,
    projLang:undefined,projLone:undefined,projType:undefined,userLang:undefined
    };
    WSTM.ia=false;}
    WSTM.g.fetch=function(assign,access,apply){
    var r,v;
    if(apply){
    if(typeof this[apply]!==undefined){
    r=this[apply];}
    }else{
    r=assign;}
    if(r===undefined){
    if(!this.mediaWiki){
    if(typeof window==="object"&&window&&typeof window.mediaWiki==="object"){
    this.mediaWiki=window.mediaWiki;
    r=this.mediaWiki;}}
    if(this.mediaWiki){
    if(access){
    v=mw.config.get(access);
    if(v!==null&&access){
    switch(access){
    case "wgCurRevisionId":
    this.wRevID=v;
    break;
    case "wgDBname":
    this.wDBname=v;
    break;
    case "wgNamespaceIds":
    this.wNsIds=v;
    break;
    case "wgNamespaceNumber":
    this.wNsNumber=v;
    break;
    case "wgPageName":
    this.wPageName=v;
    break;
    case "wgServer":
    this.wServer=v;
    break;
    case "wgTitle":
    this.wTitle=v;
    break;
    case "wgUserLanguage":
    this.wUserLang=v;
    break;}
    r=v;}
    }else{
    r=this.mediaWiki;}}}
    return r;
    };
    WSTM.util.fiatObjects(WSTM,"config",{lang:{},load:{},page:{}});
    if(typeof(WSTM.config.load.after)!=="function"){
    WSTM.config.load.after=false;}
    };
    mw.libs.WikiSyntaxTextMod.bb.config(mw.libs.WikiSyntaxTextMod);
    delete mw.libs.WikiSyntaxTextMod.bb.config;
    mw.libs.WikiSyntaxTextMod.bb.str=function(WSTM){
    "use strict";
    WSTM.util.fiatObjects(WSTM,"str",{});
    WSTM.str.fromNum=function(adjust){
    return adjust.toString();
    };
    };
    mw.libs.WikiSyntaxTextMod.bb.str(mw.libs.WikiSyntaxTextMod);
    delete mw.libs.WikiSyntaxTextMod.bb.str;
    mw.libs.WikiSyntaxTextMod.bb.api=function(WSTM){
    "use strict";
    WSTM.util.fiatObjects(WSTM,"api",{loaded:false});
    WSTM.api.isAppropriate=function(advanced){
    var pg=WSTM.config.page,r=false,suffixes=".css.js.lua.uue.",i,leeway,legal,select;
    WSTM.g.fetch(false,"wgNamespaceNumber","wNsNumber");
    WSTM.g.fetch(false,"wgTitle","wTitle");
    if(typeof(WSTM.g.wNsNumber)==="number"&&typeof(WSTM.g.wTitle)==="string"){
    leeway=false;
    legal=(WSTM.g.wNsNumber===0);
    if(WSTM.g.wNsNumber>=0&&WSTM.g.wNsNumber%2===0&&WSTM.g.wNsNumber!==8){
    leeway=true;
    if(mw.util.getParamValue("oldid")){
    if(typeof(pg.oldid)!=="boolean"){
    pg.oldid=false;}
    leeway=pg.oldid;
    legal=leeway;}
    if(WSTM.g.wNsNumber){
    if(mw.config.get("wgPageContentModel")==="wikitext"){
    i=WSTM.g.wTitle.lastIndexOf(".");
    if(i>0){
    select=WSTM.g.wTitle.substr(i).toLowerCase();
    if(suffixes.indexOf(select+".")>=0){
    leeway=false;
    legal=false;}}
    }else{
    leeway=false;
    legal=false;}}
    if(leeway&&!WSTM.main.isEditable()){
    leeway=false;
    legal=false;}}
    if(!legal&&leeway){
    if(typeof(pg.include)==="object"){
    legal=WSTM.main.isPageMatch(pg.include);}
    if(!legal&&advanced===true){
    select=typeof(pg.support);
    if(select==="object"){
    legal=WSTM.main.isPageMatch(pg.support);
    }else if(select==="boolean"){
    legal=pg.support;}}}
    if(legal){
    if(typeof(pg.exclude)==="object"){
    legal=!WSTM.main.isPageMatch(pg.exclude);}}
    r=legal;
    }else{
    mw.log(WSTM.debugging,".api.isAppropriate()   failed g.fetch",3);}
    return r;
    };
    WSTM.api.load=function(action){
    WSTM.prefs.first(function(){
    WSTM.main.further(action);
    });
    };
    WSTM.api.run=function(){
    if(typeof(WSTM.config.page.oldid)!=="boolean"){
    WSTM.config.page.oldid=true;}
    if(WSTM.api.isAppropriate(true)){
    WSTM.api.load(true);}
    return void(0);
    };
    };
    mw.libs.WikiSyntaxTextMod.bb.api(mw.libs.WikiSyntaxTextMod);
    delete mw.libs.WikiSyntaxTextMod.bb.api;
    mw.libs.WikiSyntaxTextMod.bb.errors=function(WSTM){
    "use strict";
    WSTM.util.fiatObjects(WSTM,"errors",{});
    WSTM.errors.swift="WikiSyntaxTextMod_errors";
    WSTM.errors.fault=function(){
    WSTM.errors.format();
    };
    WSTM.errors.fetch=function(){
    var r=false,s=WSTM.main.textarea(false,false),i,j,k,n,scan,story;
    this.story=false;
    if(typeof(s)==="string"){
    scan=this.frozen();
    i=s.indexOf(scan);
    if(i>=0){
    n=scan.length;
    j=s.indexOf("-->",i+n);
    if(j>=0){
    story=s.slice(i+n,j);
    k=story.indexOf("\n");
    j+=3;
    if(s.charCodeAt(j)===10){
    j++;}
    s=(i>0?s.substr(0,i):"")+s.substr(j);
    WSTM.main.textarea(s,true);
    r=(k>=0);
    if(r){
    this.story=story.substr(k);}}}
    }else{
    mw.log(WSTM.debugging,".errors.fetch()  Textarea failed",3);}
    return r;
    };
    WSTM.errors.find=function(){
    var r=false,s;
    this.swap=false;
    if(typeof(window.sessionStorage)==="object"){
    s=window.sessionStorage.getItem(this.swift);
    if(typeof(s)==="string"){
    if(s){
    this.fixing();
    this.joint=s.indexOf(this.starter);
    if(this.joint>=0){
    this.swap=s;
    r=s;}
    window.sessionStorage.setItem(this.swift,"");}}}
    return r;
    };
    WSTM.errors.fixing=function(){
    if(!this.starter){
    WSTM.g.fetch(false,"wgCurRevisionId","wRevID");
    this.starter="<WSTM id='"+WSTM.g.wRevID+"'>";}
    };
    WSTM.errors.frozen=function(){
    var s=" ##";
    return "<!-- WikiSyntaxTextMod"+s+" ERROR in PAGE"+s;
    };
    };
    mw.libs.WikiSyntaxTextMod.bb.errors(mw.libs.WikiSyntaxTextMod);
    delete mw.libs.WikiSyntaxTextMod.bb.errors;
    mw.libs.WikiSyntaxTextMod.bb.main=function(WSTM){
    "use strict";
    if(typeof(WSTM.main)!=="object"){
    WSTM.main={};}
    WSTM.main.bb=false;
    WSTM.main.fiat=false;
    WSTM.main.scheme=false;
    WSTM.main.score="r";
    WSTM.main.self="User:PerfektesChaos";
    WSTM.main.seal="user:PerfektesChaos/WikiSyntaxTextMod";
    WSTM.main.server="en.wikipedia.org";
    WSTM.main.site="";
    WSTM.main.subdir="WikiSyntaxTextMod";
    WSTM.main.swift="WikiSyntaxTextMod_rvIDs";
    WSTM.main.vc={next:0,rv:false};
    if(typeof WSTM.debugging.site==="string"){
    WSTM.main.site=WSTM.debugging.site;}
    if(typeof WSTM.vsn==="number"){
    if(typeof WSTM.debugging.prefix==="string"){
    WSTM.main.score=WSTM.debugging.prefix;
    }else if(WSTM.vsn<0){
    WSTM.main.score="d";}
    WSTM.vsn=WSTM.main.site+"("+WSTM.main.score+") Run="+WSTM.vsn;}
    if(typeof(WSTM.debugging.subdir)==="string"){
    WSTM.main.subdir=WSTM.debugging.subdir;}
    if(typeof(WSTM.debugging.subs)==="string"){
    WSTM.main.subs=WSTM.debugging.subs;
    }else{
    WSTM.main.subs="MWCEIHTXOLUS";
    if(WSTM.main.site==="file:/"){
    WSTM.main.subs=WSTM.main.subs+"Z";}}
    WSTM.main.actionSubmit=function(){
    var load=false;
    if(WSTM.errors.fetch()){
    load=true;
    }else if(WSTM.errors.find()){
    load=true;}
    if(load){
    WSTM.api.load(WSTM.errors.fault);}
    };
    WSTM.main.features=function(arrange,alter){
    var IAEXT;
    if(typeof(window)==="object"){
    WSTM.util.fiatObjects(WSTM,"ia",{ext:false,$editform:false,$textarea:false});
    if(typeof(arrange)!=="boolean"){
    WSTM.util.fiatObjects(WSTM.ia,"ext",{});
    IAEXT=WSTM.ia.ext;
    if(typeof(mw.libs.editToolStrIns)==="object"){
    IAEXT.editToolStrIns=false;}
    if(typeof(window.wikEd)==="object"&&window.wikEd&&window.wikEd.UpdateTextarea&&!IAEXT.wikEd){
    IAEXT.wikEd={skipWSTM:true,setupWSTM:false,beginWSTM:false,disabled:window.wikEd.disabled,highlightSyntax:window.wikEd.highlightSyntax,turnedOn:window.wikEd.turnedOn,useWikEd:window.wikEd.useWikEd};
    if(window.document
    .getElementsByName("wikEdStartupFlag")[0]){
    if(window.wikEd.origVersion===window.wikEd.lastVersion){
    IAEXT.wikEd.beginWSTM=true;
    window.wikEd.highlightSyntax=false;
    window.wikEd.disabled=true;}
    }else if(typeof(window.wikEd.Setup)==="function"&&!window.wikEd.disabled&&window.wikEd.turnedOn&&window.wikEd.useWikEd){
    try{
    window.wikEd.RemoveEventListener(window,"load",window.wikEd.Setup,false);
    }catch(e1){
    }
    try{
    window.wikEd.RemoveEventListener(window.document,"DOMContentLoaded",window.wikEd.Setup,false);
    }catch(e2){
    }}}
    }else if(WSTM.ia.ext){
    IAEXT=WSTM.ia.ext;
    if(IAEXT.wikEd){
    if(arrange){
    if(IAEXT.wikEd.beginWSTM){
    if(typeof(IAEXT.wikEd.disabled)==="boolean"){
    IAEXT.wikEd.setupWSTM=true;}}
    if(!IAEXT.wikEd.setupWSTM&&!IAEXT.wikEd.beginWSTM){
    if(IAEXT.wikEd.flag){
    IAEXT.wikEd.flag.removeAttribute("name");
    IAEXT.wikEd.flag=false;}
    if(typeof(window.wikEd.Setup)==="function"){
    window.wikEd.Setup();}
    IAEXT.wikEd.disabled=window.wikEd.disabled;
    window.wikEd.disabled=false;
    IAEXT.wikEd.setupWSTM=true;}}
    if(!IAEXT.wikEd.beginWSTM&&!window.wikEd.disabled&&window.wikEd.turnedOn&&window.wikEd.useWikEd){
    if(arrange){
    window.wikEd.UpdateTextarea();
    window.wikEd.config.onHook.push(WSTM.main.features);
    }else{
    if(alter){
    window.wikEd.highlightSyntax=IAEXT.wikEd.highlightSyntax;
    window.wikEd.useWikEd=IAEXT.wikEd.useWikEd;
    if(window.wikEd.useWikEd){
    window.wikEd.UpdateFrame(null);}
    }else{
    window.wikEd.disabled=true;
    window.wikEd.useWikEd=false;}}
    IAEXT.wikEd.beginWSTM=false;}}}}
    };
    WSTM.main.fire=function(){
    var fun;
    WSTM.main.ready(true);
    WSTM.api.loaded=true;
    if(WSTM.g.wNsNumber===-1){
    WSTM.prefs.form();
    }else if(WSTM.main.fiat){
    if(typeof WSTM.main.fiat==="function"){
    fun=WSTM.main.fiat;
    }else{
    fun=WSTM.main.full;}
    WSTM.main.fiat=false;
    WSTM.main.features();
    window.jQuery(function(){
    WSTM.main.features();
    if(fun===WSTM.main.full){
    WSTM.prefs.first(WSTM.main.full);
    }else{
    fun();}
    });}
    };
    WSTM.main.focus=function(){
    var $r=false,$e;
    if(typeof(window)==="object"){
    if(typeof(mw.util)==="object"){
    mw.util.addCSS(".cn-fundraiser-banner,#mw-js-message,#siteNotice,#fundraising\n{display: none;}");}
    if(typeof(window.jQuery)==="function"){
    if(window.jQuery("#bodyContent").length){
    $e=window.jQuery("#bodyContent");
    }else if(window.jQuery("#article").length){
    $e=window.jQuery("#article");
    }else{
    $e=window.jQuery("#content");}
    if($e.length){
    $r=$e;}}}
    return $r;
    };
    WSTM.main.follow=function(){
    WSTM.prefs.fetch();
    if(WSTM.config.portlet){
    window.jQuery(WSTM.main.force);}
    };
    WSTM.main.force=function(){
    var say="Start WikiSyntaxTextMod * Version: "+WSTM.vsn,scope=false,select="ca-WSTM-run",show=WSTM.type,stick=false,swift=null,s,$li;
    if(typeof(WSTM.config.portlet)==="object"){
    s=WSTM.config.portlet.scope;
    if(typeof(s)==="string"){
    s=window.jQuery.trim(s);
    if(s.charCodeAt(0)===35){
    s=s.substr(1);}
    if(s.length){
    scope=s;}}
    s=WSTM.config.portlet.show;
    if(typeof(s)==="string"){
    s=window.jQuery.trim(s);
    if(s.length){
    show=s;}}
    s=WSTM.config.portlet.stick;
    if(typeof(s)==="string"){
    s=window.jQuery.trim(s);
    if(s.length){
    stick=s;}}
    s=WSTM.config.portlet.swift;
    if(typeof(s)==="string"){
    s=window.jQuery.trim(s);
    if(s.length){
    swift=s;}}
    }else{
    WSTM.config.portlet={};}
    if(!scope){
    if(mw.config.get("skin")==="vector"){
    scope="p-cactions";}}
    if(scope==="p-cactions"){
    $li=window.jQuery(window.document).find("#p-cactions .menu li");
    if($li.length){
    stick=$li.get(0);
    }else{
    stick="#-";}
    }else if(!scope){
    scope="p-tb";}
    if(!stick){
    if(scope==="p-tb"){
    stick="#t-whatlinkshere";}}
    if(typeof WSTM.main.$portlet==="object"){
    WSTM.main.$portlet.remove();}
    WSTM.main.$portlet=mw.util.addPortletLink(scope,"#",show,select,say,swift,stick);
    WSTM.main.$portlet=window.jQuery(WSTM.main.$portlet);
    WSTM.main.$portlet.click(function(){WSTM.api.load(true);});
    };
    WSTM.main.further=function(action){
    var lazy=(action!==false&&!WSTM.api.loaded),local=false,b,i,k,n,s,saver,script,sign,stamp,use;
    if(!WSTM.api.loaded&&typeof WSTM.debugging==="object"){
    if(typeof WSTM.debugging.feeder==="function"){
    if(action){
    local=WSTM.debugging.feeder(WSTM.main.subs);
    }else{
    local=true;}
    }else if(WSTM.debugging.loud){
    lazy=false;}}
    if(action){
    b=typeof action;
    if(b==="function"||b==="boolean"){
    WSTM.main.fiat=action;
    if(action===true){
    WSTM.prefs.first();}}}
    if(WSTM.api.loaded&&action){
    WSTM.prefs.first(WSTM.main.fire);
    }else if(!local){
    k=(WSTM.main.site==="test"?9:7);
    saver=false;
    stamp=WSTM.util.yymmddhhmmss(new Date());
    WSTM.vsn=WSTM.vsn+"*";
    n=(action?WSTM.main.subs.length:0);
    script=WSTM.main.self+"/js/"+WSTM.main.subdir+"/"+WSTM.main.score;
    stamp=stamp.substr(0,k);
    if(n>0){
    use=[];
    for(i=0;i<n;i++){
    s=WSTM.main.subs.substr(i,1);
    saver=WSTM.main.vc.get(s);
    if(!saver){
    saver=stamp;}
    sign=WSTM.main.seal+"/"+s;
    WSTM.main.load(sign,WSTM.main.server,script+s+".js",saver);
    use.push(sign);}}
    if(action||WSTM.g.wNsNumber===-1){
    WSTM.prefs.first(WSTM.main.fire,use);}
    WSTM.main.vc.update();}
    };
    WSTM.main.isEditable=function(){
    var env=mw.config.get(["wgRestrictionEdit","wgUserGroups"]),dont=env.wgRestrictionEdit,r=true,groups,i,j,m,n,ng,p,trsl;
    if(dont&&typeof(dont)==="object"){
    n=dont.length;
    if(n){
    groups=env.wgUserGroups;
    r=false;
    if(groups){
    ng=groups.length;
    if(ng){
    trsl={autoconfirmed:"autoconfirmed",editeditorprotected:"editor",sysop:"sysop"};
    m=n;
    for(i=0;i<n;i++){
    p=trsl[dont[i]];
    if(p){
    for(j=0;j<ng;j++){
    if(p===groups[j]){
    m--;
    break;}}
    }else{
    m--;}}
    r=(m===0);}}}}
    return r;
    };
    WSTM.main.isPageMatch=function(accomplish){
    var f=false,e,i,k,n,r;
    if(window.jQuery.isArray(accomplish)){
    WSTM.g.fetch(false,"wgDBname","wDBname");
    WSTM.g.fetch(false,"wgPageName","wPageName");
    if(WSTM.g.wDBname!==null&&WSTM.g.wPageName!==null){
    n=accomplish.length;
    for(i=0;i<n;i++){
    e=accomplish[i];
    if(typeof(e)==="string"){
    if(e.charCodeAt(0)===58){
    k=WSTM.g.wDBname.length;
    if(e.charCodeAt(k+1)!==58){
    k=false;
    }else if(e.substr(1,k)!==WSTM.g.wDBname){
    k=false;
    }else{
    e="^"+e.substr(k+2);}
    if(!k){
    k=e.substr(1).indexOf(":");
    r="^"+e.substr(1,k)+"$";
    r=new RegExp(r,"i");
    if(r.test(WSTM.g.wDBname)){
    e="^"+e.substr(k+2);
    }else{
    e=false;}}}
    if(e){
    r=new RegExp(e,"i");
    f=r.test(WSTM.g.wPageName);
    if(f){
    break;}}}}}}
    return f;
    };
    WSTM.main.load=function(assigned,at,access,age,after){
    var rls,s;
    if(!mw.loader.getState(assigned)){
    rls={};
    rls[assigned]="loading";
    mw.loader.state(rls);
    s="https://"+at+"/w/index.php?title="+access+"&action=raw&ctype=text/javascript";
    if(age){
    s=s+"&bcache=1&maxage="+age;}
    if(after){
    s=s+"&"+after+"*";}
    mw.loader.load(s);}
    };
    WSTM.main.ready=function(all){
    var sign=this.seal+(all?"/*":""),rls;
    if(all){
    WSTM.api.loaded=true;}
    if(mw.loader.getState(sign)!=="ready"){
    rls={};
    rls[sign]="ready";
    mw.loader.state(rls);}
    if(typeof mw.hook!=="undefined"){
    mw.hook("WikiSyntaxTextMod.ready").fire();
    if(all){
    mw.hook("WikiSyntaxTextMod/*.ready").fire();}}
    if(typeof window.jQuery==="function"){
    window.jQuery(window.document).trigger("loadWikiScript",[sign]);}
    };
    WSTM.main.textarea=function(alter,advance){
    var r=false,$box,$form;
    if(WSTM.ia){
    if(!WSTM.ia.$editform){
    $form=window.jQuery("#editform");
    if($form.length){
    $box=window.jQuery("#wpTextbox1");
    if($box.length){
    if(!$box.attr("readonly")){
    WSTM.ia.$editform=$form;
    WSTM.ia.$textarea=$box;}}}}
    if(WSTM.ia.$textarea){
    this.features(true);
    if(typeof(alter)==="string"){
    WSTM.ia.$textarea.val(alter);
    this.features(false,!advance);
    }else{
    r=WSTM.ia.$textarea.val();}}}
    return r;
    };
    WSTM.main.wait=function(aware,aged){
    var launch=true,n=this.subs.length,e,i,s;
    if(!this.bb){
    this.bb={};}
    for(i=0;i<n;i++){
    s=this.subs.substr(i,1);
    if(!this.bb[s]){
    this.bb[s]={load:false,vsn:0};}}
    for(i=0;i<n;i++){
    s=this.subs.substr(i,1);
    e=this.bb[s];
    if(s===aware){
    if(!e.load){
    e.vsn=aged;
    e.load=true;
    WSTM.vsn=WSTM.vsn+", "+aware+"="+aged;}
    }else if(!e.load){
    launch=false;}}
    if(typeof this.$portlet==="object"){
    s="Start WikiSyntaxTextMod * Version: "+WSTM.vsn;
    this.$portlet.find("a").attr("title",s);}
    if(launch&&!WSTM.api.loaded){
    this.fire();}
    };
    WSTM.main.vc.format=function(about,assign){
    var r=this.score+about+"_"+assign+"~";
    if(this.site.length){
    r=this.site+"-"+r;}
    return r;
    };
    WSTM.main.vc.get=function(about){
    var i,r,rv,s,store;
    if(this.rv){
    r=this.rv[about];
    }else{
    this.rv={};
    r=false;
    if(typeof window.localStorage==="object"){
    try{
    store=window.localStorage.getItem(WSTM.main.swift);
    }catch(err){
    }
    }else{
    store=window.mw.cookie.get(WSTM.main.swift);}
    if(store){
    rv=store.split("~");
    if(rv[0]){
    this.next=parseInt(rv[0],10);
    if(!isNaN(this.next)&&this.next>0){
    for(i=1;i<rv.length;i++){
    s=rv[i];
    if(s.substr(0,1)===WSTM.main.score){
    this.rv[s.substr(1,1)]=parseInt(s.substr(3),10);}}
    r=this.rv[about];}}}}
    return r;
    };
    WSTM.main.vc.put=function(arrived){
    var date,e,i,k,rv,store,sub;
    if(typeof arrived==="object"&&arrived&&typeof arrived.revisions==="object"&&arrived.revisions&&typeof arrived.revisions.length==="number"){
    date=new Date();
    store=date.valueOf()+"~";
    sub="js/"+WSTM.main.subdir+"/";
    k=sub.length;
    rv=arrived.revisions;
    for(i=0;i<rv.length;i++){
    e=rv[i];
    if(typeof e==="object"&&e&&typeof e.src==="string"&&typeof e.id==="number"){
    if(e.src.substr(0,k)===sub&&e.src.substr(k+1,1)!=="."&&e.id){
    store=store+e.src.substr(k,2)+"_"+e.id+"~";}}}
    if(typeof window.localStorage==="object"){
    try{
    window.localStorage.setItem(WSTM.main.swift,store);
    }catch(err){
    }
    }else{
    window.mw.cookie.set(WSTM.main.swift,store,{expires:7,path:"/"});}}
    };
    WSTM.main.vc.update=function(){
    var date,max;
    if(typeof mw.hook!=="undefined"){
    date=new Date();
    max=(WSTM.main.score==="d"?1000000:86400000);
    if(date.valueOf()-max>this.next){
    WSTM.main.load("user:PerfektesChaos/versionControl","en.wikipedia.org","User:PerfektesChaos/js/versionControl/"+WSTM.main.score+".js");
    mw.hook("user:PerfektesChaos/versionControl.retrieve")
    .fire({"site":"en.wikipedia.org",
    "space":"User:PerfektesChaos",
    "store":"versionControl"},function(answer){
    WSTM.main.vc.put(answer);
    });}}
    };
    };
    mw.libs.WikiSyntaxTextMod.bb.main(mw.libs.WikiSyntaxTextMod);
    delete mw.libs.WikiSyntaxTextMod.bb.main;
    mw.libs.WikiSyntaxTextMod.bb.prefs=function(WSTM){
    "use strict";
    WSTM.util.fiatObjects(WSTM,"prefs",{loaded:false,supply:"preferencesGadgetOptions"});
    WSTM.prefs.fetch=function(){
    var vals=false;
    if(typeof mw.libs[this.supply]==="object"&&mw.libs[this.supply]&&mw.libs[this.supply].fetch){
    vals=mw.libs[this.supply].fetch(WSTM.type);}
    if(vals){
    WSTM.config.diffPage=vals.diffPage;
    if(!WSTM.config.portlet||typeof WSTM.config.portlet==="boolean"){
    WSTM.config.portlet=vals.portlet;}}
    };
    WSTM.prefs.first=function(after,also){
    WSTM.main.load("ext.gadget."+this.supply,"en.wikipedia.org","User:PerfektesChaos/js/"+this.supply+"/r.js",604801);
    if(after){
    if(also){
    mw.loader.using(also,function(){WSTM.prefs.follow(after);
    });
    }else{
    WSTM.prefs.follow(after);}}
    };
    WSTM.prefs.follow=function(action){
    if(WSTM.prefs.loaded){
    action();
    }else{
    mw.hook(WSTM.prefs.supply+".ready").add(function(){WSTM.prefs.loaded=true;
    action();
    });}
    };
    };
    mw.libs.WikiSyntaxTextMod.bb.prefs(mw.libs.WikiSyntaxTextMod);
    delete mw.libs.WikiSyntaxTextMod.bb.prefs;
    if(typeof(window)==="object"&&window){
    window.WikiSyntaxTextMod_About=function(){
    /// 2018-09-03 [email protected]
    "use strict";
    var r=mw.libs.WikiSyntaxTextMod.vsn,$c,$m;
    if(typeof window==="object"){
    $c=mw.libs.WikiSyntaxTextMod.main.focus();
    if($c){
    $m=window.jQuery("<div>");
    $m.css("border","solid 1px #0000FF").text(r);
    $c.before($m);}
    if(typeof window.console==="object"&&typeof window.console.info==="function"){
    window.console.info(r);}
    if(typeof window.alert==="function"){
    window.alert(r);}
    r=void(0);}
    return r;
    };
    window.WikiSyntaxTextMod_Run=function(){
    "use strict";
    mw.libs.WikiSyntaxTextMod.api.run();
    return void(0);
    };}
    mw.libs.WikiSyntaxTextMod.bb.auto=function(WSTM){
    "use strict";
    WSTM.autoRun=function(){
    var launch=false,lookup=false,luxury=false,later,learn,load,lock,re,start;
    WSTM.main.lockAuto=true;
    WSTM.g.fetch(false,"wgNamespaceNumber","wNsNumber");
    lock=(WSTM.g.wNsNumber===-1);
    if(lock){
    luxury=(mw.config.get("wgCanonicalSpecialPageName")==="Blankpage");
    }else{
    WSTM.config.load.urlPar=mw.util.getParamValue("wstm");
    if(typeof(WSTM.config.load.urlPar)==="string"){
    if(/^(0|false$|n|inhibit)/.test(WSTM.config.load.urlPar)){
    lock=true;}}
    if(typeof(WSTM.config.load.inhibit)==="boolean"){
    lock=WSTM.config.load.inhibit;}
    load=!lock;
    if(load){
    if(WSTM.g.fetch(undefined,false)){
    load=!mw.config.get("wgIsArticle");}}}
    if(load){
    start=mw.util.getParamValue("action");
    learn=false;
    if(start==="edit"){
    learn=(!(mw.util.getParamValue("undo")||mw.util.getParamValue("undoafter")));
    }else if(start==="submit"){
    lookup=true;}
    if(learn||lookup){
    load=WSTM.api.isAppropriate(false);
    launch=learn;
    if(lookup){
    lookup=(WSTM.g.wNsNumber%2===0);
    if(lookup){
    lookup=WSTM.api.isAppropriate(true);}}}}
    if(!load){
    if(typeof(WSTM.config.load.updater)==="string"){
    if(WSTM.config.load.updater.length){
    WSTM.g.fetch(false,"wgPageName","wPageName");
    if(WSTM.g.wPageName!==null){
    re=new RegExp(WSTM.config.load.updater,"i");
    load=(re.test(WSTM.g.wPageName));}
    }else{
    load=true;}}}
    if(load||luxury||WSTM.config.load.api){
    WSTM.api.load(launch||luxury);}
    if(lookup||launch){
    if(lookup){
    WSTM.main.features();
    WSTM.prefs.first(function(){
    window.jQuery(WSTM.main.actionSubmit);
    });}
    if(!lookup&&launch){
    later=WSTM.api.isAppropriate(true);
    }else{
    later=lookup;}
    if(later){
    WSTM.prefs.first(WSTM.main.follow);}}
    return void(0);
    };
    if(typeof window==="object"){
    if(typeof WSTM.main.lockAuto!=="boolean"&&typeof mw==="object"&&typeof mw.loader==="object"){
    WSTM.main.lockAuto=true;
    WSTM.main.ready(false);
    mw.loader.using(["user","user.options","mediawiki.user","mediawiki.util","mediawiki.cookie"],WSTM.autoRun);}}
    if(typeof WSTM.config.load==="object"){
    if(typeof WSTM.config.load.after==="function"){
    WSTM.config.load.after();}}
    };
    mw.libs.WikiSyntaxTextMod.bb.auto(mw.libs.WikiSyntaxTextMod);
    delete mw.libs.WikiSyntaxTextMod.bb.auto;
    void(0);
    /// EOF</nowiki>WikiSyntaxTextMod/r.js