Jump to content

User:PerfektesChaos/js/externalLinkProblem/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.
/// User:PerfektesChaos/js/externalLinkProblem/r.js
/// 2018-09-03 PerfektesChaos@de.wikipedia
/// Documentation:[[w:en:User:PerfektesChaos/js/externalLinkProblem]]
/// Fingerprint:#0#A4312E37#
/// @license GPL [//www.mediawiki.org/w/COPYING](+GFDL,LGPL,CC-BY-SA)
///<nowiki>
(function(mw){
"use strict";
var Version=2.92,ELP="externalLinkProblem",featuring,feed;
if(typeof mw.libs[ELP]!=="object"||!mw.libs[ELP]){
mw.libs[ELP]={};}
mw.libs[ELP].type=ELP;
ELP=mw.libs[ELP];
if(typeof ELP.vsn==="undefined"){
if(typeof ELP.config!=="object"||!ELP.config){
ELP.config={};}
ELP.config.wikis={"dewiki":
{idHTTPstat:1378713,idNonASCII:9063042,idPipe:9063048,idSpec:9063045,list:true,raw:{old:["{{Defekter Weblink Bot}}","\n== Toter Weblink ==\n","\n== Toter Weblink 2 ==\n","\n== Defekter Weblink ==\n"]},say:"Defekter Weblink (Bot)",service:"GiftBot",talk:{scratch:"alle erledigt",signing:"efekt",suite:"Wikipedia:Defekte Weblinks/Bot"},template:{scan:"Wikipedia:Defekte Weblinks/Bot",section:["id","Defekte_Weblinks"],seek:"Defekter Weblink",sign:"Lauf",stamp:"2015-10"},trigger:["talk",0]
}
};
ELP.vsn=Version;
ELP.signature="ext.gadget."+ELP.type;
ELP.support="User:PerfektesChaos/js/"+ELP.type;
ELP.doc="[[w:en:"+ELP.support+"]]";}
function factory(ask,age,appoint){
var large,rls;
if(!mw.loader.getState(appoint)){
rls={};
rls[appoint]="loading";
mw.loader.state(rls);
if(ELP.vsn<0){
large=true;
}else if(typeof ELP.debug==="boolean"){
large=ELP.debug;
}else if(window.location.search){
large=/\bdebug=true\b/.test(window.location.search);
}else{
large=false;}
mw.loader.load("https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/"+ask+"/"+(large?"d":"r")+".js&bcache=1&maxage="+(large?"0":age)+"&action=raw&ctype=text/javascript","text/javascript");}}
function features(){
var i,n,pars,s,v,vals;
if(typeof ELP.prego==="object"&&ELP.prego.listen){
ELP.prego.listen=false;
ELP.prego.loading=false;
pars=[["last","boolean"],["later","boolean"],["lazy","boolean"],["levels","boolean"],["list","boolean"],["lone","boolean"],["lookup","boolean"],["loose","boolean"],["low","boolean"],["mode","number"]];
n=pars.length;
for(i=0;i<n;i++){
v=pars[i];
s=v[0];
if(typeof ELP[s]===v[1]){
ELP.config[s]=ELP[s];
}else{
ELP.config[s]=false;}}
if(typeof ELP.prego.supply==="string"){
ELP.prego.lib=mw.libs[ELP.prego.supply];
if(typeof ELP.prego.lib==="object"&&typeof ELP.prego.lib.fetch==="function"){
vals=ELP.prego.lib.fetch(ELP.type);
if(vals&&typeof vals==="object"){
for(i=0;i<n;i++){
v=pars[i];
s=v[0];
if(typeof vals[s]===v[1]){
ELP.config[s]=vals[s];}}}}}}}
featuring=function(action){
if(typeof ELP.prego!=="object"){
ELP.prego={};}
if(typeof ELP.prego.loading==="undefined"){
ELP.prego.loading=true;
ELP.prego.listen=true;
ELP.prego.supply="preferencesGadgetOptions";
ELP.prego.starter=ELP.prego.supply+".ready";
factory(ELP.prego.supply,604808,"ext.gadget."+ELP.prego.supply);
mw.hook(ELP.prego.starter).add(features);}
if(action){
mw.hook(ELP.prego.starter).add(function(){
features();
action();
});}
};
feed=function(access,action){
var maxage=(ELP.vsn>=1?86400:2015),sub="/"+access,signature=ELP.signature+sub,lucky,part;
if(typeof ELP[access]==="object"){
part=ELP[access];
if(part&&typeof part.fire==="function"){
featuring(function(){
part.fire(action);
});
lucky=true;}}
if(!lucky){
if(mw.loader.getState(signature)==="ready"){
mw.log({loud:true},ELP.type+" *** Error .feed() "+access,3,ELP);
}else{
featuring();
factory(ELP.type+sub,maxage,signature);
if(action){
mw.hook(ELP.type+sub+".ready").add(function(){
features();
action();
});}}}
};
function fire(){
var f,i,k,launch,liaison,ns,profile,re,show,site,source;
if(typeof ELP.project==="object"&&ELP.project){
ns=mw.config.get("wgNamespaceNumber");
if(ns===-1){
source=mw.config.get("wgCanonicalSpecialPageName");
switch(source){
case "Blankpage":
case "Gadgets":
ELP.request="prego";
featuring();
f=ELP.features;
break;
case "Recentchanges":
case "Watchlist":
if(typeof ELP.project.list==="boolean"&&ELP.project.list){
ELP.request="watchlist";}
break;}
if(ELP.request){
ELP.special=source;
feed(ELP.request,f);}
}else{
if(typeof ELP.project.trigger==="object"&&ELP.project.trigger){
profile=ELP.project.trigger;
source=profile[0];
liaison=(source==="talk");
if(liaison&&ns===14&&typeof ELP.project.talk==="object"&&ELP.project.talk&&typeof ELP.project.talk.suite==="string"){
re=mw.config.get(["wgAction","wgTitle"]);
if(re.wgAction==="view"&&!re.wgTitle.indexOf(ELP.project.talk.suite)){
ELP.request="category";
feed(ELP.request);}
}else{
for(i=1;i<profile.length;i++){
k=profile[i];
if(k===ns){
ELP.request=[k,true];
break;
}else if(liaison&&k+1===ns){
ELP.request=[k,false];
break;}}
if(ELP.request){
ELP.scope=mw.config.get("wgAction");
show="|edit|info|submit|view|";
launch=(show.indexOf(ELP.scope)>0);
if(launch&&window.location.search){
site=window.location.search;
launch=(site.indexOf("&oldid=")<0);
if(launch&&ELP.scope==="view"){
re="\\b(diff|history|printable)=";
re=new RegExp(re);
launch=!re.test(site);}}
if(launch){
feed(source);}}}}}}}
function first(){
var rls,site;
if(mw.loader.getState(ELP.signature)!=="ready"){
rls={};
rls[ELP.signature]="loading";
mw.loader.state(rls);
ELP.request=false;
ELP.featuring=featuring;
ELP.feed=feed;
if(typeof ELP.project==="undefined"){
site=mw.config.get("wgDBname");
if(typeof ELP.config.wikis[site]==="object"){
ELP.project=ELP.config.wikis[site];
}else{
ELP.project=false;}}
fire();
rls[ELP.signature]="ready";
mw.loader.state(rls);
mw.hook(ELP.type+".ready").fire();}}
first();
}(window.mediaWiki));
/// EOF</nowiki>externalLinkProblem/r.js