aboutsummaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2014-09-15 10:09:03 -0700
committerAdam Soltys <[email protected]>2014-09-15 10:09:03 -0700
commit0765adfc8993e8641e61a8db40965ef091c0f451 (patch)
tree3acbb32a40e47f295dec6b2085ef0f15213baaac /public
parentd07a4738359e1825e3629871b96c049275ab18c0 (diff)
downloadcoinos-server-0765adfc8993e8641e61a8db40965ef091c0f451.tar.gz
coinos-server-0765adfc8993e8641e61a8db40965ef091c0f451.zip
Mail key
Diffstat (limited to 'public')
-rw-r--r--public/js/calculator.coffee1
-rw-r--r--public/js/setup.coffee42
-rw-r--r--public/js/webqr.js2
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();