User:Lilac Soul/sign.js

// // function doSign(n) { text = document.editform.wpTextbox1.value; date = new Date; document.editform.wpSummary.value += ' -comment by Lilac Soul'; switch(n) { case 'short': insertTags(,,' ~'); document.getElementById('wpPreview').click; break; case 'long': insertTags(,,' '); document.getElementById('wpWatchthis').click; document.getElementById('wpPreview').click; break; case 'short direct': insertTags(,,' ~'); document.editform.submit; break; case 'long direct': insertTags(,,' '); document.getElementById('wpWatchthis').click;

document.editform.submit; break; } }

addOnloadHook(function {		if ( mw.config.get('wgCanonicalNamespace') in { "Talk":, "User_talk": } ) {                if (document.editform) {			var stabs = document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0];			addlimenu(stabs, "sign", "sign" );				addPortletLink("sign", "javascript:doSign('short')", "short", "short", "Add short signature", "");			addPortletLink("sign", "javascript:doSign('long')", "long", "long", "Add long signature", "");			addPortletLink("sign", "javascript:doSign('short direct')", "short direct", "short direct", "Add short signature and save immediately", "");			addPortletLink("sign", "javascript:doSign('long direct')", "long direct", "long direct", "Add long signature and save immediately", "");				}                }	}); // //