From ba5200b50692b889f59df9f37c913b3ef85045c8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 21 Jan 2017 19:46:49 -0800 Subject: Ditch client code --- static/js/register.js | 60 --------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 static/js/register.js (limited to 'static/js/register.js') diff --git a/static/js/register.js b/static/js/register.js deleted file mode 100644 index 6e623ae4..00000000 --- a/static/js/register.js +++ /dev/null @@ -1,60 +0,0 @@ -(function() { - var g; - - g = this; - - $(function() { - $('#username').focus(); - $('#username').blur(function() { - $(this).parent().next('.alert').remove(); - if (/^[a-z]+$/.test($(this).val())) { - return $(this).parent().removeClass('has-error'); - } else { - $(this).parent().addClass('has-error'); - return $(this).parent().after('
Username must be lowercase
'); - } - }); - $('#password').blur(function() { - $('#confirm').blur(); - return $(this).parent().next('.alert').remove(); - }); - $('#confirm').blur(function() { - if ($(this).val() === '') { - return; - } - $(this).parent().next('.alert').remove(); - if ($('#password').val() === $('#confirm').val()) { - return $('#confirm').parent().removeClass('has-error'); - } else { - $('#confirm').parent().addClass('has-error'); - return $('#confirm').parent().after('
Passwords don\'t match
'); - } - }); - $('#email').blur(function() { - if ($(this).val() === '') { - return; - } - $(this).parent().next('.alert').remove(); - if (validateEmail($(this).val())) { - return $(this).parent().removeClass('has-error'); - } else { - $(this).parent().addClass('has-error'); - return $(this).parent().after('
Invalid email
'); - } - }); - return $('#register').submit(function() { - var key, mnemonic; - $('.form-control').blur(); - if ($('.has-error').length > 0) { - $('.has-error').effect('shake', 500); - return false; - } else { - mnemonic = bip39.generateMnemonic(); - key = bitcoin.HDNode.fromSeedBuffer(bip39.mnemonicToSeed(mnemonic)).deriveHardened(44).deriveHardened(0); - $('#pubkey').val(key.neutered().toString()); - return $('#privkey').val(CryptoJS.AES.encrypt(key.toString(), $('#password').val()).toString()); - } - }); - }); - -}).call(this); -- cgit v1.2.3