Browse Source

Komodo/Zcash GUI initialise wallet checks added

master
Satinder Grewal 8 years ago
parent
commit
4f439ce5e4
  1. 4
      assets/scripts/dashboard.js
  2. 105
      assets/scripts/kmd_wallet_dashboard.js
  3. 3
      assets/scripts/sidebar.js
  4. 2
      index.html

4
assets/scripts/dashboard.js

@ -10,9 +10,9 @@ var Dashboard = function() {
"closeButton": true,
"debug": false,
"positionClass": "toast-top-right",
"showDuration": "5000",
"showDuration": "15000",
"hideDuration": "1000",
"timeOut": "5000",
"timeOut": "15000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",

105
assets/scripts/kmd_wallet_dashboard.js

@ -230,12 +230,12 @@ var KMDWalletDashboard = function() {
//main function to initiate the module
init: function() {
handle_KMD_Dashboard();
KMDfillTxHistoryT();
//KMDfillTxHistoryT();
KMDGetTXIDdetails();
handle_KMD_Send();
KMDWalletRecieve();
KMDWalletSettings();
RunInitFunctions();
//RunKMDInitFunctions();
}
};
@ -246,14 +246,31 @@ jQuery(document).ready(function() {
});
function RunInitFunctions() {
function RunKMDInitFunctions() {
NProgress.done(true);
NProgress.configure({
template: '<div class="bar nprogress-bar-header nprogress-bar-info" role="bar"></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
});
NProgress.start();
getTotalKMDBalance();
KMDfillTxHistoryT();
var check1 = CheckIfConnected();
console.log(check1[0]);
if ( check1[0] == 'not active' ) {
console.log('Could not connect to external wallet. Is external wallet running?');
toastr.error("Connection Error. Is external wallet running?", "Wallet Notification");
$('#extcoin-wallet').hide();
}
if ( check1[0] == 'null return' ) {
console.log('Could not connect to external wallet. Is iguana connected to external wallet?');
toastr.error("Connection Error. Is iguana connected to external wallet?", "Wallet Notification");
$('#extcoin-wallet').hide();
}
if ( check1[0] == 'connected' ) {
getTotalKMDBalance();
KMDfillTxHistoryT();
$('#extcoin-wallet').show();
}
//KMDWalletDashboard.init()
$('#kmd_wallet_recieve_section').hide();
NProgress.done();
}
@ -1078,4 +1095,82 @@ function KMDZSendManyTransaction() {
//console.log(result);
KMDListAllOPIDs();
return result;
}
function CheckIfConnected() {
var result = [];
var extcoin = $('[data-extcoin]').attr("data-extcoin");
var passthru_agent = getPassthruAgent();
var ajax_data = {"agent":passthru_agent,"method":"passthru","function":"getinfo","hex":""}
console.log(ajax_data);
$.ajax({
async: false,
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:7778',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
console.log('== Data OutPut ==');
console.log(AjaxOutputData.error);
if ( AjaxOutputData.errors != undefined ) {
//console.log('connected');
result.push('connected');
} else if ( AjaxOutputData.errors == undefined) {
result.push('not active');
} else {
result.push(AjaxOutputData.errors);
}
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
return result;
}
function CheckIfWalletEncrypted() {
var result = [];
var passthru_agent = getPassthruAgent();
var ajax_data = {"agent":passthru_agent,"method":"passthru","function":"walletlock","hex":""}
console.log(ajax_data);
$.ajax({
async: false,
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:7778',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
console.log('== Data OutPut ==');
console.log(AjaxOutputData.error);
if ( AjaxOutputData.errors != undefined ) {
//console.log('encrypted');
result.push('encrypted');
} else {
result.push(AjaxOutputData.error);
}
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
return result;
}

3
assets/scripts/sidebar.js

@ -88,6 +88,7 @@ $('#nav-komodo-wallet').on('click', function() {
$.each($('[data-extcoinname]'), function(index, value) {$('[data-extcoinname]').text("KMD"); $('[data-extcoinname="KMD"]')});
$.each($('[data-extcointitle]'), function(index, value) {$('[data-extcointitle]').text("Komodo"); $('[data-extcointitle="Komodo"]')});
KMDWalletDashboard.init(); //Initiate Komodo Dashbaord sript
RunKMDInitFunctions();
applyKMDWalletStyle();
//removeZECWalletStyle();
CommonSidebarActionsSet02();
@ -116,11 +117,11 @@ $('#nav-zcash-wallet').on('click', function() {
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("Zcash Wallet");
console.log('changing to zcash')
$.each($('[data-extcoin]'), function(index, value) {$('[data-extcoin]').attr("data-extcoin","ZEC"); $('[data-extcoin="ZEC"]')});
$.each($('[data-extcoinname]'), function(index, value) {$('[data-extcoinname]').text("ZEC"); $('[data-extcoinname="ZEC"]')});
$.each($('[data-extcointitle]'), function(index, value) {$('[data-extcointitle]').text("Zcash"); $('[data-extcointitle="Zcash"]')});
KMDWalletDashboard.init(); //Initiate Komodo Dashbaord sript
RunKMDInitFunctions();
applyZECWalletStyle();
//removeKMDWalletStyle();
CommonSidebarActionsSet02();

2
index.html

@ -618,7 +618,7 @@
<!-- BEGIN KOMODO WALLET CONTENT BODY -->
<div class="page-content" data-extcoin="COIN" id="section-extcoin">
<div class="row" data-extcoin="COIN" id="extcoin-wallet" data-plugin="masonry">
<div class="row" data-extcoin="COIN" id="extcoin-wallet" data-plugin="masonry" style="display: none;">
<div class="col-xs-12">
<div class="col-lg-3 col-xs-12" data-extcoin="COIN" id="kmd_widget_get_total_balance_t">
<!-- KMD Transparent Balance Widget-->

Loading…
Cancel
Save