diff options
| author | Adam Soltys <[email protected]> | 2014-09-15 10:09:03 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2014-09-15 10:09:03 -0700 |
| commit | 0765adfc8993e8641e61a8db40965ef091c0f451 (patch) | |
| tree | 3acbb32a40e47f295dec6b2085ef0f15213baaac /public | |
| parent | d07a4738359e1825e3629871b96c049275ab18c0 (diff) | |
| download | coinos-server-0765adfc8993e8641e61a8db40965ef091c0f451.tar.gz coinos-server-0765adfc8993e8641e61a8db40965ef091c0f451.zip | |
Mail key
Diffstat (limited to 'public')
| -rw-r--r-- | public/js/calculator.coffee | 1 | ||||
| -rw-r--r-- | public/js/setup.coffee | 42 | ||||
| -rw-r--r-- | public/js/webqr.js | 2 |
3 files changed, 24 insertions, 21 deletions
diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee index 14a25e6c..2032b9c3 100644 --- a/public/js/calculator.coffee +++ b/public/js/calculator.coffee @@ -52,6 +52,7 @@ setup = -> g.tip = 1 g.user.address or= '' g.user.commission or= 0 + g.user.currency or= 'CAD' g.user.symbol or= 'quadrigacx' g.user.unit or= 'BTC' diff --git a/public/js/setup.coffee b/public/js/setup.coffee index deffcded..465cfb39 100644 --- a/public/js/setup.coffee +++ b/public/js/setup.coffee @@ -22,6 +22,8 @@ g = exports ? this g.proceed = false $(-> + $('#encryption-password').pwstrength(showVerdicts: false) + $.getJSON("/js/rates.json", (data) -> currencies = Object.keys(data) currencies = currencies.sort() @@ -51,6 +53,7 @@ $(-> user = $('#username').val() $.getJSON("/#{user}.json", (data) -> + $('#email').val(data.email) $('#title').val(data.title) $('#logo').val(data.logo) $('#pubkey').val(data.pubkey) @@ -69,13 +72,6 @@ $(-> $('#unit').append("<option value='#{v}'>#{v}</option>") ) - $('#title').blur(-> - if $(this).val() == '' and $('#logo').val() == '' - $(this).parent().addClass('has-error') - else - $(this).parent().removeClass('has-error') - ) - $('#pubkey').blur(-> if check_address($(this).val()) $(this).parent().removeClass('has-error') @@ -89,25 +85,23 @@ $(-> g.privkey = key.extended_private_key_string() $('#modal').modal() - $('#privkey').html(g.privkey) + $('#privkey_text').html(g.privkey) $('#qr').html('') new QRCode('qr', text: g.privkey, width: 260, height: 260) ) $('#encryption-password').keyup((e) -> return if e.keyCode is 9 or e.keyCode is 16 - enc_privkey = CryptoJS.AES.encrypt(g.privkey, $(this).val()).toString() - enc_privkey = g.privkey if $(this).val() == '' - $('#privkey').html(enc_privkey) + g.enc_privkey = CryptoJS.AES.encrypt(g.privkey, $(this).val()).toString() + g.enc_privkey = g.privkey if $(this).val() == '' + $('#privkey_text').html(g.enc_privkey) $('#qr').html('') - new QRCode('qr', text: enc_privkey, width: 260, height: 260) + new QRCode('qr', text: g.enc_privkey, width: 260, height: 260) if $(this).val() $('#status').html('(Encrypted)') else - $('#status').html('(Unencrypted Plaintext)') - - + $('#status').html('(Unencrypted)') ) $('#confirm').blur(-> @@ -146,18 +140,26 @@ $(-> $('#close').click(-> $('#modal .form-control').blur() if $('#modal .has-error').length > 0 + $('#step1_link').click() $('#modal .has-error').effect('shake', 500) else - g.update_pub_key = true + g.update_key = true $('#modal').modal('hide') ) + $('#encrypt').submit(-> $('#close').click(); return false) + + $('#modal').on('show.bs.modal', -> + $('#encryption-password, #encryption-confirm').val('').keyup().parent().removeClass('has-error') + $('#modal .alert').removeClass('alert-success').addClass('alert-danger') + ) $('#modal').on('shown.bs.modal', -> - g.update_pub_key = false - $('#encryption-password, #encryption-confirm').val('').blur() - $('#encryption-password').pwstrength(showVerdicts: false) + g.update_key = false + $('#encryption-password').focus() ).on('hidden.bs.modal', -> - $('#pubkey').val(g.pubkey) if g.update_pub_key + if g.update_key + $('#pubkey').val(g.pubkey) + $('#privkey').val(g.enc_privkey) ) $('#setup').submit(-> diff --git a/public/js/webqr.js b/public/js/webqr.js index ad80065d..18d4de4e 100644 --- a/public/js/webqr.js +++ b/public/js/webqr.js @@ -10,7 +10,7 @@ var webkit=false; var moz=false; var v=null; -var vidhtml = '<video id="v" width="480" height="480" style="margin-top: -80px; padding: 0;" autoplay></video>'; +var vidhtml = '<video id="v" width="450" height="450" style="margin-top: -50px; padding: 0;" autoplay></video>'; $(function() { load(); |
