User:Rutilant/Reply.js

//for easily and quickly replying talk comment $(function {	headerLevel = 2;	$( 'h' + headerLevel + ' span.mw-headline' ).each( function( i, val ) { var sectionName = $( this ).text; var editSectionUrl = $( this ).parent.find( '.mw-editsection a:first' ).attr( 'href' ); var sectionReg = /&section=(.*)/; var sectionRaw = sectionReg.exec( editSectionUrl ); if ( sectionRaw != null && sectionRaw[ 1 ].indexOf( 'T' ) < 0 ) { var sectionNumber = parseInt( sectionRaw[ 1 ] ); if ( $( this ).parent.prop( 'tagName' ) === 'H' + headerLevel ) { $( this ).parent( 'h' + headerLevel ).append( ' Reply ' ); }}})}); if (location.href.indexOf("&action=edit&replyit=yes") == -1) return; statusRegExp = /&action=edit&replyit=yes&section=(.*)/; var sectionNumber = statusRegExp.exec(location.href)[1]; if (sectionNumber != null && sectionNumber != ""){ var result = prompt("Type your reply\n You don't need to leave four tildes.",":"); //Sign result=result+" "+"";; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value+result; document.editform.wpSummary.value ="re"; $('#wpDiff').click; }else{ alert("Error! Please refresh and try again.\n Invalid section number"); }