Browse Source

upstream merge fix

master
pbca26 8 years ago
parent
commit
c77f1fc0c4
  1. 60
      assets/scripts/dashboard.js
  2. 6
      assets/scripts/kmd_wallet_dashboard.js

60
assets/scripts/dashboard.js

@ -207,9 +207,9 @@ var Dashboard = function() {
}); });
edexcoin_send_form_validator = $('.edexcoin-send-form').validate({ edexcoin_send_form_validator = $('.edexcoin-send-form').validate({
//errorElement: 'span', //default input error message container // errorElement: 'span', //default input error message container
//errorClass: 'help-block', // default input error message class // errorClass: 'help-block', // default input error message class
//focusInvalid: false, // do not focus the last invalid input // focusInvalid: false, // do not focus the last invalid input
rules: { rules: {
edexcoin_send_from: { edexcoin_send_from: {
required: true required: true
@ -325,9 +325,9 @@ var Dashboard = function() {
$('#edexcoin-send-confirm-screen').hide(); $('#edexcoin-send-confirm-screen').hide();
$('#edexcoin-send-txdetails-screen').hide(); $('#edexcoin-send-txdetails-screen').hide();
$('#edexcoin-send-screen').show(); $('#edexcoin-send-screen').show();
var active_edexcoin = ''; var active_edexcoin = '',
var tmp_send_to_addr = ''; tmp_send_to_addr = '',
var tmp_send_total_amount = ''; tmp_send_total_amount = '';
edexcoin_send_form_validator.resetForm(); edexcoin_send_form_validator.resetForm();
$('#edexcoin_send_step_1').removeClass( '' ).addClass( 'current' ); $('#edexcoin_send_step_1').removeClass( '' ).addClass( 'current' );
$('#edexcoin_send_step_2').removeClass( 'current' ).addClass( '' ); $('#edexcoin_send_step_2').removeClass( 'current' ).addClass( '' );
@ -639,7 +639,7 @@ var Dashboard = function() {
$('.btn_edexcoin_dashboard_validate').click(function() { $('.btn_edexcoin_dashboard_validate').click(function() {
var selected_coin = $(this).data('edexcoin'); var selected_coin = $(this).data('edexcoin');
EDEXMainAddr(selected_coin).then(function(result) { EDEXMainAddr(selected_coin).then(function(result) {
Iguana_DEXValidateAddr(selected_coin,result); Iguana_DEXValidateAddr(selected_coin, result);
}); });
}); });
} }
@ -829,7 +829,7 @@ function edexCoinBtnAction() {
$('#edexcoin-active').text(selected_coinname); $('#edexcoin-active').text(selected_coinname);
$('#edex_total_balance_coincode').text(coincode); $('#edex_total_balance_coincode').text(coincode);
//populate selected coin's address // populate selected coin's address
EDEXMainAddr(selected_coin).then(function(result) { EDEXMainAddr(selected_coin).then(function(result) {
$('#edexcoin_active_addr').text(result); $('#edexcoin_active_addr').text(result);
$('#edexcoin_active_addr_clipboard').attr('data-clipboard-text', result); $('#edexcoin_active_addr_clipboard').attr('data-clipboard-text', result);
@ -1078,7 +1078,7 @@ function getDEXGetBalance(coin) {
var total_balance = 0, var total_balance = 0,
total_interest = 0; total_interest = 0;
Promise.all(data.result.map((coinaddr_value,coinaddr_index) => { Promise.all(data.result.map((coinaddr_value, coinaddr_index) => {
let params = { let params = {
'userpass': tmpIguanaRPCAuth, 'userpass': tmpIguanaRPCAuth,
'agent': 'dex', 'agent': 'dex',
@ -1134,20 +1134,29 @@ function getDEXGetBalance_cache(coin) {
NProgress.start(); NProgress.start();
return new Promise((resolve) => { return new Promise((resolve) => {
Shepherd_CheckBasiliskCacheData(coin).then(function(result){ Shepherd_CheckBasiliskCacheData(coin).then(function(result) {
console.log(result) console.log(result);
console.log(result.coin) console.log(result.coin);
if (result.coin == false || result.addresses == false) { if (result.coin == false || result.addresses == false) {
var call_data = {"allcoins": false,"coin":coin,"calls":"listunspent:listtransactions:getbalance"} var call_data = {
console.log(call_data) 'allcoins': false,
} else if (result.getbalance == false || result.listtransactions == false) { 'coin': coin,
var call_data = {"allcoins": false,"coin":coin,"calls":"getbalance:listtransactions"} 'calls': 'listunspent:listtransactions:getbalance'
};
console.log(call_data) console.log(call_data)
} else if (result.getbalance == false) {
var call_data = {
'allcoins': false,
'coin': coin,
'calls': 'getbalance:listtransactions'
};
console.log(call_data);
} }
Shepherd_FetchBasiliskData(call_data).then(function(result){ Shepherd_FetchBasiliskData(call_data).then(function(result) {
console.log(result) console.log(result);
}) });
}) })
Shepherd_GetBasiliskCache().then(function(result) { Shepherd_GetBasiliskCache().then(function(result) {
@ -1156,7 +1165,7 @@ function getDEXGetBalance_cache(coin) {
total_balance = 0, total_balance = 0,
total_interest = 0; total_interest = 0;
Promise.all(query[coin].addresses.map((coinaddr_value,coinaddr_index) => { Promise.all(query[coin].addresses.map((coinaddr_value, coinaddr_index) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if ( query[coin][coinaddr_value].getbalance.data !== undefined ) { if ( query[coin][coinaddr_value].getbalance.data !== undefined ) {
var data = query[coin][coinaddr_value].getbalance.data; var data = query[coin][coinaddr_value].getbalance.data;
@ -1207,7 +1216,7 @@ function getDEXGetBalance2(coin) {
NProgress.start(); NProgress.start();
return new Promise((resolve) => { return new Promise((resolve) => {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'); var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data_1 = { ajax_data_1 = {
'userpass': tmpIguanaRPCAuth, 'userpass': tmpIguanaRPCAuth,
'agent': 'SuperNET', 'agent': 'SuperNET',
@ -1719,7 +1728,7 @@ function ShowCoinProgressBar(coin) {
$('div[data-edexcoin="'+coin+'"][id="currency-bundles"]').removeClass( 'progress-bar-info' ).addClass( 'progress-bar-indicating progress-bar-success' ); $('div[data-edexcoin="'+coin+'"][id="currency-bundles"]').removeClass( 'progress-bar-info' ).addClass( 'progress-bar-indicating progress-bar-success' );
$('#edex-footer').css('height', '11px'); $('#edex-footer').css('height', '11px');
resizeDashboardWindow(); resizeDashboardWindow();
$('#edexcoin-wallet-waitingrt-alert').hide() $('#edexcoin-wallet-waitingrt-alert').hide();
} }
if ( parseInt(CoinInfoData.RTheight) == 0 ) { if ( parseInt(CoinInfoData.RTheight) == 0 ) {
var coin_blocks = parseInt(CoinInfoData.blocks), var coin_blocks = parseInt(CoinInfoData.blocks),
@ -2000,9 +2009,8 @@ function EdexGetTxList_cache(coin) {
return new Promise((resolve) => { return new Promise((resolve) => {
Shepherd_GetBasiliskCache().then(function(result) { Shepherd_GetBasiliskCache().then(function(result) {
var _data = JSON.parse(result) var _data = JSON.parse(result)
query = _data.result.basilisk; query = _data.result.basilisk,
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'),
var active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'),
total_utxos = []; total_utxos = [];
Promise.all(query[coin].addresses.map((coinaddr_value, coinaddr_index) => { Promise.all(query[coin].addresses.map((coinaddr_value, coinaddr_index) => {
@ -2304,7 +2312,7 @@ function EdexListAllAddr(coin) {
var only_reciving_addr_data = []; var only_reciving_addr_data = [];
$.each(result, function(index, value) { $.each(result, function(index, value) {
if(value.interest == undefined || coin !== 'KMD') { if (value.interest == undefined || coin !== 'KMD') {
console.log('interest is undefined'); console.log('interest is undefined');
tmp_interest = 'NA'; tmp_interest = 'NA';
} else { } else {

6
assets/scripts/kmd_wallet_dashboard.js

@ -472,9 +472,11 @@ function getPassthruAgent() {
} }
function getTotalKMDBalance() { function getTotalKMDBalance() {
var extcoin = $('[data-extcoin]').attr('data-extcoin'),
passthru_agent = '';
console.log($('[data-extcoin]').attr('data-extcoin')); console.log($('[data-extcoin]').attr('data-extcoin'));
var extcoin = $('[data-extcoin]').attr('data-extcoin');
var passthru_agent = '';
if ( extcoin == 'KMD') { passthru_agent = 'komodo'; }; if ( extcoin == 'KMD') { passthru_agent = 'komodo'; };
if ( extcoin == 'ZEC') { passthru_agent = 'zcash'; }; if ( extcoin == 'ZEC') { passthru_agent = 'zcash'; };

Loading…
Cancel
Save