User:Kerri Amber/monobook.js

$(function { $('#p-personal .pBody ul').prepend(' '); }); function AddSpeedyButtons { var options = { 'None': 'None', 'Spam/Nonsense': 'Spam', 'Vandalism': 'Vand', 'Successful AfD': 'AfD', 'Unnecessary': 'NtNd' };    var optstr = ''; for(i in options) {optstr += '' + options[i] + ' ';} var html = '' + optstr + ' Delete (Speedy)' $('#p-cactions .pBody ul').append(html); document.getElementById('ca-speedy-button').onclick = function(event) { if(document.getElementById('ca-speedy').options[document.getElementById('ca-speedy').selectedIndex].innerHTML != "None") { api.send(new api.Query(api, 'POST', 'action=delete&title=' + wgPageName + '&summary=' + document.getElementById('ca-speedy').options[document.getElementById('ca-speedy').selectedIndex].innerHTML, function(result) { if(result.edit.result == "Success") {window.location = wgServer + '/index.php?title=' + wgPageName + '&action=purge';} else{alert('Something went wrong -.-');} }));}         else{alert('Please select a delete reason.')}; } }	addOnloadHook(AddSpeedyButtons); importScriptPage('MediaWiki:APIQuery.js', 'monchbox'); //importScriptPage('User:Sactage/rollbacks.js', 'callofduty'); if(window.location.indexOf('/wiki/Special:Chat') != -1) {window.location += '?useskin=wikia';} importScript('User:Monchoman45/monobook.js');