User:Splarka/fastdelete.js

if(wgNamespaceNumber != -1) addOnloadHook(addDeleteButtons) function addDeleteButtons { if(!document.getElementById('ca-delete')) return var url=document.getElementById('ca-delete').firstChild.href if(document.getElementById('content').innerHTML.indexOf('submitdelete')!=-1) { alert('Warning: &submitdelete link detected. Be careful clicking anything'); } for(var i=0;i<fdButtons.length;i++) { addPortletLink('p-cactions', url + '&submitdelete=true&wpReason=' + encodeURIComponent(fdButtons[i].summary) ,fdButtons[i].label,'ca-delete1'); } }

addOnloadHook(checkdelete); function checkdelete { if(queryString("submitdelete")=="true") document.getElementById('deleteconfirm').wpConfirmB.click }

function queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } }  return null; }