diff options
| author | Adam Soltys <[email protected]> | 2017-01-21 19:46:49 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2017-01-21 19:46:49 -0800 |
| commit | ba5200b50692b889f59df9f37c913b3ef85045c8 (patch) | |
| tree | 755d79cf488d383fe2ffaf123c91be51e879ef35 /static/js/generate_address.js | |
| parent | c413e457579b68b7a92ab47cdd867202ee7bb47e (diff) | |
| download | coinos-server-ba5200b50692b889f59df9f37c913b3ef85045c8.tar.gz coinos-server-ba5200b50692b889f59df9f37c913b3ef85045c8.zip | |
Ditch client code
Diffstat (limited to 'static/js/generate_address.js')
| -rw-r--r-- | static/js/generate_address.js | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/static/js/generate_address.js b/static/js/generate_address.js deleted file mode 100644 index bd592864..00000000 --- a/static/js/generate_address.js +++ /dev/null @@ -1,93 +0,0 @@ -;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0](function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){ -(function() { - var g, genKey; - - g = this; - - $(function() { - genKey(); - $('.regenerate').click(genKey); - $('#encrypt').submit(function() { - $('.form-control').blur(); - if ($('.has-error').length > 0) { - $('.has-error').effect('shake', 500); - return false; - } - $('#modal').modal(); - return false; - }); - $('#modal').on('shown.bs.modal', function() { - var bip38; - bip38 = new Bip38; - g.enc_privkey = bip38.encrypt(g.privkey, $('#password').val(), g.pubkey); - $('#modal-body').html('Done!'); - return setTimeout(function() { - return $('#modal').modal('hide'); - }, 1000); - }); - $('#modal').on('hidden.bs.modal', function() { - if ($('#password').val() === '') { - g.enc_privkey = g.privkey; - $('#status').html(''); - } else { - $('#status').html('Encrypted'); - } - $('#privkey').html(g.enc_privkey); - $('#privqr').html(''); - return new QRCode('privqr', { - text: $('#privkey').html(), - width: 260, - height: 260 - }); - }); - $('.print').click(function() { - return window.print(); - }); - $('#password').pwstrength({ - showVerdicts: false - }); - $('#password').blur(function() { - $('#confirm').blur(); - $(this).parent().next('.alert').remove(); - if ($('.progress-bar-success').length > 0) { - return $(this).parent().removeClass('has-error'); - } else { - return $(this).parent().addClass('has-error'); - } - }); - return $('#confirm').blur(function() { - if ($('#password').val() === $('#confirm').val()) { - return $('#confirm').parent().removeClass('has-error'); - } else { - return $('#confirm').parent().addClass('has-error'); - } - }); - }); - - genKey = function() { - var key; - $('#password').focus(); - key = bitcoin.ECKey.makeRandom(false); - g.privkey = key.toWIF(); - g.pubkey = key.pub.getAddress().toString(); - $('#pubkey').html(g.pubkey); - $('#privkey').html(g.privkey); - $('#pubqr, #privqr, #status').html(''); - $('#password, #confirm').val('').keyup().parent().removeClass('has-error'); - new QRCode('pubqr', { - text: $('#pubkey').html(), - width: 260, - height: 260 - }); - return new QRCode('privqr', { - text: $('#privkey').html(), - width: 260, - height: 260 - }); - }; - -}).call(this); - - -},{}]},{},[1]) -;
\ No newline at end of file |
