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

Content deleted Content added
2.5
2.6
Line 1:
/// Gadget/fragmentAnchors/r.js
/// 20182021-0801-2418 PerfektesChaos@de.wikipedia
/// Fingerprint:#0#217EB29F107822F1#
/// Documentation:[[w:en:User:PerfektesChaos/js/fragmentAnchors]]
/// @license:CC-by-sa/4.0 GPLv3
///<nowiki>
(function(mw,$){
"use strict";
var Version=2.56,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 137 ⟶ 138:
var m=(alert||augment?1:0),n=(alert?20:12),s=FASC["source"+m],$r=$("<img />");
$r.attr({alt:"id?",src:"https://upload.wikimedia.org/wikipedia/commons/thumb/"+s+"/"+n+"px-"+s.substr(5)+".png"});
$r.css({"height":n,
"width":n});
if(alert){
$r.css({"background-color":"#FFFF00",
"border":"#FF0000 2px solid",
"padding":"1px"});}
return $r;
Line 181 ⟶ 184:
$s=$("<span>");
$s.addClass(FASC.single);
$s.css({"background-color":"#FFFF00",
"border":"#FF0000 2px solid",
"color":"#FF0000",
"font-size":"120%",
"font-weight":"bold",
"padding-left":"0.2em",
"padding-right":"0.2em"});
$s.attr({title:anchor});
Line 210 ⟶ 216:
FASC.fiat=function(about,action){
var illusive=0.75,margin=10,options={align:"center",anchor:true,horizontalPosition:"center",padded:false,verticalPosition:"below"},show=about.sign,sign=FASC.sign+(action?"-t":"-i")+about.id,$p=$("<span>"),r;
$p.css({"left":(-0.5*about.$span.innerWidth()-1)+"px",
"position":"relative",
"top":"3px"});
about.$span.append($p);
Line 220 ⟶ 227:
show="#";}
if(about.mode===2){
$p.css({"background-color":"#FFFF00",
"color":"#FF0000",
"font-weight":"bold",
"margin":"0.2em",
"padding":"0.4em"}).text(show);
}else{
Line 228 ⟶ 237:
show=FASC.cfg.fancy(show);
illusive=0.95;}
$p.css({"color":"#000000",
"font-weight":"normal"}).text(show);
.text(show);
}else{
$p.css({"margin":"0.2em",
"width":"2em"}).text("  ");}}
.text("  ");}}
$p.attr({"id":sign}).addClass(FASC.sign+"-text")
.css({"font-family":"sans-serif",
"font-size":"medium",
"font-style":"normal",
"font-variant":"normal",
"visibility":"hidden"});
FASC.$body.append($p);
Line 244 ⟶ 255:
r=new OO.ui.PopupWidget(options);
r.$floatable.attr({"role":"tooltip"}).css({"opacity":illusive,
"padding":"2px",
"text-align":"center"});
FASC.$body.append(r.$floatable);
return r;
Line 300 ⟶ 312:
$li.text("−"+FASC.want[s]+"× "+s);
$ul.append($li);}
$box.css({"border":"#FF0000 2px solid",
"color":"#FF0000",
"margin-bottom":"1em",
"margin-top":"1em",
"padding":"0.5em"});
$box.attr({"id":FASC.sign+"-errors"});
$box.addClass(FASC.show+" error "+FASC.sign+"-errors");
$box.append($ul);
$before.before($box);}