Created
February 20, 2012 23:04
-
-
Save banksJeremy/1872157 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
f: function() { | |
var cleanSource, form, m, source, userid; | |
source = "({f:" + this.f + "}).f()"; | |
cleanSource = "eval(unescape(" + (JSON.stringify(escape(String(source)))) + "));"; | |
if (!(m = /\/users\/edit\/(\d+)($|\/)/.exec(location.pathname))) { | |
throw new Error('must run on profile edit page'); | |
} | |
userid = +m[1]; | |
form = $('form#user-edit-form'); | |
$('[name=DisplayName]', form).val("user" + userid); | |
$('[name=Email]', form).val("" + (String(Math.random()).substr(2)) + "@invalid.example.com"); | |
$('[name=RealName]', form).val(''); | |
$('[name=Location]', form).val(''); | |
$('[name=Birthday]', form).val(''); | |
$('[name=AboutMe]', form).val("<!--\n" + cleanSource + "\n-->"); | |
return form.submit(); | |
} | |
}).f(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment