User:Kerri Amber/scripts/Speedy-Comments.js

function BlogCommentSpeedyDeleteButtons { var commentArray = new Array; var deleteOptions = { 'None': 'None', 'Spam/Nonsense': 'Spam', 'Flaming': 'Flame' 'Off-topic': 'OffTopic' };	var deleteoptstr = ''; for(i in speedyoptions) {speedyoptstr += '' + speedyoptions[i] + ' ';} var html = '' + speedyoptstr + ' Delete (Speedy)' commentArray = $('#article-comments-ul li .tools'); for (i in commentArray) { $(i).append(html) document.getElementById('blog-speedy-button').onclick = function(event) { if(document.getElementById('blog-comment-speedy').options[document.getElementById('blog-comment-speedy').selectedIndex].innerHTML != "None") { api.send(new api.Query(api, 'POST', 'action=delete&title=' + wgPageName + '&reason=' + document.getElementById('blog-comment-speedy').options[document.getElementById('blog-comment-speedy').selectedIndex].value, function(result) { window.location = wgServer + '/index.php?title=' + wgPageName + '&action=purge'; }));}		else{alert('Please select a delete reason.')}; } } if(wgCanonicalNamespace == 'User Blog') { addOnloadHook(BlogCommentSpeedyDeleteButtons); importScriptPage('MediaWiki:APIQuery.js', 'monchbox'); }