User:PerfektesChaos/js/refNames/prego/r.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
This user script seems to have a documentation page at User:PerfektesChaos/js/refNames/prego/r. |
/// User:PerfektesChaos/js/refNames/prego/r.js
/// 2022-07-28 PerfektesChaos@de.wikipedia
/// Fingerprint:#0#276D0706#
/// License:CC-by-sa/4.0
///<nowiki>
(function(mw){
"use strict";
var Version=1.0,Signature="refNames",THIS={doc:false,opts:{},sub:"prego"};
THIS.texts={
"^show":{"en":Signature},
"^suffix":{"en":"– <ref name=""> Show and change ref identifiers",
"de":"– <ref name=""> Anzeige und Änderung von ref-Bezeichnern"},
"^^spaces":{"en":"Space separated list of namespace numbers, or star '*' for all",
"de":"Namensraum-Nummern, durch Leerzeichen getrennt, oder Stern '*' für alle"},
"^^strange":{"en":"Regular expression for undesired name patterns",
"de":"Regulärer Ausdruck für unerwünschte Muster von name="},
"^^shoot":{"en":"Namespace numbers to launch at preview (space separated)",
"de":"Namensraum-Nummern zur Auslösung in der Seitenvorschau (durch Leerzeichen getrennt)"}
};
function fiat(){
var opts=[],dialog,i,s;
for(i=0;i<THIS.pars.length;i++){
s=THIS.pars[i][0];
opts.push({signature:s,type:"text",show:THIS.texts["^^"+s],val:THIS.opts[s]});}
dialog={script:Signature,show:THIS.texts["^show"],suffix:THIS.texts["^suffix"],opts:opts};
if(THIS.doc){
dialog.support=THIS.doc.server+"Special:MyLanguage/"+THIS.doc.support;}
if(typeof THIS.prego.fn.form==="function"){
THIS.prego.fn.form(dialog);}}
function fired(above){
var e,i,s;
if(typeof above==="object"&&above&&typeof above.prego==="object"&&above.prego&&typeof above.prego.signature==="string"&&typeof above.prego.pars==="object"&&above.prego.pars&&typeof above.prego.pars.length==="number"){
if(THIS.special.indexOf("/"+above.prego.signature)>0&&typeof mw.libs[above.prego.signature]==="object"&&mw.libs[above.prego.signature]){
THIS.prego={fn:mw.libs[above.prego.signature]};
if(typeof above.doc==="object"&&above.doc&&typeof above.doc.server==="string"&&typeof above.doc.support==="string"){
THIS.doc=above.doc;}
for(i=0;i<above.prego.pars.length;i++){
e=above.prego.pars[i];
if(typeof e[0]==="string"){
s=e[0];
if(typeof above[s]===e[1]){
THIS.opts[s]=above[s];
}else if(e[1]==="string"){
THIS.opts[s]="";}
THIS.pars=THIS.pars||[];
THIS.pars.push(e);}}
if(THIS.pars){
fiat();}}}}
function first(){
var env,rls,s;
THIS.signature="ext.gadget."+Signature+"."+THIS.sub;
if(mw.loader.getState(THIS.signature)!=="ready"){
rls={};
rls[THIS.signature]="ready";
mw.loader.state(rls);
s=Signature+"."+THIS.sub;
env=mw.config.get(["wgCanonicalSpecialPageName","wgTitle"]);
if(env.wgCanonicalSpecialPageName==="Blankpage"&&typeof env.wgTitle==="string"){
THIS.special=env.wgTitle;
mw.hook(s).add(fired);}
mw.hook(s+".ready").fire({type:Signature,sub:THIS.sub,vsn:Version});}}
first();
}(window.mediaWiki));
/// EOF</nowiki>refNames/prego/r.js