Content deleted Content added
1.2 |
1.5 2023-05-01 |
||
(One intermediate revision by the same user not shown) | |||
Line 1:
/// User:PerfektesChaos/js/refNames/core/r.js
///
/// Fingerprint:#0#
/// License:CC-by-sa/4.0
///<nowiki>
mw.hook("refNames.config").fire({trigger:[0],rooms:[0,2,4,100],warn:["^q\\d+$","^ref\\d+$"]});
(function(mw,$){
"use strict";
var Version=1.
},PARSER={reQuot:false,reWS:false,pending:false,$textarea:false},SOURCE={before:[".wikibase-entity-usage",".templatesUsed",".hiddencats",".limitreport"],locked:true,pics:{drag:["de","OOjs_UI_icon_trash-destructive.svg"],drop:["9b","OOjs_UI_icon_trash-invert.svg"],exch:["e9","OOjs_UI_icon_reload-invert.svg"],edit:["8a","OOjs_UI_icon_edit-ltr-progressive.svg"],wait:["de","Ajax-loader.gif"]
},section:"section",$box:false,$editor:false,$wrapper:false},VIEW={};
function failure(apply){
Line 169 ⟶ 170:
k=m;}}
return r;}
PARSER.fault=function(all,at,alert,about){
var i,n,s;
if(typeof window.console==="object"&&typeof window.console.warn==="function"){
i=-1;
s=Signature+" #"+at+" "+alert;▼
n=0;
do{
i=all.indexOf("\n",i+1);
n++;
}while(i>=0&&i<at);
▲s=Signature+" #"+at+" @"+n+" "+alert;
if(about){
s=s+" -- "+about;}
if(!PARSER.reWS){
PARSER.reWS=new RegExp("\\s+");}
i=at;
while(all.charCodeAt(i)!==0x3C&&i>=0){
i--;}
n=all.indexOf(">",i+1);
if(n<0){
n=i+100;}
s=s+"\n"+all.substring(i,n+1).replace(PARSER.reWS," ");
window.console.warn(s);}
};
Line 186 ⟶ 202:
if(k<0||k>after){
r.lock=true;
PARSER.fault(all,at,"Unbalanced delimiter",about+"="+s);
}else if(k===i+1){
r.lock=true;
PARSER.fault(all,at,"Missing identifier",about+"="+s+s);
}else{
r.set=PARSER.focus(all.substring(i+1,k));
r.more=k+1;}
}else if(k===0x2F||k===0x3E){
PARSER.fault(all,at,"Identifier missing",about+"=");
r.lock=true;
}else{
Line 203 ⟶ 219:
if(k===i){
r.lock=true;
PARSER.fault(all,at,"Missing identifier",about+"=");
k=after+1;
break;}
Line 235 ⟶ 251:
"wikitext":false};}
if(typeof r[s]==="string"){
PARSER.fault(all,at,"Duplicated keyword",s);
lock=true;
}else{
Line 244 ⟶ 260:
break;
default:
PARSER.fault(all,at,"Unknown keyword",s);
lock=true;}}
}while(!lock);
Line 261 ⟶ 277:
}else{
PARSER.lock=true;
PARSER.fault(all,i,"Trailing garbage");}}}
return r;
};
Line 502 ⟶ 518:
}else{
PARSER.lock=true;
PARSER.fault(all,i,"Missing </ref>");}}
if(PARSER.pending){
if(r.next<PARSER.pending.max){
Line 818 ⟶ 834:
SOURCE.fresh();
group=SOURCE.grouped[SOURCE.pre.group];
if(group){
for(i=0;i<group.length;i++){
if(s===group[i].name){
Line 825 ⟶ 842:
SOURCE.exec={group:SOURCE.pre.group,seek:SOURCE.start,shift:s};
SOURCE.$deny.hide();
SOURCE.$doit.show();}}}
if(lapsus){
SOURCE.$input.css({"border-color":"#FF0000"});
|