User:Kerri Amber/scripts/speedydelete.js

function AddSpeedyTemplate { var speedyoptions = { '': 'None', '': 'Spam', '': 'Vand', '': 'NtNd', '': 'Leak', '': 'UserSpc' };    var speedyoptstr = ''; for(i in speedyoptions) {speedyoptstr += '' + speedyoptions[i] + ' ';} var html = '' + speedyoptstr + ' Sdelete' $('#p-cactions .pBody ul').append(html); document.getElementById('ca-speedy-template-button').onclick = function(event) { api.send(new api.Query(api, 'POST', 'action=edit&title=' + wgPageName + '&appendtext=' + document.getElementById('ca-speedy-chooser').options[document.getElementById('ca-speedy-chooser').selectedIndex].value + '&summary=Adding Sdelete template', function(result) { window.location = wgServer + '/index.php?title=' + wgPageName + '&action=purge'; })); } } addOnloadHook(AddSpeedyTemplate); importScriptPage('MediaWiki:APIQuery.js', 'monchbox');