User:Anomie/uw-templates
This page is intended to be used with Special:Recentchangeslinked.
{{hidden begin|title=Updater Script|bodystyle=font-size:50%}}
/* If you edit this page and then execute the following code (e.g. via Firebug's console), it should ideally regenerate the table */
importScript('User:Anomie/util.js');
var start=(new Date()).toUTCString().replace(/^[^,]*, /,'');
var out='';
var q={action:'query',list:'allpages',apprefix:'Uw-',apnamespace:10,aplimit:500};
function func(){
var r=api(q);
if(!r.query || !r.query.allpages) throw new Error("Bad response");
q.apfrom=r['query-continue']?r['query-continue'].allpages.apfrom:'';
r=r.query.allpages;
for(var i in r) out+='|-\n|\x5b\x5b'+r[i].title+'\x5d\x5d || \x5b\x5b'+r[i].title.replace(/^Template:/,'Template talk:')+'\x5d\x5d\n';
if(q.apfrom){
setTimeout(func, 5000);
} else {
var end=(new Date()).toUTCString().replace(/^[^,]*, /,'');
var t=document.getElementById('wpTextbox1');
t.value=t.value.substr(0,t.value.indexOf('\x3c!-- SNIP HERE --\x3e')+19)+'\x3csmall\x3eLast update happened between '+start+' and '+end+'\x3c/small\x3e\n
class="wikitable"\n'+out+' |
alert("done");
}
}
func();
void(0);
{{hidden end}}
{{hidden begin|title=Show redirect targets|bodystyle=font-size:50%}}
/* The following (in combination with User:Anomie/linkclassifier.js) can help when
* checking redirect targets */
Array.forEach(getElementsByClassName(document,'A','redirect'), function(a){
var p=a.parentNode, n=a.nextSibling;
p.insertBefore(document.createElement('BR'),n);
p.insertBefore(document.createTextNode('→ '+a.title),n);
});
{{hidden end}}
{{hidden begin|title=Hide redirected talk pages|bodystyle=font-size:50%}}
/* The following (in combination with User:Anomie/linkclassifier.js) can help when
* checking for talk pages that need redirection */
Array.forEach(document.getElementsByTagName('A'), function(a){
if(a.parentNode.nodeName!='TD') return;
if(a.href.indexOf('/Template_talk:')<0) return;
if(a.title!='Wikipedia talk:Template messages/User talk namespace') return;
var r;
for(r=a.parentNode; r.nodeName!='TR'; r=r.parentNode);
r.style.display='none';
});
{{hidden end}}
{{hidden begin|title=Group Links|bodystyle=font-size:50%}}
var x={};
var t=null;
var aa=document.getElementsByTagName('A');
for(var i=aa.length-1; i>=0; i--){
var a=aa[i];
if(a.parentNode.nodeName!='TD') continue;
if(a.title.substr(0,9)!='Template:') continue;
var k=a.title.substr(9).replace(/\/doc$/, '');
k=k.replace(/([1234]|4im)$/, '');
if(typeof(x[k])=='undefined') x[k]={ key:k, real:[], redir:[] };
if(/(^| )redirect( |$)/.test(a.className))
x[k].redir.push(a);
else
x[k].real.push(a);
var r;
for(r=a; r.nodeName!='TR'; r=r.parentNode);
t=r.parentNode;
t.removeChild(r);
}
var xx=[];
for(var k in x) xx.push(x[k]);
xx.sort(function(a,b){ return (a.key
for(var i=0; i var r, d; t.appendChild(r=document.createElement('TR')); x=xx[i]; x.real.sort(function(a,b){ return (a.href x.redir.sort(function(a,b){ return (a.href r.appendChild(document.createElement('TD')); d=r.lastChild; d.style.fontWeight='bold'; d.appendChild(document.createTextNode(x.key)); r.appendChild(document.createElement('TD')); d=r.lastChild; for(var j=0; j d.appendChild(document.createTextNode(' ')); d.appendChild(x.real[j]); } for(var j=0; j d.appendChild(document.createTextNode(' ')); d.appendChild(x.redir[j]); } } {{hidden end}} In addition to the below, watch Template:Singlenotice, Template:Singlenotice/inner, Template:Templatesnotice, and Template:Templatesnotice/inner.