User:Lupin/requestrefs.js

A little function which adds links to diff pages or history pages which request references from editors using unref-talk. Requires either Navigation popups or autoedit.js to be loaded to function properly.

function addRefsLinks { var pageTitle=document.getElementsByTagName('h1')[0].innerHTML; var lks=document.links; for (var i=0; i 0) { var a=document.createElement('a'); a.href=lks[i].href.replace('/User:', '/User_talk:') + '?action=edit&autoedit=s#$#\n' + pageTitle + ' ~#&autoclick=wpPreview&autosummary=References for '+pageTitle+''; var tt=document.createTextNode(' . . '); a.innerHTML='request references'; lks[i].parentNode.appendChild(tt); lks[i].parentNode.appendChild(a); } } }