User:Microchip08/swedify.js

/* When checked, the link'll display a prompt. Values types into the prompt will be converted into 'Swedish' and plonked in the edit summary. */ function rot (str) { return (str+'').replace(/[a-z]/gi, function(s){       return String.fromCharCode(s.charCodeAt(0)+(s.toLowerCase<'n'?13:-13));    }); }

sendOnSummary = 'preview'; // override function summarise( summary, minor ) { var sum = document.getElementById( "wpSummary" ); if( sum.value != "" && sum.value.charAt( sum.value.length - 2 ) != "/" ) { sum.value += ', ' + summary; } else { sum.value += summary; }   if( sendOnSummary == "preview" ) { document.getElementById("wpPreview").click; } else if( sendOnSummary == "save" ) { document.getElementById("wpSave").click; } } importScript('user:Bawolff/mwapilib2.js'); // just in case, yo $(function { if ( document.getElementById("editform") != null) { mw.util.addPortletLink('p-tb', 'javascript:summarise(rot(prompt("Enter a string")));', 'Swedify', 't-rot', 'Convert the edit summary to Swedish'); }});