Browse Source

Update/Fixes

master
Satinder Grewal 8 years ago
parent
commit
4927253252
  1. 6
      assets/pages/login.css
  2. 47
      assets/scripts/login.js
  3. 33
      index.html

6
assets/pages/login.css

@ -2,7 +2,7 @@
background-image: url("../images/WallStreetNY.jpg"); background-image: url("../images/WallStreetNY.jpg");
} }
.page-login form { .page-login form {
width: 340px; width: 440px;
margin: 30px 0; margin: 30px 0;
} }
.page-login form a { .page-login form a {
@ -22,12 +22,12 @@
} }
} }
#register-btn, #register-back-btn { #register-btn, #register-back-btn, #logint-another-wallet {
border: 1px solid #5d5d5d; border: 1px solid #5d5d5d;
color: #fff; color: #fff;
} }
#register-btn:hover, #register-back-btn:hover { #register-btn:hover, #register-back-btn:hover, #logint-another-wallet:hover {
border: 1px solid #a7a7a7; border: 1px solid #a7a7a7;
color: #fff; color: #fff;
} }

47
assets/scripts/login.js

@ -172,15 +172,15 @@ var Login = function() {
$('input[name=PassPhraseOptions]').on('change', function() { $('input[name=PassPhraseOptions]').on('change', function() {
if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsIguana' ) { if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsIguana' ) {
//console.log('PassPhraseOptionsIguana'); console.log('PassPhraseOptionsIguana');
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(256)) $('#walletseed').text(PassPhraseGenerator.generatePassPhrase(256))
} }
if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsWaves' ) { if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsWaves' ) {
//console.log('PassPhraseOptionsWaves'); console.log('PassPhraseOptionsWaves');
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(160)) $('#walletseed').text(PassPhraseGenerator.generatePassPhrase(160))
} }
if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsNXT' ) { if ( $('input[name=PassPhraseOptions]:checked', '.register-form').val() === 'PassPhraseOptionsNXT' ) {
//console.log('PassPhraseOptionsNXT'); console.log('PassPhraseOptionsNXT');
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(128)) $('#walletseed').text(PassPhraseGenerator.generatePassPhrase(128))
} }
}); });
@ -199,6 +199,10 @@ var Login = function() {
required: true required: true
}, },
rwalletseed: {
equalTo: "#walletseed"
},
password: { password: {
required: true required: true
}, },
@ -209,6 +213,12 @@ var Login = function() {
}, },
messages: {
rwalletseed: {
required: "Wallet seed is required."
}
},
invalidHandler: function(event, validator) { //display error alert on form submit invalidHandler: function(event, validator) { //display error alert on form submit
@ -293,8 +303,8 @@ var Login = function() {
} }
}); });
jQuery('.login-form').show(); $('#section-login').fadeIn();
jQuery('.register-form').hide(); $('#section-register').hide();
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(256)); $('#walletseed').text(PassPhraseGenerator.generatePassPhrase(256));
$('#register_password').val('') $('#register_password').val('')
$('#rpassword').val('') $('#rpassword').val('')
@ -362,6 +372,7 @@ var Login = function() {
$('.create-account').show(); $('.create-account').show();
$('#register-btn').show(); $('#register-btn').show();
$('#logint-another-wallet').hide(); $('#logint-another-wallet').hide();
$("#loginbtn").text('Sign in');
} }
else { else {
@ -414,13 +425,14 @@ var Login = function() {
//swal("Success", "Wallet Locked Successfully.", "success"); //swal("Success", "Wallet Locked Successfully.", "success");
toastr.success("Wallet Locked Successfully", "Account Notification") toastr.success("Wallet Locked Successfully", "Account Notification")
$('#login-section').show(); $('#wallet-login').show();
$('body').removeClass( "page-sidebar-closed-hide-logo page-container-bg-solid page-header-fixed" ).addClass( " login" ); $('body').removeClass( "" ).addClass( "page-login layout-full page-dark" );
$('#wallet-section').hide(); $('#wallet-core').hide();
$('link[id=loginStyle]')[0].disabled=false;
$("#loginbtn").text('Unlock');
//Hide some login fields not needing at lock screen //Hide some login fields not needing at lock screen
console.log('Wallet is Locked.'); console.log('Wallet is Locked.');
$('#login-welcome').text('Wallet Locked.'); $('#login-welcome').text('Wallet Locked. Please login.');
$('#wallet-handle').hide();
$('#register-btn').hide(); $('#register-btn').hide();
$('#logint-another-wallet').show(); $('#logint-another-wallet').show();
} }
@ -477,9 +489,9 @@ var Login = function() {
$('#wallet-core').fadeIn(); $('#wallet-core').fadeIn();
} else if ( JSON.parse(CheckLoginData).status === 'locked' ) { } else if ( JSON.parse(CheckLoginData).status === 'locked' ) {
console.log('Wallet is Locked.'); console.log('Wallet is Locked.');
$('#login-welcome').text('Wallet Locked.'); $('#login-welcome').text('Wallet Locked. Please login');
$('#wallet-handle').hide();
$('#register-btn').hide(); $('#register-btn').hide();
$("#loginbtn").text('Unlock');
} }
} }
@ -503,16 +515,17 @@ var Login = function() {
//swal("Success", "Logout Successfully.", "success"); //swal("Success", "Logout Successfully.", "success");
toastr.success("Logout Successfull", "Account Notification") toastr.success("Logout Successfull", "Account Notification")
$('#login-section').show(); $('#wallet-login').show();
$('body').removeClass( "page-sidebar-closed-hide-logo page-container-bg-solid page-header-fixed" ).addClass( " login" ); $('body').removeClass( "" ).addClass( "page-login layout-full page-dark" );
$('#wallet-section').hide(); $('#wallet-core').hide();
$('link[id=loginStyle]')[0].disabled=false;
//Make sure these fields are unhidden. //Make sure these fields are unhidden.
$('#login-welcome').text('Welcome.'); $('#login-welcome').text('Welcome. Please login.');
$('#wallet-handle').show();
$('.create-account').show(); $('.create-account').show();
$('#register-btn').show(); $('#register-btn').show();
$('#logint-another-wallet').hide(); $('#logint-another-wallet').hide();
$("#loginbtn").text('Sign in');
} }
else { else {

33
index.html

@ -60,34 +60,53 @@
</div> </div>
<!-- BEGIN section login --> <!-- BEGIN section login -->
<div id="section-login"> <div id="section-login">
<p>Welcome. Please login.</p> <h4 style="color: #fff;" id="login-welcome">Welcome. Please login.</h4>
<form class="login-form" method="post" action="javascript:;" autocomplete="off" onsubmit="return false;"> <form class="login-form" method="post" action="javascript:;" autocomplete="off" onsubmit="return false;">
<div class="form-group form-material floating"> <div class="form-group form-material floating">
<input type="password" class="form-control empty" name="password" id="password"> <input type="password" class="form-control empty" name="password" id="password">
<label class="floating-label" for="inputPassword">Password</label> <label class="floating-label" for="inputPassword">Password</label>
</div> </div>
<button type="submit" class="btn btn-primary btn-block">Sign in</button> <button type="submit" class="btn btn-primary btn-block" id="loginbtn">Sign in</button>
<div class="form-group form-material floating"> <div class="form-group form-material floating">
<button class="btn btn-lg btn-flat btn-block waves-effect" id="register-btn">Create new wallet</button> <button class="btn btn-lg btn-flat btn-block waves-effect" id="register-btn">Create new wallet</button>
<button class="btn btn-lg btn-flat btn-block waves-effect" id="logint-another-wallet">Login to another wallet</button>
</div> </div>
</form> </form>
</div> </div>
<!-- END section login --> <!-- END section login -->
<!-- BEGIN section register --> <!-- BEGIN section register -->
<div id="section-register" style="display: none;"> <div id="section-register" style="display: none;">
<p>Sign up to find interesting thing</p>
<form class="register-form" method="post" role="form" autocomplete="off" onsubmit="return false;"> <form class="register-form" method="post" role="form" autocomplete="off" onsubmit="return false;">
<h4 class="hint" style="color: #fff;"> Please select compatible wallet seed type: </h4>
<div class="form-group form-material floating"> <div class="form-group form-material floating">
<textarea class="form-control placeholder-no-fix" type="text" placeholder="Wallet Seed" name="walletseed" id="walletseed" style="height: 100px;"></textarea> <div class="radio-custom radio-default radio-inline">
<input type="radio" id="PassPhraseOptionsIguana" value="PassPhraseOptionsIguana" name="PassPhraseOptions" checked="">
<label for="PassPhraseOptionsIguana">Iguana (256bits)</label>
</div>
<div class="radio-custom radio-default radio-inline">
<input type="radio" id="PassPhraseOptionsWaves" value="PassPhraseOptionsWaves" name="PassPhraseOptions">
<label for="PassPhraseOptionsWaves">Waves</label>
</div>
<div class="radio-custom radio-default radio-inline">
<input type="radio" id="PassPhraseOptionsNXT" value="PassPhraseOptionsNXT" name="PassPhraseOptions">
<label for="PassPhraseOptionsNXT">NXT</label>
</div>
</div>
<div class="form-group form-material floating">
<textarea class="form-control placeholder-no-fix" type="text" placeholder="" name="walletseed" id="walletseed" style="height: 100px;"></textarea>
<label class="floating-label" for="walletseed">Wallet Seed</label> <label class="floating-label" for="walletseed">Wallet Seed</label>
</div> </div>
<p class="hint"> Please enter password for new wallet: </p>
<div class="form-group form-material floating"> <div class="form-group form-material floating">
<input type="password" class="form-control" id="register_password" name="password"> <textarea class="form-control placeholder-no-fix" type="text" placeholder="" name="rwalletseed" id="rwalletseed" style="height: 100px;"></textarea>
<label class="floating-label" for="rwalletseed">Wallet Seed</label>
</div>
<h4 class="hint" style="color: #fff;"> Please enter password for new wallet: </h4>
<div class="form-group form-material floating">
<input type="text" class="form-control" id="register_password" name="password">
<label class="floating-label" for="register_password">Password</label> <label class="floating-label" for="register_password">Password</label>
</div> </div>
<div class="form-group form-material floating"> <div class="form-group form-material floating">
<input type="password" class="form-control" id="rpassword" name="rpassword"> <input type="text" class="form-control" id="rpassword" name="rpassword">
<label class="floating-label" for="rpassword">Retype Password</label> <label class="floating-label" for="rpassword">Retype Password</label>
</div> </div>
<button type="submit" id="register-submit-btn" class="btn btn-primary btn-block">Register</button> <button type="submit" id="register-submit-btn" class="btn btn-primary btn-block">Register</button>

Loading…
Cancel
Save