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

Content deleted Content added
1.3
1.4
Line 1:
/// Gadget/fragmentAnchors/r.js
/// 2016-04-1920 PerfektesChaos@de.wikipedia
/// Fingerprint:#0#2140A8C9883B23B1#
///<nowiki>
(function(mw,$){
"use strict";
var Version=1.34,FANCY="fragmentAnchors",FASC={cfg:{},siblings:"error-repeated-id",source0:"6/62/Anchor_pictogram.svg",source1:"d/d6/Anchor_pictogram_red.svg",vsn:Version
};
if(typeof mw.libs[FANCY]!=="object"||!mw.libs[FANCY]){
Line 117:
$i.attr({rel:"tipsy"});
$s=$("<span>");
$s.css({"widthfont-size":"1px25%"});
$s.text(" ");
$r=$("<a>");
Line 130:
show=FASC.cfg.element("span",{style:"background-color:#FFFF00;color:#FF0000;font-weight:bold;margin:0.2em;padding:0.4em;"},sign);
}else{
if(sign){
show=FASC.cfg.escape(sign);}
}else{
show=FASC.cfg.element("span",{style:"margin:0.2em;width:2em;"},"  ");}}
$i.attr({"data-id":sign,"title":show});
$i.tipsy({gravity:"s",html:true,opacity:0.8});
Line 137 ⟶ 140:
};
FASC.$failure=function(anchor){
var $r=$("<span>"),$s=$("<span>");
$s.css({"white-space":"nowrap"});
$r.addClass(FASC.single);
$s.css({"font-size":"25%"});
$r.css({"background-color":"#FFFF00","border":"#FF0000 2px solid",
$s.text(" ");
$r.append($s);
$s=$("<span>");
$rs.addClass(FASC.single);
$rs.css({"background-color":"#FFFF00","border":"#FF0000 2px solid",
"color":"#FF0000","font-size":"120%",
"font-weight":"bold","padding-left":"0.2em",
"padding-right":"0.2em"});
$rs.attr({title:anchor});
$rs.text("#");
$r.append($s);
$s=$("<span>");
$s.css({"font-size":"25%"});
$s.text(" ");
$r.append($s);
return $r;
};