User:X!/bag.js

function bagApprove { var approvetext = prompt("Enter an optional comment"); if (approvetext == null) var approvetext == ''; else var approvetext == approvetext + ' '; document.editform.wpTextbox1.value = '{' + '{' + 'subst' + ':BT|Approved' + '}' + '}' + '' + document.editform.wpTextbox1.value + ':' + '{' + '{' + 'BotApproved' + '}' + '} ' + approvetext + 'Good Luck.' + ' ~' + '~' + '~' + '~' + '' + '{' + '{' + 'subst' + ':BB' + '}' + '}'; document.editform.wpSummary.value = 'Approved'; document.editform.wpMinoredit.checked = false; }

function bagDeny { var denytext = prompt("Enter an optional comment"); if (denytext == null) var denytext == ''; else var denytext == denytext + ' '; document.editform.wpTextbox1.value = '{' + '{' + 'subst' + ':BT|Denied' + '}' + '}' + '' + document.editform.wpTextbox1.value + ':' + '{' + '{' + 'BotDenied' + '}' + '} ' + denytext + ' ~' + '~' + '~' + '~' + '' + '{' + '{' + 'subst' + ':BB' + '}' + '}'; document.editform.wpSummary.value = 'Denied'; document.editform.wpMinoredit.checked = false; }

function bagExpire { var expiretext = prompt("Enter an optional comment"); if (expiretext == null) var expiretext == ''; else var expiretext == expiretext + ' '; document.editform.wpTextbox1.value = '{' + '{' + 'subst' + ':BT|Expired' + '}' + '}' + '' + document.editform.wpTextbox1.value + ':' + '{' + '{' + 'BotExpired' + '}' + '} ' + expiretext + ' ~' + '~' + '~' + '~' + '' + '{' + '{' + 'subst' + ':BB' + '}' + '}'; document.editform.wpSummary.value = 'Expired'; document.editform.wpMinoredit.checked = false; }

addOnloadHook(function { if (document.editform) {     addPortletLink("p-cactions", "javascript:bagExpire", "expire", "ca-expire", "Expire this request", "");     addPortletLink("p-cactions", "javascript:bagApprove", "approve", "ca-approve", "Approve this request", "");     addPortletLink("p-cactions", "javascript:bagDeny", "deny", "ca-deny", "Deny this request", "");  } });