Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
/** * Adds a link to the CommonsDelinker log to deletion log entries. */addOnloadHook(function(){// guard against multiple inclusionif(window.commonsDelinkerLogLinksAdded)return;window.commonsDelinkerLogLinksAdded=true;varcontent=document.getElementById("bodyContent")||// monobook & vector skinsdocument.getElementById("mw_contentholder")||// modern skindocument.getElementById("article");// classic skinsif(!content)return;vardeletions=getElementsByClassName(content,"li","mw-logline-delete");if(!deletions||!deletions.length)return;// create the links in advance so we can cloneNode() them quickly in the loopvarguLink=document.createElement("a");guLink.className="delinker-log-globalusage";guLink.appendChild(document.createTextNode("global usage"));varcdLink=document.createElement("a");cdLink.className="delinker-log-link extiw";cdLink.appendChild(document.createTextNode("delinker log"));varspan=document.createElement("span");span.className="delinker-log-links";span.appendChild(document.createTextNode(" ("));span.appendChild(guLink);span.appendChild(document.createTextNode("; "));span.appendChild(cdLink);span.appendChild(document.createTextNode(")"));for(vari=0;i<deletions.length;i++){varmatch=null;for(varelem=deletions[i].firstChild;elem;elem=elem.nextSibling){if(!elem.tagName||elem.tagName.toLowerCase()!='a')continue;if(/mw-userlink/.test(elem.className))continue;match=/^File:(.*)/.exec(getInnerText(elem));if(match)break;}if(match){varfilename=encodeURIComponent(match[1].replace(/ /g,"_"));guLink.href=wgScript+"?title=Special:GlobalUsage&target="+filename;guLink.title="Current usage of "+match[1]+" on all Wikimedia projects";cdLink.href="http://toolserver.org/~delinker/index.php?image="+filename;cdLink.title="CommonsDelinker log for "+match[1];deletions[i].appendChild(span.cloneNode(true));}}});