Jump to content

User:PerfektesChaos/js/externalLinkProblem/watchlist/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/watchlist/r.js
/// 2018-08-24 PerfektesChaos@de.wikipedia
/// Fingerprint:#0#A68C8C03#
/// @license GPL [//www.mediawiki.org/w/COPYING](+GFDL,LGPL,CC-BY-SA)
///<nowiki>
(function(mw,$){
"use strict";
var Version=2.8,ELP="externalLinkProblem",Sub="watchlist",Supersed="defekterWeblinkBotVorlage",Msec=1000,$Changes;
if(typeof mw.libs[ELP]!=="object"||!mw.libs[ELP]){
mw.libs[ELP]={};}
mw.libs[ELP].type=ELP;
ELP=mw.libs[ELP];
if(typeof ELP[Sub]!=="object"){
ELP[Sub]={};}
ELP[Sub].vsn=Version;
function facilitated(){
var rls,signature,sub;
if(typeof ELP.signature==="string"){
sub="/"+Sub;
signature=ELP.signature+sub;
if(mw.loader.getState(signature)!=="ready"){
rls={};
rls[signature]="ready";
mw.loader.state(rls);
mw.hook(ELP.type+sub+".ready").fire();}}}
function fade(){
var hilite={"font-weight":"bold"},s1="Du verwendest das veraltete Skript ",s3=" – tausche es bitte bald aus gegen: ",$a=$("<a />"),$div=$("<div />"),$span1=$("<span />"),$span2=$("<span />"),$span3=$("<span />");
$a.attr({href:mw.util.getUrl("User:PerfektesChaos/js/"+ELP.type+"#"+Supersed),target:"_blank"});
$a.text(ELP.type);
$a.css(hilite);
$span1.text(s1);
$span2.text(Supersed);
$span2.css(hilite);
$span3.text(s3);
$div.attr({id:ELP.type+"-"+Supersed});
$div.css({"background-color":"#FFFFD0","border":"#808080 2px solid",
"margin-bottom":"1em","margin-top":"1em",
"padding":"1em"});
$div.append($span1);
$div.append($span2);
$div.append($span3);
$div.append($a);
$Changes.before($div);}
function fading(){
var scan,signer;
if(typeof ELP.fliegelflagel!=="boolean"){
scan="|"+mw.config.get("wgUserName")+"|";
signer="|Ahoek|Alexander Sommer|Dr.Haus|ElRaki|FataMorgana|Germandrummer92|Lukas²³|Polarlys|";
ELP.fliegelflagel=(signer.indexOf(scan)<0);
ELP.fliegelflagel=(!(typeof mw.libs.fliegelflagel==="undefined"&&typeof mw.libs.fliegelflagelDefinition==="undefined"));}
if(!ELP.fliegelflagel){
fade();}}
function fiat(){
var i,n,sign,staff,user,$el,$li,$list;
$Changes=$(".mw-changeslist");
if(ELP.config.list){
n=-1;
}else{
n=$Changes.length;}
if(n===1){
sign=ELP.project.talk.signing;
staff=ELP.project.service;
$list=$Changes.find("li");
for(i=$list.length-1;i>=0;i--){
$li=$list.eq(i);
$el=$li.find(".mw-userlink");
user=mw.Title.newFromText($el.text());
if(user&&user.getNameText()===staff){
$el=$li.children(".comment");
if($el.text().indexOf(sign)>=0){
$li.remove();}}}
if(ELP.config.later){
$Changes.show();}}
if(typeof ELP[Supersed]==="boolean"&&ELP[Supersed]){
window.setTimeout(fading,Msec);}}
function fire(){
if(mw.user.options.get("watchlisthidebots")){
ELP.config.list=true;}
if(typeof ELP.config.list!=="boolean"){
ELP.config.list=false;}
if(ELP.config.list||typeof ELP.config.later!=="boolean"){
ELP.config.later=false;}
if(ELP.config.later){
mw.util.addCSS(".mw-changeslist {display:none}");}
$(fiat);}
ELP[Sub].fire=function(){
facilitated();
if(typeof ELP.request==="string"&&ELP.request===Sub){
ELP.request=false;
if(typeof ELP.project==="object"&&typeof ELP.project.trigger==="object"&&ELP.project.trigger[0]==="talk"&&typeof ELP.config==="object"&&ELP.config){
if(ELP.special==="Watchlist"||(typeof ELP.config.last==="boolean"&&ELP.config.last)){
mw.loader.using(["mediawiki.Title","mediawiki.util"],fire);}}}
};
function first(){
facilitated();
if(typeof ELP.featuring==="function"){
ELP.featuring(ELP[Sub].fire);}}
first();
}(window.mediaWiki,window.jQuery));
/// EOF</nowiki>externalLinkProblem/watchlist/r.js