Jump to content

User:PerfektesChaos/js/WikiSyntaxTextMod/rW.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/rW.js
/// 2023-05-10 PerfektesChaos@de.wikipedia
/// Fingerprint:#0#B0F660C3#
/// @license:CC-by-sa/4.0 GPLv3
///<nowiki>
if(typeof mediaWiki!=="object"){
mw={libs:{WikiSyntaxTextMod:{}
},log:function(){"use strict";}
};}
(function(mw){
"use strict";
var version=7.67,sign="WikiSyntaxTextMod",sub="W",rls,self,WSTM;
if(typeof mw.loader==="object"){
rls={};
self="user:PerfektesChaos/"+sign+"/"+sub;
rls[self]="loading";
mw.loader.state(rls);}
if(typeof mw.libs[sign]!=="object"){
mw.libs[sign]={};}
WSTM=mw.libs[sign];
if(typeof WSTM.w!=="object"){
WSTM.w={};}
WSTM.w.vsn=version;
WSTM.w.self=self;
if(typeof WSTM.bb!=="object"){
WSTM.bb={};}
if(typeof WSTM.debugging!=="object"){
WSTM.debugging={};}
}(mw));
mw.libs.WikiSyntaxTextMod.bb.bbW=function(WSTM){
"use strict";
if(typeof WSTM.util!=="object"){
WSTM.util={};}
if(typeof WSTM.util.fiatObjects!=="function"){
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){
elt=assign[s];
if(typeof elt==="object"){
WSTM.util.fiatObjects(obj,s,elt);}}}
};}
WSTM.util.fiatObjects(WSTM,"debugging",{loud:false});
};
mw.libs.WikiSyntaxTextMod.bb.bbW(mw.libs.WikiSyntaxTextMod);
delete mw.libs.WikiSyntaxTextMod.bb.bbW;
mw.libs.WikiSyntaxTextMod.bb.W=function(WSTM){
"use strict";
WSTM.util.fiatObjects(WSTM,"g",{learnt:false,re:{},s:{re:{}}
});
if(typeof mw.libs.WikiSyntaxTextMod.str!=="object"){
mw.libs.WikiSyntaxTextMod.str={};}
WSTM.str.locateEntities=false;
WSTM.str.sortLang=false;
};
mw.libs.WikiSyntaxTextMod.bb.W(mw.libs.WikiSyntaxTextMod);
delete mw.libs.WikiSyntaxTextMod.bb.W;
mw.libs.WikiSyntaxTextMod.bb.apiW=function(WSTM){
"use strict";
if(typeof WSTM.api!=="object"){
WSTM.api={};}
WSTM.api.textMod=function(adjust){
var r=false,re=new RegExp("\n[ "+WSTM.str.spaces+"]+\n","g"),score=adjust,ext,s;
if(typeof window==="object"&&typeof WSTM.debugging==="object"&&WSTM.debugging.loud&&typeof window.console==="object"&&window.console){
if(typeof window.console.clear==="function"){
window.console.clear();}
if(WSTM.xDebug){
mw.log(WSTM.debugging,".api.textMod()",0);}
}else{
WSTM.xDebug=false;}
WSTM.errors.first();
WSTM.w.elem.furnish();
WSTM.mod.furnish();
WSTM.g.factory();
WSTM.w.encountered={bidichar:false,biditemplate:false,cats:false,indent:false,isbn:false,iwiki:false,refgroups:false,table:false};
WSTM.str.locateEntities=true;
if(WSTM.mod.comment){
WSTM.w.tags.frozen();}
WSTM.text=new WSTM.o.WikiTom(adjust,null);
WSTM.w.chr.filter(WSTM.text);
if(WSTM.Z){
WSTM.Z.fire();}
WSTM.text.fold(-1,-1,false,true);
WSTM.w.elem.hashmagic();
WSTM.w.tags.fire(WSTM.text);
WSTM.w.chr.flip(WSTM.text);
WSTM.mod.lock=(WSTM.mod.lock||WSTM.w.chr.detected.exchange||WSTM.w.chr.detected.nbHyphen||WSTM.w.chr.detected.ordMasc);
if(WSTM.mod.table){
WSTM.w.elem.tables.furnish();}
if(WSTM.mod.plain&&!WSTM.mod.plain.stm){
WSTM.mod.plain.stm=WSTM.util.translate.further(WSTM.mod.plain.raw,false,WSTM.mod.plain.name,WSTM.mod.lenient);}
WSTM.w.template.findISBN();
WSTM.w.template.fire(WSTM.text,true);
WSTM.w.link.fire(WSTM.text,true,WSTM.mod.lock,false);
WSTM.w.elem.fire();
if(WSTM.mod.lock&&WSTM.w.encountered.indent){
WSTM.w.elem.fixed(WSTM.text,true);}
WSTM.w.elem.finishing();
WSTM.hooks.finalize(false);
if(WSTM.mod.plain&&WSTM.mod.plain.stm){
WSTM.text.replace(WSTM.mod.plain.stm,false);}
if(WSTM.text.learnt||WSTM.w.chr.detected.tabEOL){
score=WSTM.text.toString();}
if(typeof WSTM.mod.hook==="function"){
s=WSTM.mod.hook(score);
if(s!==score&&typeof s==="string"){
score=s;
WSTM.mod.lazy=false;}}
if(typeof WSTM.config==="object"&&WSTM.config&&typeof WSTM.config.mod==="object"&&WSTM.config.mod&&typeof WSTM.config.mod.hook==="function"){
s=WSTM.config.mod.hook(score);
if(s!==score){
if(typeof s==="string"){
score=s;
WSTM.mod.lazy=false;}}}
if(score!==adjust){
re=new RegExp("([^=\\]|[^=]= |==)[ "+WSTM.str.spaces+"]+"+"\n","g");
score=score.replace(re,"$1\n");
ext=score.length-1;
if(score.charCodeAt(ext)===10){
while(score.charCodeAt(ext-1)===10){
score=score.substr(0,ext);
ext--;}}}
if(score!==adjust){
r=[score,WSTM.mod.lazy];}
return r;
};
};
mw.libs.WikiSyntaxTextMod.bb.apiW(mw.libs.WikiSyntaxTextMod);
delete mw.libs.WikiSyntaxTextMod.bb.apiW;
(function(WSTM){
"use strict";
var sub="W",self=WSTM.w.self,version=WSTM.w.vsn,rls;
if(typeof WSTM.main!=="object"){
WSTM.main={};}
if(!WSTM.main.bb){
WSTM.main.bb={};}
WSTM.main.bb[sub]={load:true,vsn:version};
if(typeof WSTM.main.wait==="function"){
WSTM.main.wait(sub,version);}
if(typeof mw.loader==="object"&&typeof mw.hook!=="undefined"){
rls={};
rls[self]="ready";
mw.loader.state(rls);
mw.hook("WikiSyntaxTextMod/"+sub+".ready")
.fire([sub,version]);}
}(mw.libs.WikiSyntaxTextMod));
/// EOF</nowiki>WikiSyntaxTextMod/rW.js