MediaWiki:Gadget-welcomer.js

try { // containerize gadget, to protect other gadgets if this one goes wrong

$(talklinkWelcomizer); function talklinkWelcomizer { mw.util.addCSS('a.welcometalklink {color:#ff00ff;font-weight:bold }'); // mw.util.addCSS('ul.special li a[title ="Special:Contributions"] + a[title ^="User talk:"].new { color:#CC2200;font-weight:normal }'); var docobj = document.getElementById('bodyContent') || document.getElementById('content') || document.getElementById('mw-content') || document.body; var a = getElementsByClassName(docobj,'a','new'); var utpat = /title\=[uU]ser_talk\:/; for(var i=0;i<a.length;i++) { var href = a[i].getAttribute('href',2); var frag = (href.indexOf('?') == -1) ? '?' : '&';   if(utpat.test(href)) { a[i].setAttribute('href',href + frag + 'preload=MediaWiki:Gadget-welcomer-preload'); a[i].className += " welcometalklink"; } } }

// with thanks to wikia:User:Splarka // edit MediaWiki:Gadget-welcomer-preload to change the preload

} catch (e) { // containerize gadget, to protect other gadgets if this one goes wrong // ignore }