User:Smith609/references.js

function refsByName{ if (document.getElementById('wpDiff')){ var links = document.getElementsByTagName("a"); var countLinks = links.length; var refName = /#cite_note-([\w\d_]*)-\d+/;

for (i=1; i<countLinks; i++) { if (refName.test(links[i].href)) { links[i].innerHTML = "[" + refName.exec(links[i].href)[1] + "]"; } } if (document.getElementById("wpTextbox1")){ spaces = /(\s)-(\s)/g; //document.getElementById("wpTextbox1").innerHTML = document.getElementById("wpTextbox1").innerHTML.replace(spaces, "$1–$2"); } } }

$(refsByName);