User:Theopolisme/delsort.js

/***** Begin deletion-sorting code *************************************** Substituted from Template:Deltab From code by raylu, updates made by User:Dinoguy1000 This script adds a Deletion tab to the top of XfD pages. $(function {   if( wgNamespaceNumber == 4 && wgTitle.match( / for d(elet|iscuss)ion/ ) && ( wgAction == "edit" || wgAction == "submit" ) ) {        mw.util.addPortletLink( 'delsort', 'javascript:tagDo','' );    }

function tagDo { var t = prompt("Please enter the one letter code of your requested tag:", ""),";	if (t === null) {		 $("#"+id).attr("title", 'You canceled the tag!').tipsy("show");		 return;

document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.rtrim; document.editform.wpTextbox1.value += '\{\{subst:deletion sorting|' + t '| -- \~\~\~\~\}\}\n'; if( document.editform.wpSummary.value.match(/[^\*\/\s][^\/\s]?\s*$/) ){ document.editform.wpSummary.value += '; '; } document.editform.wpSummary.value += 'tagged as a' + t + '-related deletion (script-assisted)'; document.editform.wpMinoredit.checked = true; document.editform.submit; } });