Browse Source

API execution improved tiny bit

master
Satinder Grewal 8 years ago
parent
commit
18f22f1c6a
  1. 64
      assets/scripts/atomicexplorer.js
  2. 10
      assets/scripts/dashboard.js
  3. 24
      assets/scripts/sidebar.js
  4. 3
      index.html

64
assets/scripts/atomicexplorer.js

@ -0,0 +1,64 @@
var AtomicExplorer = function() {
toastr.options = {
"closeButton": true,
"debug": false,
"positionClass": "toast-top-right",
"showDuration": "5000",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
var handleExplorer = function() {
$('#atomic_explorer_getcoinpeers_btn').click(function() {
console.log("button pushed in atomic explorer")
/*$.ajax({
type: 'GET',
url: 'http://127.0.0.1:7778/api/bitcoinrpc/walletlock',
dataType: 'text',
success: function(data, textStatus, jqXHR) {
var LogoutOutput = JSON.parse(data);
sessionStorage.clear();
console.log('== Logout Data OutPut ==');
console.log(LogoutOutput);
},
error: function(xhr, textStatus, error) {
console.log('failure');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
//swal("Oops...", "Something went wrong!", "error");
toastr.warning("Opps... Something went wrong!", "Account Notification")
}
});*/
});
};
return {
//main function to initiate the module
init: function() {
handleExplorer();
}
};
}();
jQuery(document).ready(function() {
AtomicExplorer.init();
});

10
assets/scripts/dashboard.js

@ -207,15 +207,15 @@ var Dashboard = function() {
//Get coin history and pupulate balance and other info to wallet widget //Get coin history and pupulate balance and other info to wallet widget
var historyvalues = {"timeout":20000,"immediate":100,"agent":"basilisk","method":"history","vals":{"coin":"" + AllcoinsDataOutput[value][index] + ""}}; var historyvalues = {"timeout":20000,"immediate":100,"agent":"basilisk","method":"history","vals":{"coin":"" + AllcoinsDataOutput[value][index] + ""}};
var ExecuteShowCoinHistory = setInterval(function() { var ExecuteShowCoinHistory = setInterval(function() {
if ( sessionStorage.getItem('IguanaActiveAccount') === null ) { if ( sessionStorage.getItem('IguanaActiveAccount') === null || sessionStorage.getItem('DashboardActions') === null || sessionStorage.getItem('DashboardActions') === "stop" ) {
clearInterval(ExecuteShowCoinHistory); clearInterval(ExecuteShowCoinHistory);
console.log('=> No wallet logged in. No need to Run History.'); console.log('=> No wallet logged in, or Dashboard not ative. No need to Run History.');
} else { } else if ( sessionStorage.getItem('DashboardActions') === null || sessionStorage.getItem('DashboardActions') === "start") {
if ( value == "basilisk" ) { if ( value == "basilisk" ) {
console.log("ShowCoinHistory and ShowCoinProgressBar not executing for basilisk..."); //console.log("ShowCoinHistory and ShowCoinProgressBar not executing for basilisk...");
} else { } else {
ShowCoinHistory(historyvalues); ShowCoinHistory(historyvalues);
console.log('wallet widget refereshed (every 1 seconds)'); //console.log('wallet widget refereshed (every 1 seconds)');
//Show Coin Progress Bars //Show Coin Progress Bars
ShowCoinProgressBar(AllcoinsDataOutput[value][index]); ShowCoinProgressBar(AllcoinsDataOutput[value][index]);
} }

24
assets/scripts/sidebar.js

@ -16,7 +16,9 @@ $(document).ready(function() {
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" ); $('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("Dashboard") $(".header-easydex-section").text("Dashboard");
sessionStorage.setItem('DashboardActions', "start");
$(document).ready(function() { Dashboard.init(); });
}); });
@ -36,7 +38,9 @@ $('#nav-dashboard').on('click', function() {
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" ); $('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("Dashboard") $(".header-easydex-section").text("Dashboard");
sessionStorage.setItem('DashboardActions', "start");
$(document).ready(function() { Dashboard.init(); });
}); });
$('#nav-easydex').on('click', function() { $('#nav-easydex').on('click', function() {
@ -55,7 +59,8 @@ $('#nav-easydex').on('click', function() {
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" ); $('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("EasyDEX") $(".header-easydex-section").text("EasyDEX");
sessionStorage.setItem('DashboardActions', "stop");
}); });
$('#nav-komodo-wallet').on('click', function() { $('#nav-komodo-wallet').on('click', function() {
@ -74,7 +79,8 @@ $('#nav-komodo-wallet').on('click', function() {
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" ); $('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("Komodo Wallet") $(".header-easydex-section").text("Komodo Wallet");
sessionStorage.setItem('DashboardActions', "stop");
}); });
$('#nav-zcash-wallet').on('click', function() { $('#nav-zcash-wallet').on('click', function() {
@ -93,7 +99,8 @@ $('#nav-zcash-wallet').on('click', function() {
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" ); $('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$(".header-easydex-section").text("Zcash Wallet") $(".header-easydex-section").text("Zcash Wallet");
sessionStorage.setItem('DashboardActions', "stop");
}); });
$('#nav-iguana-atomic-explorer').on('click', function() { $('#nav-iguana-atomic-explorer').on('click', function() {
@ -112,7 +119,8 @@ $('#nav-iguana-atomic-explorer').on('click', function() {
$('#nav-about-iguana').removeClass( " active open" ).addClass( "" ); $('#nav-about-iguana').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-atomic-explorer').removeClass( "" ).addClass( "active open" ); $('#nav-iguana-atomic-explorer').removeClass( "" ).addClass( "active open" );
$(".header-easydex-section").text("Atomic Explorer") $(".header-easydex-section").text("Atomic Explorer");
sessionStorage.setItem('DashboardActions', "stop");
}); });
$('#nav-iguana-wallet-settings').on('click', function() { $('#nav-iguana-wallet-settings').on('click', function() {
@ -133,6 +141,7 @@ $('#nav-iguana-wallet-settings').on('click', function() {
$('#nav-iguana-wallet-settings').removeClass( "" ).addClass( "active open" ); $('#nav-iguana-wallet-settings').removeClass( "" ).addClass( "active open" );
$(".header-easydex-section").text("Wallet Settings") $(".header-easydex-section").text("Wallet Settings")
Settings_ShowWalletInfo(); //Execute this function from walletsettings.js file Settings_ShowWalletInfo(); //Execute this function from walletsettings.js file
sessionStorage.setItem('DashboardActions', "stop");
}); });
$('#nav-about-iguana').on('click', function() { $('#nav-about-iguana').on('click', function() {
@ -151,6 +160,7 @@ $('#nav-about-iguana').on('click', function() {
$('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-atomic-explorer').removeClass( " active open" ).addClass( "" );
$('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" ); $('#nav-iguana-wallet-settings').removeClass( " active open" ).addClass( "" );
$('#nav-about-iguana').removeClass( "" ).addClass( "active open" ); $('#nav-about-iguana').removeClass( "" ).addClass( "active open" );
$(".header-easydex-section").text("About Iguana") $(".header-easydex-section").text("About Iguana");
sessionStorage.setItem('DashboardActions', "stop");
}); });

3
index.html

@ -643,7 +643,7 @@
</select> </select>
</div> </div>
<div class="col-sm-4 col-xs-12" style="text-align: center;"> <div class="col-sm-4 col-xs-12" style="text-align: center;">
<button type="button" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="atomic_explorer_getcoinpeers_btn" onclick="Settings_ShowCoinPeers()">Submit</button> <button type="button" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-dismiss="modal" id="atomic_explorer_getcoinpeers_btn">Submit</button>
</div> </div>
</div> </div>
</div> </div>
@ -854,6 +854,7 @@
<script src="assets/scripts/coinwallets.js"></script> <script src="assets/scripts/coinwallets.js"></script>
<script src="assets/scripts/sidebar.js"></script> <script src="assets/scripts/sidebar.js"></script>
<script src="assets/scripts/walletsettings.js"></script> <script src="assets/scripts/walletsettings.js"></script>
<script src="assets/scripts/atomicexplorer.js"></script>
<script> <script>
(function(document, window, $) { (function(document, window, $) {
'use strict'; 'use strict';

Loading…
Cancel
Save