// ==UserScript==
// @name Mefi obscure spoilers
// @namespace http://www.arthurwyatt.co.uk
// @description Lets you hide spoilers in MeFi comments
// @include http://*.metafilter.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js
$("#tbtd").append("Spoilers!").click(function (e) {
e.preventDefault();
plaintext = $("#comment").val();
rot13text = rot13(plaintext);
$("#comment").val("SPOILER (mouseover to read):\r" + rot13text + "");
});
$("ABBR").click( function (e) {
e.preventDefault();
var text = $(this).text();
$(this).text($(this).attr("title"));
$(this).attr("title", text);
});
function rot( t, u, v ) {
return String.fromCharCode( ( ( t - u + v ) % ( v * 2 ) ) + u );
}
function rot13( s ) {
var b = [], c, i = s.length,
a = 'a'.charCodeAt(), z = a + 26,
A = 'A'.charCodeAt(), Z = A + 26;
while(i--) {
c = s.charCodeAt( i );
if( c>=a && c=A && c