diff options
| author | Adam Soltys <[email protected]> | 2014-07-13 23:50:47 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2014-07-14 20:23:41 -0700 |
| commit | 3b565f4f4dcea55779e00493e7cf507cf8392010 (patch) | |
| tree | f9c6ed0ee513c2fa5d83e39733ff43932892f748 /public | |
| parent | 3c1282f29695cd102af8b5c49ccf16100a6d03d5 (diff) | |
| download | coinos-server-3b565f4f4dcea55779e00493e7cf507cf8392010.tar.gz coinos-server-3b565f4f4dcea55779e00493e7cf507cf8392010.zip | |
Confirm password
Diffstat (limited to 'public')
| -rw-r--r-- | public/css/calculator.less | 8 | ||||
| -rw-r--r-- | public/js/setup.coffee | 18 |
2 files changed, 19 insertions, 7 deletions
diff --git a/public/css/calculator.less b/public/css/calculator.less index be8a7e7d..2b7ffc92 100644 --- a/public/css/calculator.less +++ b/public/css/calculator.less @@ -17,15 +17,14 @@ div.container-fluid { .form-group { .form-control { height: 40px; padding: 3px; } - label { font-weight: normal; display: block; } - p, span, input[type="text"], select, label { font-size: 20px; } + label { font-weight: normal; font-size: 14px; display: block; } + p, span, input[type="text"], select { font-size: 18px; } span, label { color: #999; } .form-control { display: inline-block; } } form#setup, form#register { - .form-control { width: 300px; } - #address { font-size: 12px; } + .form-control { width: 400px; } } @@ -39,7 +38,6 @@ div#calculator { } td#total { font-weight: bold; text-align: right; } -small { color: #999; } div#calculator p#address { font-size: 1em; margin-top: 20px; } diff --git a/public/js/setup.coffee b/public/js/setup.coffee index dcb58bcb..e8b4e09b 100644 --- a/public/js/setup.coffee +++ b/public/js/setup.coffee @@ -4,19 +4,20 @@ #= require jsbn2.js #= require check_address.js +g = exports ? this +g.proceed = false + $(-> $.getJSON("/js/rates.json", (data) -> currencies = Object.keys(data) currencies = currencies.sort() currencies.pop() - $.each(currencies, (i, v) -> $('#currency').append("<option value='#{v}'>#{v}</option>") ) $("#currency option[value='CAD']").attr('selected', 'selected') - user = $('#username').val() $('#currency').change(-> @@ -41,6 +42,19 @@ $(-> $(this).css('color', 'red') ) + $('#confirm').blur(-> + $('#confirm_error').remove() + if $('#password').val() != $('#confirm').val() + $('#password, #confirm').parent().addClass('has-error') + $('#confirm').parent().after('<div id="confirm_error" class="alert alert-danger">Passwords don\'t match</div>') + else + $('#password, #confirm').parent().removeClass('has-error') + ) + + $('#setup').submit(-> + return false if $('.has-error').length() + ) + if user $('#setup').attr('action', "/#{user}/update").attr('method', 'post') $.getJSON("/#{user}.json", (data) -> |
