User:~riley/mtc.js

// Adds Template:db-redirnone] // Created by Legoktm // Modified by Riley Huntley // Adds a tab at the top of the page says "It" if(wgNamespaceNumber == 0) { if(wgAction == 'edit' || wgAction == 'submit') { addOnloadHook(function { mw.util.addPortletLink('p-cactions','javascript:doIt','___IT___','ca-It'); }); } else { var url = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + encodeURIComponent(mw.config.get('wgPageName')) + '&action=edit&autoit=true'; addOnloadHook(function { mw.util.addPortletLink('p-cactions',url,'___BR___','ca-It'); }); } } if(queryString('autoit')) addOnloadHook(function { doIt; }) function doIt { var txt = document.getElementById('wpTextbox1'); if(!txt) return; txt.value = '{' + '{' + 'db-redirnone}}\n' + txt.value; document.getElementById('wpSummary').value += 'Requesting speedy deletion (CSD G8).'; document.getElementById('wpSave').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; }