User:Shockstorm/global.js

/** * Adds edit links to Special:WhatLinksHere * By User:JBed of finalfantasy wiki */ jQuery(function addEditLinksToWLH($) {   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+="?action=edit";            var tools = getElementsByClassName(links[i], 'span', 'mw-whatlinkshere-tools');            var editLinkSpan = document.createElement("span");            editLinkSpan.className = "mw-whatlinkshere-edit";            editLinkSpan.innerHTML = '(edit) ';            links[i].insertBefore(editLinkSpan,tools[0]);        }    } }

$(addEditLinksToWLH);

/* */