User:PerfektesChaos/js/fragmentAnchors/r.js: Difference between revisions

Content deleted Content added
2.3
2.4
Line 1:
/// Gadget/fragmentAnchors/r.js
/// 20172018-0301-1929 PerfektesChaos@de.wikipedia
/// Fingerprint:#0#61C1C34AF7546968#
/// Documentation:[[w:en:User:PerfektesChaos/js/fragmentAnchors]]
///<nowiki>
(function(mw,$){
"use strict";
var Version=2.34,FANCY="fragmentAnchors",FASC={cfg:{},siblings:"error-repeated-id",source0:"6/62/Anchor_pictogram.svg",source1:"d/d6/Anchor_pictogram_red.svg",unStart:["wpTextbox","/maplink/","Anker:"],vsn:Version
},EXPORT={},OO;
function facet($area){
Line 76:
return mw.html.escape(anchor);
};
FASC.cfg.fair=function(anchor,allow){
var r=anchor.replace(/_/g," "),s;
if(allow){
if(typeof FASC.wikiAnchor!=="object"){
r=anchor;
}else{
r=anchor.replace(/_/g," ");}
if(typeof FASC.cfg.wikiAnchor!=="object"){
s="[0-9A-Fa-f]";
s="\\.("+s+s+")";
FASC.cfg.wikiAnchor=new RegExp(s,"g");}
try{
s=r.replace(FASC.cfg.wikiAnchor,"%$1");
r=decodeURIComponent(s);
}catch(e){
}
return r;
};
FASC.cfg.familiar=function(anchor,$at){
var s=FASC.cfg.fair(anchor,true),r,$e;
if(s!==anchor&&$at.is("span")){
$e=$at.next();
r=($e.is("span")&&"#"+$e.attr("id")===s);
if(!r){
$e=$at.prev();
r=($e.is("span")&&"#"+$e.attr("id")===s);}}
return r;
};
Line 325 ⟶ 339:
s="#"+$e.attr("id");
if(FASC.filter(s)){
if(FASC.cfg.familiar(s,$e)){
s=false;}
}else{
s=false;}
if(s){
if(typeof total[s]==="object"){
if(typeof FASC.dup[s]!=="object"){