Browse Source

Import Private Key settings section added

master
Satinder Grewal 8 years ago
parent
commit
98741f7a36
  1. 46
      assets/scripts/walletsettings.js
  2. 35
      index.html

46
assets/scripts/walletsettings.js

@ -123,6 +123,51 @@ var WalletSettings = function() {
});
};
var handleWalletImportKeys = function() {
$('.wifkeys-import-form').validate({
//errorElement: 'span', //default input error message container
//errorClass: 'help-block', // default input error message class
//focusInvalid: false, // do not focus the last invalid input
rules: {
import_wifkey: {
required: true
}
},
messages: {
import_wifkey: {
required: "Private Key is required."
}
},
submitHandler: function(form) {
var Getimport_wifkey = $("#import_wifkey").val();
//console.log(Getimport_wifkey);
EDEXimportprivkey(Getimport_wifkey).then(function(result){
console.log(result)
if ( result.result !== undefined && result.result == 'success' ) {
toastr.success("Private Key Imported Successfully!", "Settings Notification");
}
if ( result.error !== undefined && result.error == 'null return from iguana_bitcoinRPC' ) {
toastr.info("Private Key is not imported.", "Settings Notification");
toastr.error("null return from iguana_bitcoinRPC", "Settings Notification");
}
})
}
});
$('.wifkeys-import-form input').keypress(function(e) {
if (e.which == 13) {
if ($('.wifkeys-import-form').validate().form()) {
$('.wifkeys-import-form').submit(); //form validation success, call ajax form submit
}
return false;
}
});
};
return {
@ -130,6 +175,7 @@ var WalletSettings = function() {
init: function() {
handleWalletExportKeys();
handleWalletImportKeys();
}
};

35
index.html

@ -1857,7 +1857,40 @@
<label class="floating-label" for="wifkeys_passphrase">Passphrase</label>
</div>
<div class="col-sm-12 col-xs-12" style="text-align: center;">
<button type="submit" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="settings_getcoinpeers_btn">Get Wif Keys</button>
<button type="submit" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="wifkeys_passphrase_btn">Get Wif Keys</button>
</div>
</form>
<div class="col-sm-12" style="padding-top: 15px;">
<div class="row" id="wif-priv-keys" data-plugin="masonry">
</div>
</div>
</div>
</div>
</div>
<div class="panel">
<div class="panel-heading" id="ImportKeys" role="tab">
<a class="panel-title collapsed" data-toggle="collapse" href="#ImportKeysTab"
data-parent="#SettingsAccordion" aria-expanded="false"
aria-controls="ImportKeysTab">
<i class="icon md-key" aria-hidden="true"></i>Import Keys
</a>
</div>
<div class="panel-collapse collapse" id="ImportKeysTab" aria-labelledby="ImportKeys"
role="tabpanel">
<div class="panel-body">
<p>This section allows you to import private key of all iguana supported coins, Assetchain, Geckochain, or PAXchain by the wallet.<br>It is not mandatory to have that coin active in the wallet for which you are executing import private key process.<br>You'll also notice the private key you imported for one coin or chain will also be showing a new address in all other coin wallets' receiving address section. It is normal. <b><i>Please keep these keys extra safe and secure.</i></b></p>
<div class="col-sm-12"></div>
<form class="wifkeys-import-form" method="post" action="javascript:;" autocomplete="off" onsubmit="return false;">
<div class="form-group form-material floating">
<input type="text" class="form-control" name="import_wifkey" id="import_wifkey">
<label class="floating-label" for="import_wifkey">Input Private Key</label>
</div>
<div class="col-sm-12 col-xs-12" style="text-align: center;">
<button type="submit" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="import_wifkey_btn">Import Private Key</button>
</div>
</form>

Loading…
Cancel
Save