Browse Source

Merge pull request #53 from pbca26/master

code cleanup
master
Satinder Grewal 8 years ago
committed by GitHub
parent
commit
0b439f3277
  1. 8201
      assets/global/vendor/socket.io.js
  2. 62
      assets/scripts/dashboard.js
  3. 2223
      assets/scripts/iguana_api.js
  4. 2523
      assets/scripts/kmd_wallet_dashboard.js
  5. 1572
      assets/scripts/login.js
  6. 211
      assets/scripts/sidebar.js
  7. 37
      assets/scripts/walletsettings.js
  8. 8
      index.html

8201
assets/global/vendor/socket.io.js

File diff suppressed because it is too large

62
assets/scripts/dashboard.js

@ -38,7 +38,7 @@ var Dashboard = function() {
$('#btn_edexcoin_recieve').show();
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
$('#edexcoin_getbalance_interest').hide();
$('#edexcoin_getbalance_total_interest').hide();
$('#edexcoin_getbalance_t').removeClass( 'col-lg-4' ).addClass( 'col-lg-12' );
@ -207,9 +207,9 @@ var Dashboard = function() {
});
edexcoin_send_form_validator = $('.edexcoin-send-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
// 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: {
edexcoin_send_from: {
required: true
@ -325,9 +325,9 @@ var Dashboard = function() {
$('#edexcoin-send-confirm-screen').hide();
$('#edexcoin-send-txdetails-screen').hide();
$('#edexcoin-send-screen').show();
var active_edexcoin = '';
var tmp_send_to_addr = '';
var tmp_send_total_amount = '';
var active_edexcoin = '',
tmp_send_to_addr = '',
tmp_send_total_amount = '';
edexcoin_send_form_validator.resetForm();
$('#edexcoin_send_step_1').removeClass( '' ).addClass( 'current' );
$('#edexcoin_send_step_2').removeClass( 'current' ).addClass( '' );
@ -639,7 +639,7 @@ var Dashboard = function() {
$('.btn_edexcoin_dashboard_validate').click(function() {
var selected_coin = $(this).data('edexcoin');
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);
$('#edex_total_balance_coincode').text(coincode);
//populate selected coin's address
// populate selected coin's address
EDEXMainAddr(selected_coin).then(function(result) {
$('#edexcoin_active_addr').text(result);
$('#edexcoin_active_addr_clipboard').attr('data-clipboard-text', result);
@ -1078,7 +1078,7 @@ function getDEXGetBalance(coin) {
var total_balance = 0,
total_interest = 0;
Promise.all(data.result.map((coinaddr_value,coinaddr_index) => {
Promise.all(data.result.map((coinaddr_value, coinaddr_index) => {
let params = {
'userpass': tmpIguanaRPCAuth,
'agent': 'dex',
@ -1134,20 +1134,29 @@ function getDEXGetBalance_cache(coin) {
NProgress.start();
return new Promise((resolve) => {
Shepherd_CheckBasiliskCacheData(coin).then(function(result){
console.log(result)
console.log(result.coin)
Shepherd_CheckBasiliskCacheData(coin).then(function(result) {
console.log(result);
console.log(result.coin);
if (result.coin == false || result.addresses == false) {
var call_data = {"allcoins": false,"coin":coin,"calls":"listtransactions:getbalance"}
console.log(call_data)
} else if (result.getbalance == false || result.listtransactions == false) {
var call_data = {"allcoins": false,"coin":coin,"calls":"getbalance:listtransactions"}
var call_data = {
'allcoins': false,
'coin': coin,
'calls': 'listunspent:listtransactions:getbalance'
};
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){
console.log(result)
})
Shepherd_FetchBasiliskData(call_data).then(function(result) {
console.log(result);
});
})
Shepherd_GetBasiliskCache().then(function(result) {
@ -1156,7 +1165,7 @@ function getDEXGetBalance_cache(coin) {
total_balance = 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) => {
if ( query[coin][coinaddr_value].getbalance.data !== undefined ) {
var data = query[coin][coinaddr_value].getbalance.data;
@ -1207,7 +1216,7 @@ function getDEXGetBalance2(coin) {
NProgress.start();
return new Promise((resolve) => {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth');
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data_1 = {
'userpass': tmpIguanaRPCAuth,
'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' );
$('#edex-footer').css('height', '11px');
resizeDashboardWindow();
$('#edexcoin-wallet-waitingrt-alert').hide()
$('#edexcoin-wallet-waitingrt-alert').hide();
}
if ( parseInt(CoinInfoData.RTheight) == 0 ) {
var coin_blocks = parseInt(CoinInfoData.blocks),
@ -2000,9 +2009,8 @@ function EdexGetTxList_cache(coin) {
return new Promise((resolve) => {
Shepherd_GetBasiliskCache().then(function(result) {
var _data = JSON.parse(result)
query = _data.result.basilisk;
var active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'),
query = _data.result.basilisk,
active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode'),
total_utxos = [];
Promise.all(query[coin].addresses.map((coinaddr_value, coinaddr_index) => {
@ -2304,7 +2312,7 @@ function EdexListAllAddr(coin) {
var only_reciving_addr_data = [];
$.each(result, function(index, value) {
if(value.interest == undefined || coin !== 'KMD') {
if (value.interest == undefined || coin !== 'KMD') {
console.log('interest is undefined');
tmp_interest = 'NA';
} else {

2223
assets/scripts/iguana_api.js

File diff suppressed because it is too large

2523
assets/scripts/kmd_wallet_dashboard.js

File diff suppressed because it is too large

1572
assets/scripts/login.js

File diff suppressed because it is too large

211
assets/scripts/sidebar.js

@ -24,7 +24,7 @@ $(document).ready(function() {
$('#nav-dashboard').on('click', function() {
$('#section-dashboard').show();
var active_edexcoin = $('[data-edexcoin]').attr("data-edexcoin");
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin');
if (active_edexcoin !== 'COIN') {
$('#header-dashboard').show();
}
@ -34,16 +34,16 @@ $('#nav-dashboard').on('click', function() {
$('#section-iguana-atomic-explorer').hide();
$('#section-iguana-wallet-settings').hide();
$('#section-about-iguana').hide();
$('#nav-dashboard').removeClass( "" ).addClass( "active open" );
$('#nav-easydex').removeClass( " active open" ).addClass( "" );
$('#nav-komodo-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-zcash-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("Dashboard");
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active') });
$(this.parentElement).addClass('active')
$('#nav-dashboard').removeClass( '' ).addClass( 'active open' );
$('#nav-easydex').removeClass( 'active open' ).addClass( '' );
$('#nav-komodo-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-zcash-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$(".header-easydex-section").text('Dashboard');
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active'); });
$(this.parentElement).addClass('active');
removeKMDWalletStyle();
removeZECWalletStyle();
CommonSidebarActionsSet011();
@ -59,15 +59,15 @@ $('#nav-easydex').on('click', function() {
$('#section-about-iguana').hide();
$('#section-iguana-atomic-explorer').hide();
$('#section-iguana-wallet-settings').hide();
$('#nav-dashboard').removeClass( " active open" ).addClass( "" );
$('#nav-easydex').removeClass( "" ).addClass( "active open" );
$('#nav-komodo-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-zcash-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("EasyDEX");
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active') });
$('#nav-dashboard').removeClass( 'active open' ).addClass( '' );
$('#nav-easydex').removeClass( '' ).addClass( 'active open' );
$('#nav-komodo-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-zcash-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$(".header-easydex-section").text('EasyDEX');
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active'); });
$(this.parentElement).addClass('active')
removeKMDWalletStyle();
removeZECWalletStyle();
@ -84,21 +84,30 @@ $('#nav-komodo-wallet').on('click', function() {
$('#section-about-iguana').hide();
$('#section-iguana-atomic-explorer').hide();
$('#section-iguana-wallet-settings').hide();
$('#nav-dashboard').removeClass( " active open" ).addClass( "" );
$('#nav-easydex').removeClass( " active open" ).addClass( "" );
$('#nav-komodo-wallet').removeClass( "" ).addClass( "active open" );
$('#nav-zcash-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
//$.each($('[data-extcoin="KMD"]'), function(index, value) {console.log($('[data-extcoin="KMD"]').data()); $('[data-extcoin="KMD"]').attr("data-extcoin","ZEC"); });
$.each($('[data-extcoin]'), function(index, value) {$('[data-extcoin]').attr("data-extcoin","KMD"); $('[data-extcoin="KMD"]')});
$.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
$('#nav-dashboard').removeClass( 'active open' ).addClass( '' );
$('#nav-easydex').removeClass( 'active open' ).addClass( '' );
$('#nav-komodo-wallet').removeClass( '' ).addClass( 'active open' );
$('#nav-zcash-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$.each($('[data-extcoin]'), function(index, value) {
$('[data-extcoin]').attr('data-extcoin', 'KMD');
$('[data-extcoin="KMD"]');
});
$.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 Dashboard sript
RunKMDInitFunctions();
applyKMDWalletStyle();
//removeZECWalletStyle();
// removeZECWalletStyle();
CommonSidebarActionsSet02();
removeDashboardStyle();
});
@ -106,30 +115,44 @@ $('#nav-komodo-wallet').on('click', function() {
$('#nav-zcash-wallet').on('click', function() {
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>'
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();
$('#section-dashboard').hide();
$('#header-dashboard').hide();
$('#section-easydex').hide();
$('#section-extcoin').hide();
//$('#section-zcash').show();
// $('#section-zcash').show();
$('#section-extcoin').show();
$('#section-about-iguana').hide();
$('#section-iguana-atomic-explorer').hide();
$('#section-iguana-wallet-settings').hide();
$('#nav-dashboard').removeClass( " active open" ).addClass( "" );
$('#nav-easydex').removeClass( " active open" ).addClass( "" );
$('#nav-komodo-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-zcash-wallet').removeClass( "" ).addClass( "active open" );
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("Zcash Wallet");
$.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
$('#nav-dashboard').removeClass( 'active open' ).addClass( '' );
$('#nav-easydex').removeClass( 'active open' ).addClass( '' );
$('#nav-komodo-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-zcash-wallet').removeClass( '' ).addClass( 'active open' );
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$(".header-easydex-section").text('Zcash Wallet');
$.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();
@ -147,16 +170,16 @@ $('#nav-iguana-atomic-explorer').on('click', function() {
$('#section-iguana-atomic-explorer').show();
$('#section-iguana-wallet-settings').hide();
$('#section-about-iguana').hide();
$('#nav-dashboard').removeClass( " active open" ).addClass( "" );
$('#nav-easydex').removeClass( " active open" ).addClass( "" );
$('#nav-komodo-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-zcash-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-atomic-explorer').removeClass( "" ).addClass( "active open" );
$(".header-easydex-section").text("Atomic Explorer");
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active') });
$(this.parentElement).addClass('active')
$('#nav-dashboard').removeClass( 'active open' ).addClass( '' );
$('#nav-easydex').removeClass( 'active open' ).addClass( '' );
$('#nav-komodo-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-zcash-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-atomic-explorer').removeClass( '' ).addClass( 'active open' );
$(".header-easydex-section").text('Atomic Explorer');
$.each($('.nav-top-menu'), function(index, value) { $(value).removeClass('active'); });
$(this.parentElement).addClass('active');
removeKMDWalletStyle();
removeZECWalletStyle();
CommonSidebarActionsSet02();
@ -173,17 +196,17 @@ $('#nav-iguana-wallet-settings').on('click', function() {
$('#section-iguana-atomic-explorer').hide();
$('#section-iguana-wallet-settings').show();
$('#section-about-iguana').hide();
$('#nav-dashboard').removeClass( " active open" ).addClass( "" );
$('#nav-easydex').removeClass( " active open" ).addClass( "" );
$('#nav-komodo-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-zcash-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( "" ).addClass( "active open" );
//$(".header-easydex-section").text("Wallet Settings");
$('#nav-dashboard').removeClass( 'active open' ).addClass( '' );
$('#nav-easydex').removeClass( 'active open' ).addClass( '' );
$('#nav-komodo-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-zcash-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( '' ).addClass( 'active open' );
// $(".header-easydex-section").text("Wallet Settings");
removeKMDWalletStyle();
removeZECWalletStyle();
Settings_ShowWalletInfo(); //Execute this function from walletsettings.js file
Settings_ShowWalletInfo(); // Execute this function from walletsettings.js file
CommonSidebarActionsSet02();
removeDashboardStyle();
$('#easydex-header-div').hide();
@ -198,14 +221,14 @@ $('#nav-about-iguana').on('click', function() {
$('#section-iguana-atomic-explorer').hide();
$('#section-iguana-wallet-settings').hide();
$('#section-about-iguana').show();
$('#nav-dashboard').removeClass( " active open" ).addClass( "" );
$('#nav-easydex').removeClass( " active open" ).addClass( "" );
$('#nav-komodo-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-zcash-wallet').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( "" ).addClass( "active open" );
$(".header-easydex-section").text("About Iguana");
$('#nav-dashboard').removeClass( 'active open' ).addClass( '' );
$('#nav-easydex').removeClass( 'active open' ).addClass( '' );
$('#nav-komodo-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-zcash-wallet').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-atomic-explorer').removeClass( 'active open' ).addClass( '' );
$('#nav-iguana-wallet-settings').removeClass( 'active open' ).addClass( '' );
$('#nav-about-iguana').removeClass( '' ).addClass( 'active open' );
$(".header-easydex-section").text('About Iguana');
removeKMDWalletStyle();
removeZECWalletStyle();
CommonSidebarActionsSet02();
@ -213,30 +236,28 @@ $('#nav-about-iguana').on('click', function() {
$('#easydex-header-div').hide();
});
function CommonSidebarActionsSet01() {
sessionStorage.setItem('DashboardActions', "start");
sessionStorage.setItem('NativeWalletActions', "stop");
//$(document).ready(function() { Dashboard.init(); });
sessionStorage.setItem('DashboardActions', 'start');
sessionStorage.setItem('NativeWalletActions', 'stop');
// $(document).ready(function() { Dashboard.init(); });
$("#wifkeys_passphrase").val('');
$('#wif-priv-keys').html('');
}
function CommonSidebarActionsSet011() {
sessionStorage.setItem('DashboardActions', "start");
sessionStorage.setItem('NativeWalletActions', "stop");
//location.reload();
sessionStorage.setItem('DashboardActions', 'start');
sessionStorage.setItem('NativeWalletActions', 'stop');
// location.reload();
$("#wifkeys_passphrase").val('');
$('#wif-priv-keys').html('');
}
function CommonSidebarActionsSet02() {
sessionStorage.setItem('DashboardActions', "stop");
sessionStorage.setItem('DashboardActions', 'stop');
$("#wifkeys_passphrase").val('');
$('#wif-priv-keys').html('');
}
function applyKMDWalletStyle() {
$('.header-easydex-section').html('<img src="assets/images/kmd_header_title_logo.png">');
$('.page-title').hide();
@ -246,19 +267,18 @@ function applyKMDWalletStyle() {
$('#easydex_kmd_wallet_actions_header').show();
$('#easydex_zec_wallet_actions_header').hide();
$('#easydex_btc_btcd_balances_header').hide();
sessionStorage.setItem('NativeWalletActions', "start");
sessionStorage.setItem('NativeWalletActions', 'start');
}
function removeKMDWalletStyle() {
$('.page-title').show();
$('#easydex-header-div').removeAttr( "style" );
$('#easydex-header-div').removeAttr( 'style' );
$('#easydex_kmd_wallet_actions_header').hide();
$('#easydex_zec_wallet_actions_header').hide();
$('#easydex_btc_btcd_balances_header').show();
sessionStorage.setItem('NativeWalletActions', "stop");
sessionStorage.setItem('NativeWalletActions', 'stop');
}
function applyZECWalletStyle() {
$('.header-easydex-section').html('<img src="assets/images/zec_header_title_logo.png">');
$('.page-title').hide();
@ -268,30 +288,29 @@ function applyZECWalletStyle() {
$('#easydex_kmd_wallet_actions_header').hide();
$('#easydex_zec_wallet_actions_header').show();
$('#easydex_btc_btcd_balances_header').hide();
sessionStorage.setItem('NativeWalletActions', "start");
sessionStorage.setItem('NativeWalletActions', 'start');
}
function removeZECWalletStyle() {
$('.page-title').show();
$('#easydex-header-div').removeAttr( "style" );
$('#easydex-header-div').removeAttr( 'style' );
$('#easydex_kmd_wallet_actions_header').hide();
$('#easydex_zec_wallet_actions_header').hide();
$('#easydex_btc_btcd_balances_header').show();
sessionStorage.setItem('NativeWalletActions', "stop");
sessionStorage.setItem('NativeWalletActions', 'stop');
}
function applyDashboardStyle() {
$('.page-aside').show();
$('.page-main').show();
/* set default map height */
var navbarH = $(".site-navbar").outerHeight();
var footerH = $(".site-footer").outerHeight();
var mapH = $(window).height() - navbarH - footerH;
$(".page-main").outerHeight(mapH);
var navbarH = $('.site-navbar').outerHeight(),
footerH = $('.site-footer').outerHeight(),
mapH = $(window).height() - navbarH - footerH;
$('.page-main').outerHeight(mapH);
$('#easydex-header-div').hide();
var active_edexcoinmodecode = sessionStorage.getItem('edexTmpMode');
console.log(active_edexcoinmodecode)
console.log(active_edexcoinmodecode);
if (active_edexcoinmodecode == 'Basilisk') {
$('#edex-footer').hide();
} else {

37
assets/scripts/walletsettings.js

@ -1,9 +1,9 @@
var WalletSettings = function() {
var handleWalletExportKeys = function() {
$('.wifkeys-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
// 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: {
wifkeys_passphrase: {
required: true
@ -20,7 +20,7 @@ var WalletSettings = function() {
var Getwifkeys_passphrase = $('#wifkeys_passphrase').val(),
WifKeyDivContent = '';
//First check which coins are active. Execute API for each mode of wallet
// First check which coins are active. Execute API for each mode of wallet
$.each([
'native',
'basilisk',
@ -38,13 +38,13 @@ var WalletSettings = function() {
url: 'http://127.0.0.1:7778',
success: function(data, textStatus, jqXHR) {
var AllcoinsDataOutput = JSON.parse(data);
//Only execute further code if that mode has any coins active it. if none, skill checking on them.
// Only execute further code if that mode has any coins active it. if none, skill checking on them.
if (AllcoinsDataOutput[value].length !== 0 ) {
console.log('== AllCoins Data OutPut ==');
console.log(value);
console.log(AllcoinsDataOutput[value]);
//First Run Encryptwallet API to get wif keys for each active coin
// First Run Encryptwallet API to get wif keys for each active coin
$.each(AllcoinsDataOutput[value], function(index) {
var wifkey_coin_handle = AllcoinsDataOutput[value][index];
@ -125,7 +125,7 @@ var WalletSettings = function() {
$('.wifkeys-form input').keypress(function(e) {
if (e.which == 13) {
if ($('.wifkeys-form').validate().form()) {
$('.wifkeys-form').submit(); //form validation success, call ajax form submit
$('.wifkeys-form').submit(); // form validation success, call ajax form submit
}
return false;
@ -135,9 +135,9 @@ 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
// 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
@ -150,7 +150,7 @@ var WalletSettings = function() {
},
submitHandler: function(form) {
var Getimport_wifkey = $('#import_wifkey').val();
//console.log(Getimport_wifkey);
// console.log(Getimport_wifkey);
EDEXimportprivkey(Getimport_wifkey).then(function(result){
console.log(result)
if ( result.result !== undefined && result.result == 'success' ) {
@ -168,7 +168,7 @@ var WalletSettings = function() {
$('.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
$('.wifkeys-import-form').submit(); // form validation success, call ajax form submit
}
return false;
@ -177,7 +177,7 @@ var WalletSettings = function() {
};
return {
//main function to initiate the module
// main function to initiate the module
init: function() {
handleWalletExportKeys();
handleWalletImportKeys();
@ -221,7 +221,6 @@ function Settings_ShowCoinPeers() {
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:7778',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var getCoinPeers = JSON.parse(data);
console.log(getCoinPeers);
@ -270,12 +269,10 @@ function Settings_ShowCoinPeers() {
});
}
function Settings_AddCoinPeers() {
console.log('wait till peer ip added to selected coin...')
var settings_selected_coinname_code_val = $('option:selected', '#settings_select_coin_addpeer_options').val(),
settings_add_peer_ip_val = $("#settings_add_peer_ip").val(),
settings_add_peer_ip_val = $('#settings_add_peer_ip').val(),
tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
@ -289,7 +286,6 @@ function Settings_AddCoinPeers() {
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:7778',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var getAddCoinPeers = JSON.parse(data);
console.log(getAddCoinPeers);
@ -302,7 +298,7 @@ function Settings_AddCoinPeers() {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
@ -322,9 +318,8 @@ function Settings_LoadDebugLog() {
type: 'POST',
data: ajax_data,
url: 'http://127.0.0.1:17777/shepherd/debuglog',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
$('#read_debug_log_textarea').text(JSON.parse(data).result.replace('\n', '<br/>'));
$('#read_debug_log_textarea').text(JSON.parse(data).result.replace('\n', '\r\n'));
console.log(data);
},
error: function(xhr, textStatus, error) {

8
index.html

@ -2043,6 +2043,7 @@
<script src="assets/global/vendor/underscore-js/underscore-min.js"></script>
<script src="assets/global/vendor/javascript-md5/md5.min.js"></script>
<script src="assets/global/vendor/bluebird/bluebird.min.js"></script>
<script src="assets/global/vendor/socket.io.js"></script>
<!-- Crypto Dependencies -->
<script src="assets/scripts/wordlist.js" type="text/javascript"></script>
<script src="assets/scripts/passphrasegenerator.js" type="text/javascript"></script>
@ -2087,6 +2088,13 @@
var Site = window.Site;
$(document).ready(function() {
Site.run();
var socket = io.connect('http://localhost:17777');
socket.on('connect', function(data) {
socket.emit('join', 'EDEX GUI joined');
});
socket.on('messages', function(data) {
console.log(data);
});
});
})(document, window, jQuery);
</script>

Loading…
Cancel
Save