added market cap data on network page

This commit is contained in:
Lee Wong 2017-03-29 00:08:41 +07:00 committed by Chuck Williams
parent 2880b77cf2
commit acfc0700e1
3 changed files with 25 additions and 4 deletions

View file

@ -3,6 +3,25 @@
$(document).ready(function () {
var siteApi = window.globals.siteApi || '/api/v1';
var marketCapApi = 'https://www.coincap.io/front/'
if ($('#marketcap_count').length) {
function results(json){
var $dash="DASH",
result = json.filter(function(itm){
return $dash.indexOf(itm.short) > -1;
});
var num = result[0].mktcap.toFixed(0).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
$('#marketcap_count').text(num);
}
$.ajax({
url: "https://www.coincap.io/front/",
dataType: "jsonp",
jsonpCallback: "results"
});
}
if ($('#blocks').length) {