MediaWiki:Common.js/WLH edit.js

/* Any JavaScript here will be loaded for all users on every page load. */ /** if(mw.config.get('wgCanonicalSpecialPageName') === 'Whatlinkshere') { var links = document.getElementById('mw-whatlinkshere-list').getElementsByTagName('li'); for(var i = 0; i < links.length; i++) { aLink = links[i].getElementsByTagName('a'); var linkHref = aLink[0].href; var tools = getElementsByClassName(links[i], 'span', 'mw-whatlinkshere-tools'); var editLinkSpan = document.createElement("span"); editLinkSpan.className = 'mw-whatlinkshere-edit'; // testing for ?redirect=no if (!(/\?/.test(linkHref))) { // the space after closing anchor tag is intentional editLinkSpan.innerHTML = '(edit) '; } else { editLinkSpan.innerHTML = '(edit) '; }               links[i].insertBefore(editLinkSpan, tools[0]); } } /* */