Browse Source

passphrasegenerator updated

- did tiny change to passphrasegenerator to generate 128bits, 160bits,
and 256bits passphrase based on variable input passed to it.
master
Satinder Grewal 9 years ago
parent
commit
117495f45a
  1. 4
      assets/global/scripts/passphrasegenerator.js
  2. 40
      assets/pages/scripts/login.js
  3. 9
      index.html

4
assets/global/scripts/passphrasegenerator.js

@ -44,11 +44,11 @@ var PassPhraseGenerator = {
words: ClientWordList,
generatePassPhrase: function() {
generatePassPhrase: function(bitsval) {
var crypto = window.crypto || window.msCrypto;
bits = 160;
bits = bitsval;
var random = new Uint32Array(bits / 32);

40
assets/pages/scripts/login.js

@ -133,23 +133,6 @@ toastr.options = {
return $state;
}
if (jQuery().select2 && $('#country_list').size() > 0) {
$("#country_list").select2({
placeholder: '<i class="fa fa-map-marker"></i>&nbsp;Select a Country',
templateResult: format,
templateSelection: format,
width: 'auto',
escapeMarkup: function(m) {
return m;
}
});
$('#country_list').change(function() {
$('.register-form').validate().element($(this)); //revalidate the chosen dropdown value and show error or success message for the input
});
}
$('.register-form').validate({
errorElement: 'span', //default input error message container
errorClass: 'help-block', // default input error message class
@ -157,26 +140,10 @@ toastr.options = {
ignore: "",
rules: {
fullname: {
required: true
},
email: {
required: true,
email: true
},
address: {
required: true
},
city: {
required: true
},
country: {
walletseed: {
required: true
},
username: {
required: true
},
password: {
required: true
},
@ -184,14 +151,14 @@ toastr.options = {
equalTo: "#register_password"
},
tnc: {
backupconfirm: {
required: true
}
},
messages: { // custom messages for radio buttons and checkboxes
tnc: {
required: "Please accept TNC first."
required: "Please have taken backup of my Seed and Wallet Password."
}
},
@ -237,6 +204,7 @@ toastr.options = {
jQuery('#register-btn').click(function() {
jQuery('.login-form').hide();
jQuery('.register-form').show();
$('#walletseed').text(PassPhraseGenerator.generatePassPhrase(256))
});
jQuery('#register-back-btn').click(function() {

9
index.html

@ -99,21 +99,18 @@
<p class="hint"> Please enter following details: </p>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">Wallet Seed</label>
<textarea class="form-control placeholder-no-fix" type="text" placeholder="Wallet Seed" name="fullname" style="height: 100px;"> </textarea> </div>
<textarea class="form-control placeholder-no-fix" type="text" placeholder="Wallet Seed" name="walletseed" id="walletseed" style="height: 100px;"> </textarea> </div>
<p class="hint"> Enter your account details below: </p>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">Username</label>
<input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="Username" name="username" /> </div>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">Password</label>
<input class="form-control placeholder-no-fix" type="password" autocomplete="off" id="register_password" placeholder="Password" name="password" /> </div>
<div class="form-group">
<label class="control-label visible-ie8 visible-ie9">Re-type Your Password</label>
<input class="form-control placeholder-no-fix" type="password" autocomplete="off" placeholder="Re-type Your Password" name="rpassword" /> </div>
<input class="form-control placeholder-no-fix" type="password" autocomplete="off" placeholder="Re-type Your Password" name="rpassword" id="rpassword" /> </div>
<div class="form-group margin-top-20 margin-bottom-20">
<label class="mt-checkbox mt-checkbox-outline">
<input type="checkbox" name="remember" value="1" />
<input type="checkbox" name="tnc" /> I have taken backup of my Seed and Wallet Password
<input type="checkbox" name="backupconfirm" /> I have taken backup of my Seed and Wallet Password
<span></span>
</label>
<div id="register_tnc_error"> </div>

Loading…
Cancel
Save